---
title: "POST /#X-Amz-Target=KeyspacesStreams.GetRecords"
method: POST
path: "/#X-Amz-Target=KeyspacesStreams.GetRecords"
---

# POST /#X-Amz-Target=KeyspacesStreams.GetRecords

`POST /#X-Amz-Target=KeyspacesStreams.GetRecords`

Retrieves data records from a specified shard in an Amazon Keyspaces data stream. This operation returns a collection of data records from the shard, including the primary key columns and information about modifications made to the captured table data. Each record represents a single data modification in the Amazon Keyspaces table and includes metadata about when the change occurred.

## Headers

- `X-Amz-Target` 'KeyspacesStreams.GetRecords', required

## Request body

- GetRecordsInput
  - `shardIterator` string, required — The unique identifier of the shard iterator. A shard iterator specifies the position in the shard from which you want to start reading data records sequentially. You obtain this value by calling the <code>GetShardIterator </code> operation. Each shard iterator is valid for 15 minutes after creation.
  - `maxResults` integer — The maximum number of records to return in a single <code>GetRecords</code> request. The default value is 100. You can specify a limit between 1 and 1000, but the actual number returned might be less than the specified maximum if the size of the data for the returned records exceeds the internal size limit.

## Response `200`

Success

- GetRecordsOutput
  - `changeRecords` Record[] — An array of change data records retrieved from the specified shard. Each record represents a single data modification (insert, update, or delete) to a row in the Amazon Keyspaces table. Records include the primary key columns and information about what data was modified.
    - `eventVersion` string — The version of the record format, used to track the evolution of the record structure over time.
    - `createdAt` string, date-time — The timestamp indicating when this change data capture record was created.
    - `origin` 'USER' | 'REPLICATION' | 'TTL' — The origin or source of this change data capture record.
    - `partitionKeys` object — The partition key columns and their values for the affected row.
    - `clusteringKeys` object — The clustering key columns and their values for the affected row, which determine the order of rows within a partition.
    - `newImage` object — The state of the row after the change operation that generated this record.
      - `valueCells` object — A map of regular (non-static) column cells in the row, where keys are column names and values are the corresponding cells.
      - `staticCells` object — A map of static column cells shared by all rows with the same partition key, where keys are column names and values are the corresponding cells.
      - `rowMetadata` object — Metadata that applies to the entire row, such as timestamps and TTL information.
        - `expirationTime` string — The time at which the associated data will expire, based on the time-to-live (TTL) setting.
        - `writeTime` string — The timestamp at which the associated data was written to the database.
    - `oldImage` object — The state of the row before the change operation that generated this record.
      - `valueCells` object — A map of regular (non-static) column cells in the row, where keys are column names and values are the corresponding cells.
      - `staticCells` object — A map of static column cells shared by all rows with the same partition key, where keys are column names and values are the corresponding cells.
      - `rowMetadata` object — Metadata that applies to the entire row, such as timestamps and TTL information.
        - `expirationTime` string — The time at which the associated data will expire, based on the time-to-live (TTL) setting.
        - `writeTime` string — The timestamp at which the associated data was written to the database.
    - `sequenceNumber` string — A unique identifier assigned to this record within the shard, used for ordering and tracking purposes.
  - `nextShardIterator` string — The next position in the shard from which to start sequentially reading data records. If null, the shard has been closed and the requested iterator will not return any more data.
  - `iteratorDescription` object — Provides information about the current iterator at the time GetRecords request was processed by Keyspaces.
    - `iteratorPosition` 'AT_TIP' | 'BEHIND_TIP' — <p> Indicates the current iterator's position within the shard. The possible values are: </p> <ul> <li> <p> <code>AT_TIP</code> - No more records are currently available.</p> </li> <li> <p> <code>BEHIND_TIP</code> - Additional records may be available.</p> </li> </ul> <p>Stream progresses in absence of customer records. <code>BEHIND_TIP</code> with an empty <code>changeRecords</code> list indicates the stream is progressing but no customer records are available at this position. Continue polling normally.</p>

## Other responses

- `480` — ThrottlingException
- `481` — AccessDeniedException
- `482` — InternalServerException
- `483` — ValidationException
- `484` — ResourceNotFoundException

---

[API](https://skmtc.net/aws/apis/keyspacesstreams.md) · [All operations](https://skmtc.net/aws/apis/keyspacesstreams/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/keyspacesstreams/versions/c816b8762929/schema)
