Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for YDB
  • Getting started
  • Access management
      • Setting up AWS tools
      • Data operations through the HTTP interface
    • Common errors when using the Document API
  • Monitoring metrics
  • Audit Trails events
  • FAQ
  • Public materials

In this article:

  • Getting started
  • Creating a table
  • Adding data
  • Reading a record
  1. Amazon DynamoDB-compatible Document API
  2. Tools
  3. Data operations through the HTTP interface

Data operations through the HTTP interface

Written by
Yandex Cloud
Updated at April 24, 2026
View in Markdown
  • Getting started
  • Creating a table
  • Adding data
  • Reading a record

In this section, you will learn how to create a table, populate it with data, and then read this data using the Document API HTTP interface.

In our examples below, we will be using cURL to run HTTP requests.

Warning

The Document API only allows you to access document tables.

Getting startedGetting started

  1. If you do not have the Yandex Cloud CLI yet, install and initialize it.

  2. Prepare the Document API endpoint of your database.

    Where to find the Document API endpoint of a database
    1. Navigate to the management console.

    2. Select the folder and go to Managed Service for YDB.

    3. Select the database you want to query.

    4. In the menu on the left, go to the Overview section.

    5. The Document API endpoint line shows the endpoint value.

      Here is an example of an endpoint value: https://docapi.serverless.yandexcloud.net/ru-central1/b1gia87mbaomkfvs6rgl/etnudu2n9ri35luqe4h1.

    Note

    For the Amazon DynamoDB compatibility mode, use a serverless database configuration.

  3. Set the ENDPOINT environment variable to the prepared value:

    export ENDPOINT=<Document_API_endpoint>
    

Creating a tableCreating a table

HTTP interface

Specify the table configuration in the create.json file:

{
  "TableName": "test/pets",
  "AttributeDefinitions":
  [
    {
      "AttributeName": "species",
      "AttributeType": "S"
    },
    {
      "AttributeName": "name",
      "AttributeType": "S"
    }
  ],
  "KeySchema":
  [
    {
      "AttributeName": "species",
      "KeyType": "HASH"
    },
    {
      "AttributeName": "name",
      "KeyType": "RANGE"
    }
  ]
}

Create a document table in the database using this command:

curl \
  --header 'X-Amz-Target: DynamoDB_20120810.CreateTable' \
  --header "Authorization: Bearer $(yc iam create-token)" \
  --header "Content-Type: application.json" \
  --data @create.json $ENDPOINT

For more information about the CreateTable method, see the Document API reference.

Adding dataAdding data

HTTP interface

Prepare the data to save to the document table by creating a file named put.json:

{
  "TableName": "test/pets",
  "Item":
  {
    "species": {"S": "cat"},
    "name":    {"S": "Tom"},
    "color":   {"S": "black"},
    "price":   {"N": "10.5"}
  }
}

Add the data to the table using this command:

curl \
  --header 'X-Amz-Target: DynamoDB_20120810.PutItem' \
  --header "Authorization: Bearer $(yc iam create-token)" \
  --header "Content-Type: application.json" \
  --data @put.json $ENDPOINT

For more information about the PutItem method, see the Document API reference.

Reading a recordReading a record

HTTP interface

To read data from a document table, run this command:

curl \
  --header 'X-Amz-Target: DynamoDB_20120810.GetItem' \
  --header "Authorization: Bearer $(yc iam create-token)" \
  --header "Content-Type: application.json" \
  --data '{"TableName": "test/pets", "Key": {"species":{"S":"cat"}, "name":{"S":"Tom"}}}' \
  $ENDPOINT

Result:

{"Item":{"name":{"S":"Tom"},"species":{"S":"cat"},"color":{"S":"black"},"price":{"N":"10.5"}}}

For more information about the GetItem method, see the Document API reference.

Was the article helpful?

Previous
Setting up AWS tools
Next
Overview
© 2026 Direct Cursus Technology L.L.C.