# Apply a sync chunk from another storage provider.

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

**POST** `/sync/process`

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

Corresponds to `WalletStorageSync.processSyncChunk(args, chunk)`.
Merges records from a foreign storage provider into this one.

## Body

Content type: `application/json`

- `args` (object, required)
  - `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)
- `chunk` (object, required)
  A page of storage records for sync.  Contains subsets of each table
  type changed since the requested timestamp.
  - `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
{
  "args": {
    "identityKey": "string",
    "fromStorageIdentityKey": "string",
    "since": "1970-01-01T00:00:00.000Z",
    "paged": {
      "limit": 0,
      "offset": 0
    }
  },
  "chunk": {
    "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"
      }
    ]
  }
}
```

## Responses

### 200

Sync chunk processing result.

- `done` (boolean)
  true if no more chunks are needed.
- `error` (string)

Example:

```json
{
  "done": true,
  "error": "string"
}
```

### 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"
}
```