Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Data Streams
  • Access management
  • Pricing policy
    • Overview
    • All methods
      • CreateStream
      • DecreaseStreamRetentionPeriod
      • DeleteStream
      • DescribeStream
      • IncreaseStreamRetentionPeriod
      • GetRecords
      • GetShardIterator
      • ListStreams
      • PutRecord
      • PutRecords
      • UpdateShardCount
    • Common errors
    • Examples
  • FAQ

In this article:

  • Request
  • Request parameters
  • Response
  • Response parameters
  • Errors
  1. Amazon Kinesis Data Streams compatible HTTP API
  2. Methods
  3. PutRecord

PutRecord

Written by
Yandex Cloud
Updated at February 10, 2023
  • Request
    • Request parameters
  • Response
    • Response parameters
  • Errors

Sends one message into a stream.

The request specifies the stream name, the shard key and an object with user data in Base64 encoding.

Returns the ID of the shard where the message was put and the message sequence number.

Messages are written to the stream shard strictly in the order they are sent.

RequestRequest

The request contains data in JSON format.

{
  "Data": blob,
  "ExplicitHashKey": "string",
  "PartitionKey": "string",
  "SequenceNumberForOrdering": "string",
  "StreamName": "string"
}

Request parametersRequest parameters

Parameter Description
Data User data.

Type: Binary, Base64 encoding
Size: 0-1048576 bytes of Base64 encoded data
Required: Yes
ExplicitHashKey Shard key hash.
When using the PartitionKey hash to specify the shard to put a message into, messages may be distributed across shards suboptimally. Use this parameter to explicitly define the shard to write messages to.

Type: String
Possible values: 0|([1-9]\d{0.38})
Required: No
PartitionKey Shard key.
Sets the stream shard to write a message to.

Type: String
Size: 1-256 characters.
Required: Yes
StreamName The name of the stream.

Type: String
Size: 1-128 characters.
Possible values: [a-zA-Z][a-zA-Z0-9-]+*(?<!-)$
Required: Yes

ResponseResponse

If successful, HTTP code 200 and data in JSON format are returned.

{
  "EncryptionType": "string",
  "SequenceNumber": "string",
  "ShardId": "string"
}

Response parametersResponse parameters

Parameter Description
EncryptionType The type of encryption.

Type: String
Possible values: NONE
Required: Yes
SequenceNumber The sequence number of a message.

Type: String
Possible values: 0|([1-9]\d{0,128})
Required: Yes
ShardId The ID of the shard that the message was written to.

Type: String
Size: 1-128 characters.
Possible values: [a-zA-Z0-9_.-]+
Required: Yes

ErrorsErrors

Parameter Description HTTP code
InvalidArgumentException The argument is invalid. For more information, see the error message. 400
ProvisionedThroughputExceededException Insufficient throughput to execute the request. 400
ResourceNotFoundException The requested resource was not found. 400

Errors that are common to all methods may occur.

Was the article helpful?

Previous
ListStreams
Next
PutRecords
© 2025 Direct Cursus Technology L.L.C.