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.

EndpointWhat it does
POST /connections/claimTurns a code into a connection.
GET /connectionsLists your connections, to reconcile.
GET /connections/{partnerId}Reads one connection and its effective scopes.
Connection eventsconnection.updated and connection.revoked webhooks.

All of them need a provider key and ignore the X-Localoy-Partner-Id header.

The flow#

A connection, from code to disconnect
A connection, from code to disconnectPartnerLocaloyYour platform1. Choose scopes, generate code2. Paste the code3. POST /connections/claim4. 201 connection ACTIVE5. GET /connections/{partnerId}6. 200 status, scopes, modulesWhile connected7. Calls with X-Localoy-Partner-IdWhen the partner changes it8. Pause, resume or change scopes9. Webhook: connection.updated10. Disconnect11. Webhook: connection.revoked
  1. Partner → Localoy: Choose scopes, generate code
  2. Partner → Your platform: Paste the code
  3. Your platform → Localoy: POST /connections/claim
  4. Localoy → Your platform: 201 connection ACTIVE
  5. Your platform → Localoy: GET /connections/{partnerId}
  6. Localoy → Your platform: 200 status, scopes, modules
  7. — While connected —
  8. Your platform → Localoy: Calls with X-Localoy-Partner-Id
  9. — When the partner changes it —
  10. Partner → Localoy: Pause, resume or change scopes
  11. Localoy → Your platform: Webhook: connection.updated
  12. Partner → Localoy: Disconnect
  13. Localoy → Your platform: Webhook: connection.revoked
  1. Claim the code. 201 for a new connection. Claiming a code you already claimed, before it expires, answers 200 with the same connection, so a timed-out claim is safe to retry. Any bad code — unknown, expired, used, another provider's, or disconnected — is one 404 connection_code_invalid. More than 20 claims in 15 minutes answers 429 connection_claim_rate_limited.
  2. 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_found means you never claimed one with that partner.
  3. Follow the partner's changes. connection.updated has a reason of paused, resumed or scopes_changed. While paused, your calls for that partner answer 403 connection_paused. connection.revoked means access has already ended and the catalogue items you created for the partner are removed.
  4. Reconcile. GET /connections lists ACTIVE and PAUSED connections by default (status selects others), paged with limit and offset. Use it after your webhook endpoint was down. Unclaimed codes are never listed.
  5. Reconnect. After a disconnect, the partner generates a new code and you claim it.

Guide: Connecting partners.