Connections overview
The whole life of a connection — the partner generates a code, you claim it, you read it, and the partner pauses, changes or ends it.
A connection is your company's link to one partner. The partner creates it in its Partner Portal by generating a one-time code; you claim the code. From then on your calls for that partner are accepted, within the scopes the partner granted.
| Endpoint | What it does |
|---|---|
POST /connections/claim | Turns a code into a connection. |
GET /connections | Lists your connections, to reconcile. |
GET /connections/{partnerId} | Reads one connection and its effective scopes. |
| Connection events | connection.updated and connection.revoked webhooks. |
All of them need a provider key and ignore the X-Localoy-Partner-Id header.
The flow#
- Partner → Localoy: Choose scopes, generate code
- Partner → Your platform: Paste the code
- Your platform → Localoy: POST /connections/claim
- Localoy → Your platform: 201 connection ACTIVE
- Your platform → Localoy: GET /connections/{partnerId}
- Localoy → Your platform: 200 status, scopes, modules
- — While connected —
- Your platform → Localoy: Calls with X-Localoy-Partner-Id
- — When the partner changes it —
- Partner → Localoy: Pause, resume or change scopes
- Localoy → Your platform: Webhook: connection.updated
- Partner → Localoy: Disconnect
- Localoy → Your platform: Webhook: connection.revoked
- Claim the code.
201for a new connection. Claiming a code you already claimed, before it expires, answers200with the same connection, so a timed-out claim is safe to retry. Any bad code — unknown, expired, used, another provider's, or disconnected — is one404 connection_code_invalid. More than 20 claims in 15 minutes answers429 connection_claim_rate_limited. - Read it before you sync. Retrieve the connection for its status and effective scopes. After a
disconnect it comes back with status
REVOKED;404 connection_not_foundmeans you never claimed one with that partner. - Follow the partner's changes.
connection.updatedhas areasonofpaused,resumedorscopes_changed. While paused, your calls for that partner answer403 connection_paused.connection.revokedmeans access has already ended and the catalogue items you created for the partner are removed. - Reconcile.
GET /connectionslistsACTIVEandPAUSEDconnections by default (statusselects others), paged withlimitandoffset. Use it after your webhook endpoint was down. Unclaimed codes are never listed. - Reconnect. After a disconnect, the partner generates a new code and you claim it.
Guide: Connecting partners.