# Export a chunk of storage records for sync.

> For the complete documentation index, see [llms.txt](https://bsvblockchain.com/docs/llms.txt).

**POST** `/sync/chunk`

Base URL: `https://{host}/storage/v1`

Corresponds to `WalletStorageSync.getSyncChunk(args)`.
Returns a paged subset of records since a given timestamp, for use
by the sync protocol between storage providers.

## Body

Content type: `application/json`

- `identityKey` (string, required)
  Identity key of the wallet owner.
- `fromStorageIdentityKey` (string, required)
  storageIdentityKey of the storage requesting the chunk.
- `since` (string<date-time>)
- `paged` (object)
  - `limit` (integer)
  - `offset` (integer)

Example:

```json
{
  "identityKey": "string",
  "fromStorageIdentityKey": "string",
  "since": "1970-01-01T00:00:00.000Z",
  "paged": {
    "limit": 0,
    "offset": 0
  }
}
```

## Responses

### 200

Sync chunk.

- `users` (object[])
  - `created_at` (string<date-time>, required)
  - `updated_at` (string<date-time>, required)
- `transactions` (object[])
  - `created_at` (string<date-time>, required)
  - `updated_at` (string<date-time>, required)
- `outputs` (object[])
  - `created_at` (string<date-time>, required)
  - `updated_at` (string<date-time>, required)
- `outputBaskets` (object[])
  - `created_at` (string<date-time>, required)
  - `updated_at` (string<date-time>, required)
- `provenTxs` (object[])
  - `created_at` (string<date-time>, required)
  - `updated_at` (string<date-time>, required)
- `provenTxReqs` (object[])
  - `created_at` (string<date-time>, required)
  - `updated_at` (string<date-time>, required)
- `syncStates` (object[])
  - `created_at` (string<date-time>, required)
  - `updated_at` (string<date-time>, required)

Example:

```json
{
  "users": [
    {
      "created_at": "1970-01-01T00:00:00.000Z",
      "updated_at": "1970-01-01T00:00:00.000Z"
    }
  ],
  "transactions": [
    {
      "created_at": "1970-01-01T00:00:00.000Z",
      "updated_at": "1970-01-01T00:00:00.000Z"
    }
  ],
  "outputs": [
    {
      "created_at": "1970-01-01T00:00:00.000Z",
      "updated_at": "1970-01-01T00:00:00.000Z"
    }
  ],
  "outputBaskets": [
    {
      "created_at": "1970-01-01T00:00:00.000Z",
      "updated_at": "1970-01-01T00:00:00.000Z"
    }
  ],
  "provenTxs": [
    {
      "created_at": "1970-01-01T00:00:00.000Z",
      "updated_at": "1970-01-01T00:00:00.000Z"
    }
  ],
  "provenTxReqs": [
    {
      "created_at": "1970-01-01T00:00:00.000Z",
      "updated_at": "1970-01-01T00:00:00.000Z"
    }
  ],
  "syncStates": [
    {
      "created_at": "1970-01-01T00:00:00.000Z",
      "updated_at": "1970-01-01T00:00:00.000Z"
    }
  ]
}
```

### 401

Authentication required or token invalid.

- `error` (string, required)
- `code` (string)
  Machine-readable error code (see specs/errors.md).

Example:

```json
{
  "error": "string",
  "code": "string"
}
```