> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/api/api-reference/state.md).

# 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

## The State object

```json
{"openapi":"3.2.0","info":{"title":"State","version":"1.0.0"},"components":{"schemas":{"State":{"description":"A stored state value. Values must be non-empty JSON objects or arrays —\nbare primitives, `null`, and empty containers (`{}`, `[]`) are rejected.\nKeys are upserted: PUT creates the key if absent and replaces the value\nif present.","oneOf":[{"title":"object","type":"object","minProperties":1},{"title":"array","type":"array","minItems":1}]}}}}
```

## List global state keys

> 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.

```json
{"openapi":"3.2.0","info":{"title":"State","version":"1.0.0"},"tags":[{"name":"State","description":"Key-value state store for persisting JSON objects or arrays across flow\nruns. Common use cases include tracking sequence numbers, storing cursors\nfor delta syncs, caching lookup values, and passing state between runs.\n\n**Lookup Caches are now the preferred mechanism** for storing and\nretrieving data during flow execution. Prefer Lookup Caches for new\nintegrations; State remains supported for existing flows.\n\nState supports two scopes:\n\n- **Global** — account-wide keys visible to all flows and scripts.\n- **Resource-scoped** — keys namespaced under a specific export, import,\n  or integration. Resource-scoped keys are isolated from the global\n  key listing.\n\nValues must be non-empty JSON objects or arrays. Bare primitives,\n`null`, and empty containers (`{}`, `[]`) are rejected.\n\nPrefer resource-scoped state over global state when the data belongs\nto a specific export, import, or integration. State keys are upserted —\nPUT creates if absent, replaces if present. There is no PATCH; send the\nfull value each time.\n\n## State schema\n\n{% openapi-schemas spec=\"state\" schemas=\"State\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/state":{"get":{"operationId":"listGlobalStateKeys","tags":["State"],"summary":"List global state keys","description":"Returns all global state key names. Does not return resource-scoped\nkeys — use `GET /v1/{resourceType}/{_id}/state` for those.\n\nLists key names only, not values. Call `GET /v1/state/{key}` to\nretrieve a specific value.","responses":{"200":{"description":"Object containing an array of key names.","content":{"application/json":{"schema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"type":"string"}}}}}}},"204":{"description":"No global state keys exist."},"401":{"$ref":"#/components/responses/401-unauthorized"}}}}}}
```

## Delete all global state keys

> 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.

```json
{"openapi":"3.2.0","info":{"title":"State","version":"1.0.0"},"tags":[{"name":"State","description":"Key-value state store for persisting JSON objects or arrays across flow\nruns. Common use cases include tracking sequence numbers, storing cursors\nfor delta syncs, caching lookup values, and passing state between runs.\n\n**Lookup Caches are now the preferred mechanism** for storing and\nretrieving data during flow execution. Prefer Lookup Caches for new\nintegrations; State remains supported for existing flows.\n\nState supports two scopes:\n\n- **Global** — account-wide keys visible to all flows and scripts.\n- **Resource-scoped** — keys namespaced under a specific export, import,\n  or integration. Resource-scoped keys are isolated from the global\n  key listing.\n\nValues must be non-empty JSON objects or arrays. Bare primitives,\n`null`, and empty containers (`{}`, `[]`) are rejected.\n\nPrefer resource-scoped state over global state when the data belongs\nto a specific export, import, or integration. State keys are upserted —\nPUT creates if absent, replaces if present. There is no PATCH; send the\nfull value each time.\n\n## State schema\n\n{% openapi-schemas spec=\"state\" schemas=\"State\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/state":{"delete":{"operationId":"deleteAllGlobalState","tags":["State"],"summary":"Delete all global state keys","description":"Deletes **all** global state keys and their values. This is a\ndestructive operation and cannot be undone.\n\nPrefer `DELETE /v1/state/{key}` to remove individual keys.","responses":{"204":{"description":"All global state deleted."},"401":{"$ref":"#/components/responses/401-unauthorized"}}}}}}
```

## Get a global state value

> Returns the JSON value stored under the given global key.\
> \
> Returns the raw JSON value (object or array), not wrapped in an envelope.

```json
{"openapi":"3.2.0","info":{"title":"State","version":"1.0.0"},"tags":[{"name":"State","description":"Key-value state store for persisting JSON objects or arrays across flow\nruns. Common use cases include tracking sequence numbers, storing cursors\nfor delta syncs, caching lookup values, and passing state between runs.\n\n**Lookup Caches are now the preferred mechanism** for storing and\nretrieving data during flow execution. Prefer Lookup Caches for new\nintegrations; State remains supported for existing flows.\n\nState supports two scopes:\n\n- **Global** — account-wide keys visible to all flows and scripts.\n- **Resource-scoped** — keys namespaced under a specific export, import,\n  or integration. Resource-scoped keys are isolated from the global\n  key listing.\n\nValues must be non-empty JSON objects or arrays. Bare primitives,\n`null`, and empty containers (`{}`, `[]`) are rejected.\n\nPrefer resource-scoped state over global state when the data belongs\nto a specific export, import, or integration. State keys are upserted —\nPUT creates if absent, replaces if present. There is no PATCH; send the\nfull value each time.\n\n## State schema\n\n{% openapi-schemas spec=\"state\" schemas=\"State\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"State":{"description":"A stored state value. Values must be non-empty JSON objects or arrays —\nbare primitives, `null`, and empty containers (`{}`, `[]`) are rejected.\nKeys are upserted: PUT creates the key if absent and replaces the value\nif present.","oneOf":[{"title":"object","type":"object","minProperties":1},{"title":"array","type":"array","minItems":1}]},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/state/{key}":{"get":{"operationId":"getGlobalStateValue","tags":["State"],"summary":"Get a global state value","description":"Returns the JSON value stored under the given global key.\n\nReturns the raw JSON value (object or array), not wrapped in an envelope.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The state key name."}],"responses":{"200":{"description":"The stored value (a JSON object or array).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/State"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"description":"The key does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Create or update a global state value

> 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.

```json
{"openapi":"3.2.0","info":{"title":"State","version":"1.0.0"},"tags":[{"name":"State","description":"Key-value state store for persisting JSON objects or arrays across flow\nruns. Common use cases include tracking sequence numbers, storing cursors\nfor delta syncs, caching lookup values, and passing state between runs.\n\n**Lookup Caches are now the preferred mechanism** for storing and\nretrieving data during flow execution. Prefer Lookup Caches for new\nintegrations; State remains supported for existing flows.\n\nState supports two scopes:\n\n- **Global** — account-wide keys visible to all flows and scripts.\n- **Resource-scoped** — keys namespaced under a specific export, import,\n  or integration. Resource-scoped keys are isolated from the global\n  key listing.\n\nValues must be non-empty JSON objects or arrays. Bare primitives,\n`null`, and empty containers (`{}`, `[]`) are rejected.\n\nPrefer resource-scoped state over global state when the data belongs\nto a specific export, import, or integration. State keys are upserted —\nPUT creates if absent, replaces if present. There is no PATCH; send the\nfull value each time.\n\n## State schema\n\n{% openapi-schemas spec=\"state\" schemas=\"State\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"State":{"description":"A stored state value. Values must be non-empty JSON objects or arrays —\nbare primitives, `null`, and empty containers (`{}`, `[]`) are rejected.\nKeys are upserted: PUT creates the key if absent and replaces the value\nif present.","oneOf":[{"title":"object","type":"object","minProperties":1},{"title":"array","type":"array","minItems":1}]},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/state/{key}":{"put":{"operationId":"setGlobalStateValue","tags":["State"],"summary":"Create or update a global state value","description":"Sets the value for a global state key. Creates the key if it does\nnot exist; replaces the value if it does.\n\nThe request body must be a non-empty JSON object or array. Bare\nJSON primitives (strings, numbers, booleans, `null`) and empty\ncontainers (`{}`, `[]`) are rejected.\n\nThis is an upsert — check the status code to distinguish create (201)\nfrom update (200). The response body is plain text, not JSON. If the\nstate belongs to a specific export, import, or integration, use the\nresource-scoped endpoint instead.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The state key name."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"A non-empty JSON object or array to store. Bare primitives\nand empty containers are not accepted.","$ref":"#/components/schemas/State"}}}},"responses":{"200":{"description":"Existing key updated.","content":{"text/plain":{"schema":{"type":"string","enum":["OK"]}}}},"201":{"description":"New key created.","content":{"text/plain":{"schema":{"type":"string","enum":["Created"]}}}},"400":{"description":"Invalid request body. The body is not valid JSON, or is a bare\nprimitive (string, number, boolean, or `null`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"415":{"description":"The `Content-Type` header is missing or is not\n`application/json`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request body is empty, or is an empty container (`{}` or\n`[]`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Delete a global state key

> Deletes a specific global state key and its value. Returns \`404\`\
> if the key does not exist.

```json
{"openapi":"3.2.0","info":{"title":"State","version":"1.0.0"},"tags":[{"name":"State","description":"Key-value state store for persisting JSON objects or arrays across flow\nruns. Common use cases include tracking sequence numbers, storing cursors\nfor delta syncs, caching lookup values, and passing state between runs.\n\n**Lookup Caches are now the preferred mechanism** for storing and\nretrieving data during flow execution. Prefer Lookup Caches for new\nintegrations; State remains supported for existing flows.\n\nState supports two scopes:\n\n- **Global** — account-wide keys visible to all flows and scripts.\n- **Resource-scoped** — keys namespaced under a specific export, import,\n  or integration. Resource-scoped keys are isolated from the global\n  key listing.\n\nValues must be non-empty JSON objects or arrays. Bare primitives,\n`null`, and empty containers (`{}`, `[]`) are rejected.\n\nPrefer resource-scoped state over global state when the data belongs\nto a specific export, import, or integration. State keys are upserted —\nPUT creates if absent, replaces if present. There is no PATCH; send the\nfull value each time.\n\n## State schema\n\n{% openapi-schemas spec=\"state\" schemas=\"State\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}},"schemas":{"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}}},"paths":{"/v1/state/{key}":{"delete":{"operationId":"deleteGlobalStateKey","tags":["State"],"summary":"Delete a global state key","description":"Deletes a specific global state key and its value. Returns `404`\nif the key does not exist.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The state key name."}],"responses":{"204":{"description":"Key deleted."},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"description":"The key does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## List state keys for a resource

> 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.

```json
{"openapi":"3.2.0","info":{"title":"State","version":"1.0.0"},"tags":[{"name":"State","description":"Key-value state store for persisting JSON objects or arrays across flow\nruns. Common use cases include tracking sequence numbers, storing cursors\nfor delta syncs, caching lookup values, and passing state between runs.\n\n**Lookup Caches are now the preferred mechanism** for storing and\nretrieving data during flow execution. Prefer Lookup Caches for new\nintegrations; State remains supported for existing flows.\n\nState supports two scopes:\n\n- **Global** — account-wide keys visible to all flows and scripts.\n- **Resource-scoped** — keys namespaced under a specific export, import,\n  or integration. Resource-scoped keys are isolated from the global\n  key listing.\n\nValues must be non-empty JSON objects or arrays. Bare primitives,\n`null`, and empty containers (`{}`, `[]`) are rejected.\n\nPrefer resource-scoped state over global state when the data belongs\nto a specific export, import, or integration. State keys are upserted —\nPUT creates if absent, replaces if present. There is no PATCH; send the\nfull value each time.\n\n## State schema\n\n{% openapi-schemas spec=\"state\" schemas=\"State\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/{resourceType}/{_resourceId}/state":{"get":{"operationId":"listResourceStateKeys","tags":["State"],"summary":"List state keys for a resource","description":"Returns the list of state key names stored under the specified\nresource. These keys are separate from global state.\n\nReturns `204 No Content` when no keys exist for the resource.\n\nOnly `exports`, `imports`, and `integrations` support\nresource-scoped state. Other resource types return `403`.\n\nThis only lists key names, not values. Call\n`GET /v1/{resourceType}/{_resourceId}/state/{key}` to retrieve a\nspecific value.","parameters":[{"name":"resourceType","in":"path","required":true,"schema":{"type":"string","enum":["exports","imports","integrations"]},"description":"The resource type. Only `exports`, `imports`, and\n`integrations` are supported."},{"name":"_resourceId","in":"path","required":true,"schema":{"type":"string","format":"objectId"},"description":"The resource ID."}],"responses":{"200":{"description":"Object containing an array of key names.","content":{"application/json":{"schema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"type":"string"}}}}}}},"204":{"description":"No state keys exist for this resource."},"400":{"description":"The resource ID is not a valid identifier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"description":"The resource type does not support state. Only `exports`,\n`imports`, and `integrations` are allowed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Delete all state keys for a resource

> 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.

```json
{"openapi":"3.2.0","info":{"title":"State","version":"1.0.0"},"tags":[{"name":"State","description":"Key-value state store for persisting JSON objects or arrays across flow\nruns. Common use cases include tracking sequence numbers, storing cursors\nfor delta syncs, caching lookup values, and passing state between runs.\n\n**Lookup Caches are now the preferred mechanism** for storing and\nretrieving data during flow execution. Prefer Lookup Caches for new\nintegrations; State remains supported for existing flows.\n\nState supports two scopes:\n\n- **Global** — account-wide keys visible to all flows and scripts.\n- **Resource-scoped** — keys namespaced under a specific export, import,\n  or integration. Resource-scoped keys are isolated from the global\n  key listing.\n\nValues must be non-empty JSON objects or arrays. Bare primitives,\n`null`, and empty containers (`{}`, `[]`) are rejected.\n\nPrefer resource-scoped state over global state when the data belongs\nto a specific export, import, or integration. State keys are upserted —\nPUT creates if absent, replaces if present. There is no PATCH; send the\nfull value each time.\n\n## State schema\n\n{% openapi-schemas spec=\"state\" schemas=\"State\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/{resourceType}/{_resourceId}/state":{"delete":{"operationId":"deleteAllResourceState","tags":["State"],"summary":"Delete all state keys for a resource","description":"Deletes **all** state keys and values stored under the specified\nresource. This is destructive and cannot be undone.\n\nPrefer `DELETE /v1/{resourceType}/{_resourceId}/state/{key}` to remove\nindividual keys.","parameters":[{"name":"resourceType","in":"path","required":true,"schema":{"type":"string","enum":["exports","imports","integrations"]},"description":"The resource type. Only `exports`, `imports`, and\n`integrations` are supported."},{"name":"_resourceId","in":"path","required":true,"schema":{"type":"string","format":"objectId"},"description":"The resource ID."}],"responses":{"204":{"description":"All resource state deleted."},"400":{"description":"The resource ID is not a valid identifier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"description":"The resource type does not support state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get a resource-scoped state value

> 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.

```json
{"openapi":"3.2.0","info":{"title":"State","version":"1.0.0"},"tags":[{"name":"State","description":"Key-value state store for persisting JSON objects or arrays across flow\nruns. Common use cases include tracking sequence numbers, storing cursors\nfor delta syncs, caching lookup values, and passing state between runs.\n\n**Lookup Caches are now the preferred mechanism** for storing and\nretrieving data during flow execution. Prefer Lookup Caches for new\nintegrations; State remains supported for existing flows.\n\nState supports two scopes:\n\n- **Global** — account-wide keys visible to all flows and scripts.\n- **Resource-scoped** — keys namespaced under a specific export, import,\n  or integration. Resource-scoped keys are isolated from the global\n  key listing.\n\nValues must be non-empty JSON objects or arrays. Bare primitives,\n`null`, and empty containers (`{}`, `[]`) are rejected.\n\nPrefer resource-scoped state over global state when the data belongs\nto a specific export, import, or integration. State keys are upserted —\nPUT creates if absent, replaces if present. There is no PATCH; send the\nfull value each time.\n\n## State schema\n\n{% openapi-schemas spec=\"state\" schemas=\"State\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"State":{"description":"A stored state value. Values must be non-empty JSON objects or arrays —\nbare primitives, `null`, and empty containers (`{}`, `[]`) are rejected.\nKeys are upserted: PUT creates the key if absent and replaces the value\nif present.","oneOf":[{"title":"object","type":"object","minProperties":1},{"title":"array","type":"array","minItems":1}]},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/{resourceType}/{_resourceId}/state/{key}":{"get":{"operationId":"getResourceStateValue","tags":["State"],"summary":"Get a resource-scoped state value","description":"Returns the JSON value stored under the given key for a specific\nresource.\n\nOnly `exports`, `imports`, and `integrations` support\nresource-scoped state.\n\nReturns the raw JSON value (object or array), not wrapped in an envelope.\nA 403 means the resource type doesn't support state, not a permissions\nissue.","parameters":[{"name":"resourceType","in":"path","required":true,"schema":{"type":"string","enum":["exports","imports","integrations"]},"description":"The resource type. Only `exports`, `imports`, and\n`integrations` are supported."},{"name":"_resourceId","in":"path","required":true,"schema":{"type":"string","format":"objectId"},"description":"The resource ID."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The state key name."}],"responses":{"200":{"description":"The stored value (a JSON object or array).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/State"}}}},"400":{"description":"The resource ID is not a valid identifier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"description":"The resource type does not support state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource or key was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Create or update a resource-scoped state value

> 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.

```json
{"openapi":"3.2.0","info":{"title":"State","version":"1.0.0"},"tags":[{"name":"State","description":"Key-value state store for persisting JSON objects or arrays across flow\nruns. Common use cases include tracking sequence numbers, storing cursors\nfor delta syncs, caching lookup values, and passing state between runs.\n\n**Lookup Caches are now the preferred mechanism** for storing and\nretrieving data during flow execution. Prefer Lookup Caches for new\nintegrations; State remains supported for existing flows.\n\nState supports two scopes:\n\n- **Global** — account-wide keys visible to all flows and scripts.\n- **Resource-scoped** — keys namespaced under a specific export, import,\n  or integration. Resource-scoped keys are isolated from the global\n  key listing.\n\nValues must be non-empty JSON objects or arrays. Bare primitives,\n`null`, and empty containers (`{}`, `[]`) are rejected.\n\nPrefer resource-scoped state over global state when the data belongs\nto a specific export, import, or integration. State keys are upserted —\nPUT creates if absent, replaces if present. There is no PATCH; send the\nfull value each time.\n\n## State schema\n\n{% openapi-schemas spec=\"state\" schemas=\"State\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"State":{"description":"A stored state value. Values must be non-empty JSON objects or arrays —\nbare primitives, `null`, and empty containers (`{}`, `[]`) are rejected.\nKeys are upserted: PUT creates the key if absent and replaces the value\nif present.","oneOf":[{"title":"object","type":"object","minProperties":1},{"title":"array","type":"array","minItems":1}]},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/{resourceType}/{_resourceId}/state/{key}":{"put":{"operationId":"setResourceStateValue","tags":["State"],"summary":"Create or update a resource-scoped state value","description":"Sets the value for a state key under a specific resource. Creates\nthe key if it does not exist; replaces the value if it does.\n\nThe request body must be a non-empty JSON object or array. Bare\nJSON primitives (strings, numbers, booleans, `null`) and empty\ncontainers (`{}`, `[]`) are rejected.\n\nOnly `exports`, `imports`, and `integrations` support\nresource-scoped state.\n\nThis is an upsert — check the status code to distinguish create (201)\nfrom update (200). The response body is plain text, not JSON.","parameters":[{"name":"resourceType","in":"path","required":true,"schema":{"type":"string","enum":["exports","imports","integrations"]},"description":"The resource type. Only `exports`, `imports`, and\n`integrations` are supported."},{"name":"_resourceId","in":"path","required":true,"schema":{"type":"string","format":"objectId"},"description":"The resource ID."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The state key name."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"A non-empty JSON object or array to store. Bare primitives\nand empty containers are not accepted.","$ref":"#/components/schemas/State"}}}},"responses":{"200":{"description":"Existing key updated.","content":{"text/plain":{"schema":{"type":"string","enum":["OK"]}}}},"201":{"description":"New key created.","content":{"text/plain":{"schema":{"type":"string","enum":["Created"]}}}},"400":{"description":"Invalid request. The body is not valid JSON, is a bare\nprimitive, or the resource ID is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"description":"The resource type does not support state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"The `Content-Type` header is missing or is not\n`application/json`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request body is empty, or is an empty container (`{}` or\n`[]`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Delete a resource-scoped state key

> Deletes a specific state key and its value from the resource.\
> Returns \`404\` if the key does not exist.

```json
{"openapi":"3.2.0","info":{"title":"State","version":"1.0.0"},"tags":[{"name":"State","description":"Key-value state store for persisting JSON objects or arrays across flow\nruns. Common use cases include tracking sequence numbers, storing cursors\nfor delta syncs, caching lookup values, and passing state between runs.\n\n**Lookup Caches are now the preferred mechanism** for storing and\nretrieving data during flow execution. Prefer Lookup Caches for new\nintegrations; State remains supported for existing flows.\n\nState supports two scopes:\n\n- **Global** — account-wide keys visible to all flows and scripts.\n- **Resource-scoped** — keys namespaced under a specific export, import,\n  or integration. Resource-scoped keys are isolated from the global\n  key listing.\n\nValues must be non-empty JSON objects or arrays. Bare primitives,\n`null`, and empty containers (`{}`, `[]`) are rejected.\n\nPrefer resource-scoped state over global state when the data belongs\nto a specific export, import, or integration. State keys are upserted —\nPUT creates if absent, replaces if present. There is no PATCH; send the\nfull value each time.\n\n## State schema\n\n{% openapi-schemas spec=\"state\" schemas=\"State\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/{resourceType}/{_resourceId}/state/{key}":{"delete":{"operationId":"deleteResourceStateKey","tags":["State"],"summary":"Delete a resource-scoped state key","description":"Deletes a specific state key and its value from the resource.\nReturns `404` if the key does not exist.","parameters":[{"name":"resourceType","in":"path","required":true,"schema":{"type":"string","enum":["exports","imports","integrations"]},"description":"The resource type. Only `exports`, `imports`, and\n`integrations` are supported."},{"name":"_resourceId","in":"path","required":true,"schema":{"type":"string","format":"objectId"},"description":"The resource ID."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The state key name."}],"responses":{"204":{"description":"Key deleted."},"400":{"description":"The resource ID is not a valid identifier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"description":"The resource type does not support state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource or key was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.celigo.com/api/api-reference/state.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
