State
Key-value state store for persisting JSON objects or arrays across flow runs. Common use cases include tracking sequence numbers, storing cursors for delta syncs, caching lookup values, and passing state between runs.
Lookup Caches are now the preferred mechanism for storing and retrieving data during flow execution. Prefer Lookup Caches for new integrations; State remains supported for existing flows.
State supports two scopes:
Global — account-wide keys visible to all flows and scripts.
Resource-scoped — keys namespaced under a specific export, import, or integration. Resource-scoped keys are isolated from the global key listing.
Values must be non-empty JSON objects or arrays. Bare primitives, null, and empty containers ({}, []) are rejected.
Prefer resource-scoped state over global state when the data belongs to a specific export, import, or integration. State keys are upserted — PUT creates if absent, replaces if present. There is no PATCH; send the full value each time.
State schema
Returns all global state key names. Does not return resource-scoped keys — use GET /v1/{resourceType}/{_id}/state for those.
Lists key names only, not values. Call GET /v1/state/{key} to retrieve a specific value.
Object containing an array of key names.
No global state keys exist.
Unauthorized. The request lacks a valid bearer token, or the provided token failed to authenticate.
Note: the 401 response is produced by the auth middleware before the
request reaches the endpoint handler, so it does not follow the
standard {errors: [...]} envelope. Instead the body is a bare
{message: string} object with no code, no errors array. Callers
handling 401s should key off the HTTP status and the message string,
not try to destructure an errors[].
GET /v1/state HTTP/1.1
Host: api.integrator.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"keys": [
"sequence_number",
"last_sync_time"
]
}Deletes all global state keys and their values. This is a destructive operation and cannot be undone.
Prefer DELETE /v1/state/{key} to remove individual keys.
All global state deleted.
No content
Unauthorized. The request lacks a valid bearer token, or the provided token failed to authenticate.
Note: the 401 response is produced by the auth middleware before the
request reaches the endpoint handler, so it does not follow the
standard {errors: [...]} envelope. Instead the body is a bare
{message: string} object with no code, no errors array. Callers
handling 401s should key off the HTTP status and the message string,
not try to destructure an errors[].
DELETE /v1/state HTTP/1.1
Host: api.integrator.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Returns the JSON value stored under the given global key.
Returns the raw JSON value (object or array), not wrapped in an envelope.
The state key name.
sequence_numberThe stored value (a JSON object or array).
A stored state value. Values must be non-empty JSON objects or arrays —
bare primitives, null, and empty containers ({}, []) are rejected.
Keys are upserted: PUT creates the key if absent and replaces the value
if present.
Unauthorized. The request lacks a valid bearer token, or the provided token failed to authenticate.
Note: the 401 response is produced by the auth middleware before the
request reaches the endpoint handler, so it does not follow the
standard {errors: [...]} envelope. Instead the body is a bare
{message: string} object with no code, no errors array. Callers
handling 401s should key off the HTTP status and the message string,
not try to destructure an errors[].
The key does not exist.
GET /v1/state/{key} HTTP/1.1
Host: api.integrator.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"lastSyncTime": "2025-08-10T14:22:33.000Z",
"sequenceNumber": 4207
}Sets the value for a global state key. Creates the key if it does not exist; replaces the value if it does.
The request body must be a non-empty JSON object or array. Bare JSON primitives (strings, numbers, booleans, null) and empty containers ({}, []) are rejected.
This is an upsert — check the status code to distinguish create (201) from update (200). The response body is plain text, not JSON. If the state belongs to a specific export, import, or integration, use the resource-scoped endpoint instead.
The state key name.
sequence_numberA non-empty JSON object or array to store. Bare primitives and empty containers are not accepted.
Existing key updated.
New key created.
Invalid request body. The body is not valid JSON, or is a bare
primitive (string, number, boolean, or null).
Unauthorized. The request lacks a valid bearer token, or the provided token failed to authenticate.
Note: the 401 response is produced by the auth middleware before the
request reaches the endpoint handler, so it does not follow the
standard {errors: [...]} envelope. Instead the body is a bare
{message: string} object with no code, no errors array. Callers
handling 401s should key off the HTTP status and the message string,
not try to destructure an errors[].
The Content-Type header is missing or is not
application/json.
The request body is empty, or is an empty container ({} or
[]).
PUT /v1/state/{key} HTTP/1.1
Host: api.integrator.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 65
{
"lastSyncTime": "2025-08-10T14:22:33.000Z",
"sequenceNumber": 4207
}OKDeletes a specific global state key and its value. Returns 404 if the key does not exist.
The state key name.
sequence_numberKey deleted.
No content
Unauthorized. The request lacks a valid bearer token, or the provided token failed to authenticate.
Note: the 401 response is produced by the auth middleware before the
request reaches the endpoint handler, so it does not follow the
standard {errors: [...]} envelope. Instead the body is a bare
{message: string} object with no code, no errors array. Callers
handling 401s should key off the HTTP status and the message string,
not try to destructure an errors[].
The key does not exist.
DELETE /v1/state/{key} HTTP/1.1
Host: api.integrator.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Returns the list of state key names stored under the specified resource. These keys are separate from global state.
Returns 204 No Content when no keys exist for the resource.
Only exports, imports, and integrations support resource-scoped state. Other resource types return 403.
This only lists key names, not values. Call GET /v1/{resourceType}/{_resourceId}/state/{key} to retrieve a specific value.
The resource type. Only exports, imports, and
integrations are supported.
The resource ID.
66a1f2c3b4d5e6f7a8b9c0d1Object containing an array of key names.
No state keys exist for this resource.
The resource ID is not a valid identifier.
Unauthorized. The request lacks a valid bearer token, or the provided token failed to authenticate.
Note: the 401 response is produced by the auth middleware before the
request reaches the endpoint handler, so it does not follow the
standard {errors: [...]} envelope. Instead the body is a bare
{message: string} object with no code, no errors array. Callers
handling 401s should key off the HTTP status and the message string,
not try to destructure an errors[].
The resource type does not support state. Only exports,
imports, and integrations are allowed.
The resource was not found.
GET /v1/{resourceType}/{_resourceId}/state HTTP/1.1
Host: api.integrator.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"keys": [
"sequence_number",
"last_sync_time"
]
}Deletes all state keys and values stored under the specified resource. This is destructive and cannot be undone.
Prefer DELETE /v1/{resourceType}/{_resourceId}/state/{key} to remove individual keys.
The resource type. Only exports, imports, and
integrations are supported.
The resource ID.
66a1f2c3b4d5e6f7a8b9c0d1All resource state deleted.
No content
The resource ID is not a valid identifier.
Unauthorized. The request lacks a valid bearer token, or the provided token failed to authenticate.
Note: the 401 response is produced by the auth middleware before the
request reaches the endpoint handler, so it does not follow the
standard {errors: [...]} envelope. Instead the body is a bare
{message: string} object with no code, no errors array. Callers
handling 401s should key off the HTTP status and the message string,
not try to destructure an errors[].
The resource type does not support state.
The resource was not found.
DELETE /v1/{resourceType}/{_resourceId}/state HTTP/1.1
Host: api.integrator.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Returns the JSON value stored under the given key for a specific resource.
Only exports, imports, and integrations support resource-scoped state.
Returns the raw JSON value (object or array), not wrapped in an envelope. A 403 means the resource type doesn't support state, not a permissions issue.
The resource type. Only exports, imports, and
integrations are supported.
The resource ID.
66a1f2c3b4d5e6f7a8b9c0d1The state key name.
sequence_numberThe stored value (a JSON object or array).
A stored state value. Values must be non-empty JSON objects or arrays —
bare primitives, null, and empty containers ({}, []) are rejected.
Keys are upserted: PUT creates the key if absent and replaces the value
if present.
The resource ID is not a valid identifier.
Unauthorized. The request lacks a valid bearer token, or the provided token failed to authenticate.
Note: the 401 response is produced by the auth middleware before the
request reaches the endpoint handler, so it does not follow the
standard {errors: [...]} envelope. Instead the body is a bare
{message: string} object with no code, no errors array. Callers
handling 401s should key off the HTTP status and the message string,
not try to destructure an errors[].
The resource type does not support state.
The resource or key was not found.
GET /v1/{resourceType}/{_resourceId}/state/{key} HTTP/1.1
Host: api.integrator.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"cursor": "2025-08-10T14:22:33.000Z",
"pageToken": "abc123"
}Sets the value for a state key under a specific resource. Creates the key if it does not exist; replaces the value if it does.
The request body must be a non-empty JSON object or array. Bare JSON primitives (strings, numbers, booleans, null) and empty containers ({}, []) are rejected.
Only exports, imports, and integrations support resource-scoped state.
This is an upsert — check the status code to distinguish create (201) from update (200). The response body is plain text, not JSON.
The resource type. Only exports, imports, and
integrations are supported.
The resource ID.
66a1f2c3b4d5e6f7a8b9c0d1The state key name.
sequence_numberA non-empty JSON object or array to store. Bare primitives and empty containers are not accepted.
Existing key updated.
New key created.
Invalid request. The body is not valid JSON, is a bare primitive, or the resource ID is invalid.
Unauthorized. The request lacks a valid bearer token, or the provided token failed to authenticate.
Note: the 401 response is produced by the auth middleware before the
request reaches the endpoint handler, so it does not follow the
standard {errors: [...]} envelope. Instead the body is a bare
{message: string} object with no code, no errors array. Callers
handling 401s should key off the HTTP status and the message string,
not try to destructure an errors[].
The resource type does not support state.
The resource was not found.
The Content-Type header is missing or is not
application/json.
The request body is empty, or is an empty container ({} or
[]).
PUT /v1/{resourceType}/{_resourceId}/state/{key} HTTP/1.1
Host: api.integrator.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 58
{
"cursor": "2025-08-10T14:22:33.000Z",
"pageToken": "abc123"
}OKDeletes a specific state key and its value from the resource. Returns 404 if the key does not exist.
The resource type. Only exports, imports, and
integrations are supported.
The resource ID.
66a1f2c3b4d5e6f7a8b9c0d1The state key name.
sequence_numberKey deleted.
No content
The resource ID is not a valid identifier.
Unauthorized. The request lacks a valid bearer token, or the provided token failed to authenticate.
Note: the 401 response is produced by the auth middleware before the
request reaches the endpoint handler, so it does not follow the
standard {errors: [...]} envelope. Instead the body is a bare
{message: string} object with no code, no errors array. Callers
handling 401s should key off the HTTP status and the message string,
not try to destructure an errors[].
The resource type does not support state.
The resource or key was not found.
DELETE /v1/{resourceType}/{_resourceId}/state/{key} HTTP/1.1
Host: api.integrator.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Last updated
Was this helpful?