Skip to main content

API Documentation

Written by Ari Schlacht
Updated over 4 months ago

API Endpoint Structure

All of Sequence’s external API endpoints live under one base URL:

https://api.getsequence.io/

Every call you make to this base URL will point to a specific endpoint depending on what you want to do — whether that’s triggering a rule, returning a transfer amount, or retrieving accounts.


What every request includes

No matter which endpoint you hit, each request should have:

  • The correct authentication header (either your access token or the rule secret)

  • A JSON body (even if it’s empty {})

  • The header: Content-Type: application/json

The API always responds in JSON format, and you’ll see:

  • A top-level message confirming what happened

  • A data object with the details you asked for

  • A unique requestId, which is super helpful for debugging or sharing with support


Idempotency (avoiding duplicate calls)

Let’s say you trigger a transfer but your network drops mid-request. You retry — but how do you know Sequence won’t process the same payment twice?

That’s where idempotency keys come in.

Add this to your request header:

idempotency-key: some-unique-value

If the request is retried with the same key, Sequence will recognize it as a duplicate and not process it again. This is best practice for anything like transfers or rule triggers.


Capabilities in Detail


1. Triggering a Rule via API

This is the most common use case: firing off a rule you’ve already built in Sequence.

When to use it

  • Your system wants to kick off a Sequence workflow automatically

  • Example: a new client payment comes in, and you want to immediately split those funds across Pods

Endpoint

POST /rules/{ruleId}/trigger

Authentication

  • Use the rule’s API secret

  • Pass it in the header as:

x-sequence-signature: Bearer YOUR_RULE_API_SECRET

Request Body

  • Always send JSON, even if empty: {}

  • Some rules may expect input in the JSON, but most don’t

Example Request (cURL)

curl --request POST "https://api.getsequence.io/rules/ru_12345/trigger" \   --header "x-sequence-signature: Bearer YOUR_RULE_API_SECRET" \   --header "Content-Type: application/json" \   --data '{}'

Using an Idempotency Key

curl --request POST "https://api.getsequence.io/rules/ru_12345/trigger" \   --header "x-sequence-signature: Bearer YOUR_RULE_API_SECRET" \   --header "Content-Type: application/json" \   --header "idempotency-key: payment-2025-08-28-001" \   --data '{}'

Successful Response

{   "code": "OK",   "message": "Rule with id ru_12345 has been triggered",   "data": {     "requestId": "b28f1d9e-8c2a-4d3e-9af1-XXXXXXXXXXXX"   } }

Errors you might see

  • 401 Unauthorized — bad or missing secret

  • 400 Invalid Request — wrong Rule ID or rule not API-enabled

  • 429 Too Many Requests — you’re triggering the rule too often

  • 500 Unexpected Error — rare, usually temporary


2. Setting the Transfer Amount (Query Remote API)

Normally, your system makes API calls to Sequence.
But with Query Remote API, Sequence makes a call to your system and asks how much to transfer.

This lets you apply external business logic.

How it works

  1. In Sequence, create or edit a Rule

  2. In the action section, choose Query Remote API

  3. Enter the URL of your service

  4. When that rule runs, Sequence sends a POST request to your URL

  5. Your service responds with an amount

  6. Sequence uses that amount when running the transfer

Why use this?

  • Transfer amounts depend on external logic

  • You want to use sales data, invoices, or calculations from your own system

What Sequence sends

A POST request with a JSON body (often {}).

Your required response

{   "amountInCents": 25000 }
  • Must be a non-negative integer

  • Equals $250.00

Example Flow

Sequence request:

POST https://yourdomain.com/transfer-logic Content-Type: application/json Body: {}

Your response:

{ "amountInCents": 12500 }

Sequence moves $125.00.


3. Retrieving Account Balances

This fetches all balances for Pods, Income Sources, and external accounts.

Endpoint

POST /accounts

Authentication

x-sequence-access-token: Bearer YOUR_ACCESS_TOKEN

Example Request

curl --location 'https://api.getsequence.io/accounts' \ --header 'x-sequence-access-token: Bearer {YOUR_ACCESS_TOKEN}' \ --header 'Content-Type: application/json' \ --data '{}'

Example Response

{   "message": "OK",   "requestId": "f1a2b3c4-56d7-890e-fgh1-XXXXXXXXXXXX",   "data": {     "accounts": [       {         "id": "5579244",         "name": "Main Operating Pod",         "balance": { "amountInDollars": 25342.77, "error": null },         "type": "Pod"       },       {         "id": "5579245",         "name": "Client Payments Account",         "balance": { "amountInDollars": 10200.50, "error": null },         "type": "Income Source"       },       {         "id": "QDBZQjj1lohgeqVWJlnmf5lA4g83ZGCwl3Qx4",         "name": "Chase Credit Card",         "balance": { "amountInDollars": 137.9, "error": null },         "type": "Account"       }     ],     "errors": []   } }

Best Practices

  • Feature Availability: External API must be enabled in Settings

  • Security: Treat tokens like passwords — rotate routinely

  • Idempotency: Always include an idempotency-key for transfers

  • Rate Limits: Add backoff to avoid 429 responses

  • Monitoring: Save requestId for debugging or support


Did this answer your question?