SequenceSequence
Rules
Coming Soon — This endpoint is planned for a future release and is not yet available.
POST/rules

Creates a new rule. The rule is created in a disabled state and must be reviewed and set to enabled by a human in the Sequence app before it can be triggered.

AuthorizationClick to expand
ApiKeyAuth
Authorization<token>

Format: ApiKey <key>. Keys are scoped to an organization and carry explicit permissions.

Each key holds a list of permission entries. An entry specifies a scope and a resources constraint. A request returns 403 if the key lacks the required scope, or if the requested resource is outside the key's allowed list.

ScopeResourcesGrants access to
LIST_ACCOUNTSnoneList all accounts in the organization
READ_ACCOUNTSaccount IDs or *Full account details and balance for a specific account
LIST_RULESnoneList all rules in the organization
READ_RULESrule IDs or *Full rule details (steps, conditions, actions) for a specific rule
TRIGGER_RULESrule IDs or *Triggering rule executions
READ_RULE_EXECUTIONSrule IDs or *Rule execution history - rule_id filter required
READ_TRANSFERSaccount IDs or *Transfer history - account_id filter required
MANUAL_TRANSFERlist of { source, target, max_amount? } setsCreating manual transfers
READ_CARDSaccount IDs or *Cards and card transactions - account_id filter required

In: header

Header Parameters

Idempotency-Key?string

A client-generated unique key to ensure idempotent processing. Requests with the same key within 24 hours return the original response without re-executing the operation. Recommended format: UUID v4.

X-Request-ID?string

A client-provided request identifier echoed back in the response `X-Request-ID` header and `request_id` body field. If omitted, the server generates one.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

FieldTypeDescription
nickname?
string
description?
string
status*
string, Value in "enabled" | "disabled"
+trigger*
Trigger
+steps*
array<RuleStep>

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.getsequence.io/api/v1/rules" \  -H "Content-Type: application/json" \  -d '{    "nickname": "Auto-save on deposit",    "description": "Saves 20% of every incoming deposit",    "status": "enabled",    "trigger": {      "type": "ON_FUNDS_TRANSFERRED",      "account_id": "acc_01HABC4567"    },    "steps": [      {        "conditions": {          "condition": {            "fact": "BALANCE",            "operator": "GREATER_THAN",            "value": 50000          }        },        "actions": [          {            "type": "percentage",            "percentage_value": 20,            "percentage_target": "INCOMING_AMOUNT",            "source": {              "id": "acc_01HABC4567",              "type": "income_source"            },            "destination": {              "id": "acc_01HSAV9999",              "type": "pod"            },            "group_index": 0,            "up_to_enabled": false          }        ]      },      {        "conditions": null,        "actions": [          {            "type": "fixed_amount",            "amount_in_cents": 5000,            "source": {              "id": "acc_01HABC4567",              "type": "income_source"            },            "destination": {              "id": "acc_01SEMG8888",              "type": "pod"            },            "group_index": 0,            "up_to_enabled": true          }        ]      }    ]  }'
{
  "request_id": "req_01HXYZ6666",
  "data": {
    "id": "rule_01HXYZ1234",
    "nickname": "Auto-save on deposit",
    "description": "Saves 20% of every incoming deposit",
    "status": "enabled",
    "trigger": {
      "type": "ON_FUNDS_TRANSFERRED",
      "account_id": "acc_01HABC4567"
    },
    "steps": [
      {
        "conditions": {
          "condition": {
            "fact": "BALANCE",
            "operator": "GREATER_THAN",
            "value": 50000
          }
        },
        "actions": [
          {
            "type": "percentage",
            "percentage_value": 20,
            "percentage_target": "INCOMING_AMOUNT",
            "source": {
              "id": "acc_01HABC4567",
              "type": "income_source"
            },
            "destination": {
              "id": "acc_01HSAV9999",
              "type": "pod"
            },
            "group_index": 0,
            "up_to_enabled": false,
            "is_direct_deposit": false
          }
        ]
      },
      {
        "conditions": null,
        "actions": [
          {
            "type": "fixed_amount",
            "amount_in_cents": 5000,
            "source": {
              "id": "acc_01HABC4567",
              "type": "income_source"
            },
            "destination": {
              "id": "acc_01SEMG8888",
              "type": "pod"
            },
            "group_index": 0,
            "up_to_enabled": true,
            "is_direct_deposit": false
          }
        ]
      }
    ],
    "created_at": "2024-03-01T10:00:00Z",
    "updated_at": "2024-03-01T10:00:00Z"
  }
}
{
  "error": {
    "code": "resource_not_found",
    "message": "Rule with id 'rule_123' was not found."
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key."
  }
}
{
  "error": {
    "code": "forbidden",
    "message": "This API key does not have the required permission."
  }
}