Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • 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
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 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 options
  • Response
  • Response parameters
  • Errors
  1. HTTP API compatible with Amazon Kinesis Data Streams
  2. Methods
  3. PutRecords

PutRecords

Written by
Yandex Cloud
Updated at August 15, 2025
  • Request
    • Request options
  • Response
    • Response parameters
  • Errors

Puts multiple records into a data stream in a single call.

This method delivers higher throughput compared to PutRecord. A single request can contain up to 500 records. Each record in the request can be up to 1 MB in size. The total request size cannot exceed 5 MB, including partition keys.

The request must include the stream name and an array of Records. Each record must contain a partition key and an object containing Base64-encoded user data. To explicitly specify the hash key determining the target shard for records, use the ExplicitHashKey parameter.

Returns an array of elements containing status information for each record. Each entry in the response array corresponds to a record in the request array. The response array maintains the same order as the request array. The response array provides status information for all records, whether processed successfully or not. A single record failure does not prevent processing of subsequent records.

PutRecords guarantees that records are written to the stream in the exact order they appear in the request array.

For successfully processed records, the response includes the ShardId of the shard where the record was stored and the SequenceNumber assigned to the record.

For records that failed processing, the response includes an ErrorCode and an ErrorMessage. Common error types include ProvisionedThroughputExceededException and InternalFailure. For ProvisionedThroughputExceededException errors, the error message includes the account ID, the stream name, and the shard ID of the failed record.

RequestRequest

The request contains JSON-formatted data.

{
  "Records": [{
    "Data": blob,
    "ExplicitHashKey": "string",
    "PartitionKey": "string"
  }],
  "StreamName": "string"
}

Request optionsRequest options

Option Description
Records Record to write

Type Array of objects PutRecordsRequestEntry
Number of elements: 1-500
Required: Yes
StreamName Data stream name.

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

ResponseResponse

Successful requests return HTTP 200 with a JSON-formatted response body.

{
  "EncryptionType": "string",
  "FailedRecordCount": number,
  "Records": [{
    "ErrorCode": "string",
    "ErrorMessage": "string",
    "SequenceNumber": "string",
    "ShardId": "string"
  }]
}

Response parametersResponse parameters

Parameter Description
EncryptionType Encryption type.

Type: String
Allowed values: NONE
Required: Yes
FailedRecordCount Number of failed records.
Records Record processing results.

Type Array of PutRecordsRequestEntry objects
Number of elements: 1-500
Required: Yes

ErrorsErrors

Error Description HTTP code
InvalidArgumentException The argument is invalid. See the error message for details. 400
ResourceNotFoundException The requested resource was not found. 400

Errors common to all methods may occur.

Was the article helpful?

Previous
PutRecord
Next
UpdateShardCount
© 2025 Direct Cursus Technology L.L.C.