# Integration routes: sync

URL: /code/api/integration/verbs-sync · Id: `page:code/api/integration/verbs-sync`

> The Integration Verbs sync as api.sb routes, with inputs, result, refusals and an example.

Reference for [Integration](/business/nouns/integration), one group of [Integration routes](/code/api/integration).

### Integration.sync
Sync exchanges records between a System and its connector, and the declared leader wins every conflict. [Verb page](/business/nouns/integration/sync?interface=api).

```text
POST /{namespace}/integrations/{integration}/sync
```

Path: `integration`. Emits [`Integration.synced`](/business/events/Integration.synced).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `integration` | [Integration](/business/nouns/integration) | Yes | The connector to sync. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `integration` | [Integration](/business/nouns/integration) | Yes | The Integration with its sync cursor moved. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The request carries no key, or its key is expired or revoked. | [`unauthorized`](/code/api/errors/unauthorized) | Sign in again, or send a current key as a bearer token. | None. |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
| The caller sent more requests than its rate allows. | [`rate-limited`](/code/api/errors/rate-limited) | Wait the number of seconds in the `Retry-After` header, then retry. | None. |

**Example**

```bash
curl -X POST https://api.sb/leaseline.app/integrations/integration_alVwjQcmRy/sync \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "integration": {
    "$id": "https://api.sb/leaseline.app/integrations/integration_alVwjQcmRy",
    "$type": "Integration",
    "acquired": "owned",
    "scope": "studio",
    "mode": "mirror",
    "state": "connecting"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Integration.sync",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```