Proxy API

The Proxy API lets you make arbitrary requests to the upstream API. It’s useful for mutation requests that don’t map cleanly to a collection mutation. You can also use it for making one-off fetch requests against the upstream API.

When you use the Proxy API, Sequin will authenticate your request and pace it to ensure that it doesn’t exceed rate limits.

Endpoints

For both proxy endpoints, the request body and headers are passed through to the upstream API. Sequin will augment the request with necessary authentication headers.

Proxy (sync)

[GET | POST | PUT | PATCH | DELETE] /v1/proxy/sync/:sync_id/:path

The parameters in the request:

  • sync_id (required): The ID of the sync that corresponds to the request. This will determine where the request is proxied to.
  • path (required): The path of the request, according to the upstream API. For example, /contacts/839171.

Proxy (credential)

[GET | POST | PUT | PATCH | DELETE] /v1/proxy/credential/:credential_id/:path

The parameters in the request:

  • credential_id (required): The ID of the credential that corresponds to the request. This will determine where the request is proxied to.
  • path (required): The path of the request, according to the upstream API. For example, /contacts/839171.

Examples

POST a change to the API:

curl -X POST \
  https://api.sequin.io/v1/proxy/sync/sync-67b58087/v1/payment_intents/pm_1234/cancel \
  -H 'authorization: Bearer {token}' \
  -H 'content-type: application/json' \
  -d '{
    "cancellation_reason": "requested_by_customer"
  }'
curl -X POST \
  https://api.sequin.io/v1/proxy/credential/credential-8391jIli/v1/payment_intents/pm_1234/cancel \
  -H 'authorization: Bearer {token}' \
  -H 'content-type: application/json' \
  -d '{
    "cancellation_reason": "requested_by_customer"
  }'

PUT a change to the API:

curl -X PUT \
  https://api.sequin.io/v1/proxy/sync/sync-67b58087/crm/v4/objects/12345/associations/company/67891 \
  -H 'authorization: Bearer {token}' \
  -H 'content-type: application/json' \
  -d '{
    "associationCategory": "USER_DEFINED",
    "associationTypeId": 36
  }'
curl -X PUT \
  https://api.sequin.io/v1/proxy/credential/credential-8391jIli/crm/v4/objects/12345/associations/company/67891 \
  -H 'authorization: Bearer {token}' \
  -H 'content-type: application/json' \
  -d '{
    "associationCategory": "USER_DEFINED",
    "associationTypeId": 36
  }'

GET a record from the API:

curl -X GET \
  -H 'authorization: Bearer {token}' \
  https://api.sequin.io/v1/proxy/sync/sync-67b58087/contacts/12345
curl -X GET \
  -H 'authorization: Bearer {token}' \
  https://api.sequin.io/v1/proxy/credential/credential-8391jIli/contacts/12345