> 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/scripts.md).

# Scripts

Scripts are reusable JavaScript functions that extend integration behavior. Use them as hooks in flows, logic in APIs and tools, or prompts in AI agents.

### Script schema

## The Script object

```json
{"openapi":"3.2.0","info":{"title":"Scripts","version":"1.0.0"},"components":{"schemas":{"Script":{"type":"object","description":"Script resource as returned by the API.","required":["_id","name","createdAt","lastModified"],"properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the script."},"name":{"type":"string","maxLength":100,"description":"Display name for the script."},"description":{"type":"string","maxLength":1024,"description":"Free-text explanation of what the script does."},"content":{"type":"string","description":"JavaScript source code. Only returned on GET-by-ID, omitted from\nlist responses to reduce payload size."},"postResponseHookToProcessOnChildRecord":{"type":"boolean","default":false,"description":"When true, postResponseMap hooks run once per child record in a one-to-many mapping instead of once per parent."},"debugUntil":{"type":"string","format":"date-time","readOnly":true,"description":"Debug logging is active until this timestamp. Absent or in the past\nmeans debug is off. Can only be set via PATCH — ignored on POST and PUT.\nMaximum 1 hour from the current time."},"_sourceId":{"type":"string","format":"objectId","readOnly":true,"description":"Source script this was cloned from. Present only on scripts created by cloning."},"_templateId":{"type":"string","format":"objectId","readOnly":true,"description":"The template (`templates` resource) this script was generated from. Present only on scripts created from a template; omitted otherwise."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the script was created."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the script was last updated."}}}}}}
```

## List scripts

> Returns all scripts in the account. Response omits \`content\` to reduce payload size.

```json
{"openapi":"3.2.0","info":{"title":"Scripts","version":"1.0.0"},"tags":[{"name":"Scripts","description":"Scripts are reusable JavaScript functions that extend integration behavior. Use them as hooks in flows, logic in APIs and tools, or prompts in AI agents.\n\n## Script schema\n\n{% openapi-schemas spec=\"script\" schemas=\"Script\" 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"}},"parameters":{"Include":{"name":"include","in":"query","required":false,"description":"Comma-separated list of fields to project into each returned record.\nTriggers summary projection: the response contains a minimal identity\nset (`_id`, `name`, plus resource-specific fields) with the requested\nfields added on top. Supports dot notation for nested fields.\nMutually exclusive with `exclude`.","schema":{"type":"string"}},"Exclude":{"name":"exclude","in":"query","required":false,"description":"Comma-separated list of fields to strip from the default response.\nUnlike `include`, does not trigger summary projection — returns the\nfull record with the named fields removed. Protected identity fields\n(e.g. `name`) cannot be stripped. Mutually exclusive with `include`.","schema":{"type":"string"}}},"schemas":{"Script":{"type":"object","description":"Script resource as returned by the API.","required":["_id","name","createdAt","lastModified"],"properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the script."},"name":{"type":"string","maxLength":100,"description":"Display name for the script."},"description":{"type":"string","maxLength":1024,"description":"Free-text explanation of what the script does."},"content":{"type":"string","description":"JavaScript source code. Only returned on GET-by-ID, omitted from\nlist responses to reduce payload size."},"postResponseHookToProcessOnChildRecord":{"type":"boolean","default":false,"description":"When true, postResponseMap hooks run once per child record in a one-to-many mapping instead of once per parent."},"debugUntil":{"type":"string","format":"date-time","readOnly":true,"description":"Debug logging is active until this timestamp. Absent or in the past\nmeans debug is off. Can only be set via PATCH — ignored on POST and PUT.\nMaximum 1 hour from the current time."},"_sourceId":{"type":"string","format":"objectId","readOnly":true,"description":"Source script this was cloned from. Present only on scripts created by cloning."},"_templateId":{"type":"string","format":"objectId","readOnly":true,"description":"The template (`templates` resource) this script was generated from. Present only on scripts created from a template; omitted otherwise."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the script was created."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the script was last updated."}}}},"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/scripts":{"get":{"summary":"List scripts","description":"Returns all scripts in the account. Response omits `content` to reduce payload size.","tags":["Scripts"],"operationId":"listScripts","parameters":[{"name":"limit","in":"query","required":false,"description":"Maximum number of scripts to return per page.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":1000}},{"$ref":"#/components/parameters/Include"},{"$ref":"#/components/parameters/Exclude"}],"responses":{"200":{"description":"Array of script objects.","headers":{"Link":{"description":"RFC 5988 pagination links. Includes `<...>; rel=\"next\"` when more\npages remain; absent on the final page.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Script"}}}}},"204":{"description":"No scripts exist in the account."},"401":{"$ref":"#/components/responses/401-unauthorized"}}}}}}
```

## Create a script

> Creates a new script.

```json
{"openapi":"3.2.0","info":{"title":"Scripts","version":"1.0.0"},"tags":[{"name":"Scripts","description":"Scripts are reusable JavaScript functions that extend integration behavior. Use them as hooks in flows, logic in APIs and tools, or prompts in AI agents.\n\n## Script schema\n\n{% openapi-schemas spec=\"script\" schemas=\"Script\" 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":{"Request":{"type":"object","description":"Fields for creating or updating a script.","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Display name for the script."},"description":{"type":"string","maxLength":1024,"description":"Free-text explanation of what the script does."},"content":{"type":"string","description":"JavaScript source code. Optional on create — the server initializes\nomitted content to an empty string. Omitting it on update leaves the\nstored source unchanged (it is not cleared)."},"postResponseHookToProcessOnChildRecord":{"type":"boolean","default":false,"description":"When true, postResponseMap hooks run once per child record in a one-to-many mapping instead of once per parent."},"_templateId":{"type":"string","format":"objectId","description":"Optional template identifier used to generate or structure script content."}}},"Script":{"type":"object","description":"Script resource as returned by the API.","required":["_id","name","createdAt","lastModified"],"properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the script."},"name":{"type":"string","maxLength":100,"description":"Display name for the script."},"description":{"type":"string","maxLength":1024,"description":"Free-text explanation of what the script does."},"content":{"type":"string","description":"JavaScript source code. Only returned on GET-by-ID, omitted from\nlist responses to reduce payload size."},"postResponseHookToProcessOnChildRecord":{"type":"boolean","default":false,"description":"When true, postResponseMap hooks run once per child record in a one-to-many mapping instead of once per parent."},"debugUntil":{"type":"string","format":"date-time","readOnly":true,"description":"Debug logging is active until this timestamp. Absent or in the past\nmeans debug is off. Can only be set via PATCH — ignored on POST and PUT.\nMaximum 1 hour from the current time."},"_sourceId":{"type":"string","format":"objectId","readOnly":true,"description":"Source script this was cloned from. Present only on scripts created by cloning."},"_templateId":{"type":"string","format":"objectId","readOnly":true,"description":"The template (`templates` resource) this script was generated from. Present only on scripts created from a template; omitted otherwise."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the script was created."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the script was last updated."}}},"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":{"400-bad-request":{"description":"Bad request. The server could not understand the request because of malformed syntax or invalid parameters.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"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"]}}}},"422-unprocessable-entity":{"description":"Unprocessable entity. The request was well-formed but was unable to be followed due to semantic errors.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/scripts":{"post":{"summary":"Create a script","description":"Creates a new script.","tags":["Scripts"],"operationId":"createScript","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}},"description":"Script object to create"},"responses":{"201":{"description":"Created script.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Script"}}}},"400":{"$ref":"#/components/responses/400-bad-request"},"401":{"$ref":"#/components/responses/401-unauthorized"},"422":{"$ref":"#/components/responses/422-unprocessable-entity"}}}}}}
```

## Get a script

> Returns a single script by ID, including the full \`content\` field.

```json
{"openapi":"3.2.0","info":{"title":"Scripts","version":"1.0.0"},"tags":[{"name":"Scripts","description":"Scripts are reusable JavaScript functions that extend integration behavior. Use them as hooks in flows, logic in APIs and tools, or prompts in AI agents.\n\n## Script schema\n\n{% openapi-schemas spec=\"script\" schemas=\"Script\" 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":{"Script":{"type":"object","description":"Script resource as returned by the API.","required":["_id","name","createdAt","lastModified"],"properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the script."},"name":{"type":"string","maxLength":100,"description":"Display name for the script."},"description":{"type":"string","maxLength":1024,"description":"Free-text explanation of what the script does."},"content":{"type":"string","description":"JavaScript source code. Only returned on GET-by-ID, omitted from\nlist responses to reduce payload size."},"postResponseHookToProcessOnChildRecord":{"type":"boolean","default":false,"description":"When true, postResponseMap hooks run once per child record in a one-to-many mapping instead of once per parent."},"debugUntil":{"type":"string","format":"date-time","readOnly":true,"description":"Debug logging is active until this timestamp. Absent or in the past\nmeans debug is off. Can only be set via PATCH — ignored on POST and PUT.\nMaximum 1 hour from the current time."},"_sourceId":{"type":"string","format":"objectId","readOnly":true,"description":"Source script this was cloned from. Present only on scripts created by cloning."},"_templateId":{"type":"string","format":"objectId","readOnly":true,"description":"The template (`templates` resource) this script was generated from. Present only on scripts created from a template; omitted otherwise."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the script was created."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the script was last updated."}}},"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"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/scripts/{_id}":{"get":{"summary":"Get a script","description":"Returns a single script by ID, including the full `content` field.","tags":["Scripts"],"operationId":"getScriptById","parameters":[{"name":"_id","in":"path","description":"Script ID.","required":true,"schema":{"type":"string","format":"objectId"}}],"responses":{"200":{"description":"Script object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Script"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"}}}}}}
```

## Update a script

> Replaces a script's mutable fields.

```json
{"openapi":"3.2.0","info":{"title":"Scripts","version":"1.0.0"},"tags":[{"name":"Scripts","description":"Scripts are reusable JavaScript functions that extend integration behavior. Use them as hooks in flows, logic in APIs and tools, or prompts in AI agents.\n\n## Script schema\n\n{% openapi-schemas spec=\"script\" schemas=\"Script\" 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":{"Request":{"type":"object","description":"Fields for creating or updating a script.","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Display name for the script."},"description":{"type":"string","maxLength":1024,"description":"Free-text explanation of what the script does."},"content":{"type":"string","description":"JavaScript source code. Optional on create — the server initializes\nomitted content to an empty string. Omitting it on update leaves the\nstored source unchanged (it is not cleared)."},"postResponseHookToProcessOnChildRecord":{"type":"boolean","default":false,"description":"When true, postResponseMap hooks run once per child record in a one-to-many mapping instead of once per parent."},"_templateId":{"type":"string","format":"objectId","description":"Optional template identifier used to generate or structure script content."}}},"Script":{"type":"object","description":"Script resource as returned by the API.","required":["_id","name","createdAt","lastModified"],"properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the script."},"name":{"type":"string","maxLength":100,"description":"Display name for the script."},"description":{"type":"string","maxLength":1024,"description":"Free-text explanation of what the script does."},"content":{"type":"string","description":"JavaScript source code. Only returned on GET-by-ID, omitted from\nlist responses to reduce payload size."},"postResponseHookToProcessOnChildRecord":{"type":"boolean","default":false,"description":"When true, postResponseMap hooks run once per child record in a one-to-many mapping instead of once per parent."},"debugUntil":{"type":"string","format":"date-time","readOnly":true,"description":"Debug logging is active until this timestamp. Absent or in the past\nmeans debug is off. Can only be set via PATCH — ignored on POST and PUT.\nMaximum 1 hour from the current time."},"_sourceId":{"type":"string","format":"objectId","readOnly":true,"description":"Source script this was cloned from. Present only on scripts created by cloning."},"_templateId":{"type":"string","format":"objectId","readOnly":true,"description":"The template (`templates` resource) this script was generated from. Present only on scripts created from a template; omitted otherwise."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the script was created."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the script was last updated."}}},"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":{"400-bad-request":{"description":"Bad request. The server could not understand the request because of malformed syntax or invalid parameters.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"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"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/scripts/{_id}":{"put":{"summary":"Update a script","description":"Replaces a script's mutable fields.","tags":["Scripts"],"operationId":"updateScript","parameters":[{"name":"_id","in":"path","description":"Script ID.","required":true,"schema":{"type":"string","format":"objectId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"responses":{"200":{"description":"Updated script.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Script"}}}},"400":{"$ref":"#/components/responses/400-bad-request"},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"}}}}}}
```

## Delete a script

> Deletes a script. Soft-deleted and retained in the recycle bin for 30 days.

```json
{"openapi":"3.2.0","info":{"title":"Scripts","version":"1.0.0"},"tags":[{"name":"Scripts","description":"Scripts are reusable JavaScript functions that extend integration behavior. Use them as hooks in flows, logic in APIs and tools, or prompts in AI agents.\n\n## Script schema\n\n{% openapi-schemas spec=\"script\" schemas=\"Script\" 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"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422-dependency-conflict":{"description":"The resource has dependents that must be deleted first. Each entry\nin the `errors` array names one blocking resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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/scripts/{_id}":{"delete":{"summary":"Delete a script","description":"Deletes a script. Soft-deleted and retained in the recycle bin for 30 days.","tags":["Scripts"],"operationId":"deleteScript","parameters":[{"name":"_id","in":"path","description":"Script ID.","required":true,"schema":{"type":"string","format":"objectId"}}],"responses":{"204":{"description":"Script deleted."},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"},"422":{"$ref":"#/components/responses/422-dependency-conflict"}}}}}}
```

## Patch a script

> Partially updates a script using JSON Patch (RFC 6902). Only\
> \`/debugUntil\` is a supported path — all others are rejected with 422.\
> Supported operations: \`replace\`, \`add\`, \`remove\`. The value must be an\
> ISO-8601 timestamp no more than 1 hour in the future.

```json
{"openapi":"3.2.0","info":{"title":"Scripts","version":"1.0.0"},"tags":[{"name":"Scripts","description":"Scripts are reusable JavaScript functions that extend integration behavior. Use them as hooks in flows, logic in APIs and tools, or prompts in AI agents.\n\n## Script schema\n\n{% openapi-schemas spec=\"script\" schemas=\"Script\" 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"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422-unprocessable-entity":{"description":"Unprocessable entity. The request was well-formed but was unable to be followed due to semantic errors.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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/scripts/{_id}":{"patch":{"summary":"Patch a script","description":"Partially updates a script using JSON Patch (RFC 6902). Only\n`/debugUntil` is a supported path — all others are rejected with 422.\nSupported operations: `replace`, `add`, `remove`. The value must be an\nISO-8601 timestamp no more than 1 hour in the future.","operationId":"patchScript","tags":["Scripts"],"parameters":[{"name":"_id","in":"path","description":"Script ID.","required":true,"schema":{"type":"string","format":"objectId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","minItems":1,"items":{"type":"object","required":["op","path"],"properties":{"op":{"type":"string","enum":["replace","add","remove"],"description":"The operation to perform."},"path":{"type":"string","enum":["/debugUntil"],"description":"JSON Pointer to the field to patch."},"value":{"type":"string","format":"date-time","description":"ISO-8601 timestamp. Required for `replace` and `add`, omit for `remove`."}}}}}}},"responses":{"204":{"description":"Script patched."},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"},"422":{"$ref":"#/components/responses/422-unprocessable-entity"}}}}}}
```

## Get debug logs for a script

> Returns console output captured while debug is enabled on the script\
> (\`debugUntil\` set to a future timestamp).

```json
{"openapi":"3.2.0","info":{"title":"Scripts","version":"1.0.0"},"tags":[{"name":"Scripts","description":"Scripts are reusable JavaScript functions that extend integration behavior. Use them as hooks in flows, logic in APIs and tools, or prompts in AI agents.\n\n## Script schema\n\n{% openapi-schemas spec=\"script\" schemas=\"Script\" 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"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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/scripts/{_id}/logs":{"get":{"summary":"Get debug logs for a script","description":"Returns console output captured while debug is enabled on the script\n(`debugUntil` set to a future timestamp).","tags":["Scripts"],"operationId":"getScriptLogs","parameters":[{"name":"_id","in":"path","description":"Script ID.","required":true,"schema":{"type":"string","format":"objectId"}}],"responses":{"200":{"description":"Log entries for the script.","content":{"application/json":{"schema":{"type":"object","properties":{"logs":{"type":"array","description":"Debug log entries. Empty array when no logs exist or debug is not enabled.","items":{"type":"object","properties":{"time":{"type":"string","description":"Timestamp when the log was captured."},"functionType":{"type":"string","description":"Hook type that produced the log."},"_resourceId":{"type":"string","format":"objectId","description":"ID of the export or import the script was running on."},"logLevel":{"type":"string","description":"Severity level of the log entry.","enum":["INFO","WARN","ERROR"]},"message":{"type":"string","description":"Log message content."}}}}}}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"}}}}}}
```

## Delete debug logs for a script

> Deletes all debug logs for the specified script. Synchronous and\
> idempotent — works even if the script has no logs.

```json
{"openapi":"3.2.0","info":{"title":"Scripts","version":"1.0.0"},"tags":[{"name":"Scripts","description":"Scripts are reusable JavaScript functions that extend integration behavior. Use them as hooks in flows, logic in APIs and tools, or prompts in AI agents.\n\n## Script schema\n\n{% openapi-schemas spec=\"script\" schemas=\"Script\" 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"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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/scripts/{_id}/logs":{"delete":{"operationId":"deleteScriptLogs","tags":["Scripts"],"summary":"Delete debug logs for a script","description":"Deletes all debug logs for the specified script. Synchronous and\nidempotent — works even if the script has no logs.","parameters":[{"name":"_id","in":"path","description":"Script ID.","required":true,"schema":{"type":"string","format":"objectId"}}],"responses":{"204":{"description":"Logs deleted."},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"}}}}}}
```

## Get audit log for a script

> Returns the change history for a script. Each entry records a mutation\
> event with who made the change, when, and which fields were affected.

```json
{"openapi":"3.2.0","info":{"title":"Scripts","version":"1.0.0"},"tags":[{"name":"Scripts","description":"Scripts are reusable JavaScript functions that extend integration behavior. Use them as hooks in flows, logic in APIs and tools, or prompts in AI agents.\n\n## Script schema\n\n{% openapi-schemas spec=\"script\" schemas=\"Script\" 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":{"400-bad-request":{"description":"Bad request. The server could not understand the request because of malformed syntax or invalid parameters.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"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"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422-unprocessable-entity":{"description":"Unprocessable entity. The request was well-formed but was unable to be followed due to semantic errors.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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/scripts/{_id}/audit":{"get":{"summary":"Get audit log for a script","description":"Returns the change history for a script. Each entry records a mutation\nevent with who made the change, when, and which fields were affected.","tags":["Scripts"],"operationId":"getScriptAudit","parameters":[{"name":"_id","in":"path","description":"Script ID.","required":true,"schema":{"type":"string","format":"objectId"}},{"name":"limit","in":"query","description":"Maximum number of audit entries to return per page.","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":1000}},{"name":"after","in":"query","required":false,"description":"Opaque pagination cursor for the next page. Take it from the `after` value in the `Link`\nresponse header's `rel=\"next\"` URL rather than constructing it.","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"Only return entries at or after this timestamp.","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"description":"Only return entries at or before this timestamp.","schema":{"type":"string","format":"date-time"}},{"name":"action","in":"query","required":false,"description":"Filter by the change type. Maps to the `event` field on each entry.","schema":{"type":"string","enum":["create","update","delete","view","restore","purge","signin","signout","purgelogs"]}},{"name":"source","in":"query","required":false,"description":"Filter by how the change was initiated.","schema":{"type":"string","enum":["ui","api","system","connector","script","sso"]}},{"name":"_byUserId","in":"query","required":false,"description":"Filter to changes performed by a single user.","schema":{"type":"string","format":"objectId"}}],"responses":{"200":{"description":"Array of audit entries, newest first.","headers":{"Link":{"description":"RFC 5988 pagination link. Includes `<...>; rel=\"next\"` with an\n`after` cursor when more entries exist; absent on the final page.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","format":"objectId","description":"Unique identifier for this audit entry."},"resourceType":{"type":"string","description":"Always `script` for this endpoint."},"_resourceId":{"type":"string","format":"objectId","description":"ID of the script this entry belongs to."},"event":{"type":"string","description":"Type of change that occurred.","enum":["create","update","delete","purge","restore"]},"source":{"type":"string","description":"How the change was initiated.","enum":["api","ui","system"]},"time":{"type":"string","format":"date-time","description":"When the change occurred."},"byUser":{"type":"object","description":"User who made the change.","properties":{"_id":{"type":"string","format":"objectId","description":"User ID."},"email":{"type":"string","format":"email","description":"User email address."},"name":{"type":"string","description":"User display name."}}},"fieldChanges":{"type":"array","description":"Fields that were modified.","items":{"type":"object","properties":{"fieldPath":{"type":"string","description":"Dot-notation path of the changed field."},"oldValue":{"description":"Previous value (absent on create)."},"newValue":{"description":"New value (absent on delete)."}}}},"deletedInfo":{"type":"object","description":"Metadata about the deleted resource. Present on `delete` events.","properties":{"name":{"type":"string","description":"Name of the resource at the time of deletion."}}}}}}}}},"204":{"description":"No audit entries exist for this script."},"400":{"$ref":"#/components/responses/400-bad-request"},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"},"422":{"$ref":"#/components/responses/422-unprocessable-entity"}}}}}}
```

## List dependencies of a script

> Returns the set of resources that depend on the specified script.

```json
{"openapi":"3.2.0","info":{"title":"Scripts","version":"1.0.0"},"tags":[{"name":"Scripts","description":"Scripts are reusable JavaScript functions that extend integration behavior. Use them as hooks in flows, logic in APIs and tools, or prompts in AI agents.\n\n## Script schema\n\n{% openapi-schemas spec=\"script\" schemas=\"Script\" 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":{"DependencyResponse":{"type":"object","description":"Map of dependent-resource types to arrays of dependency entries.\nKeys are plural resource type strings (e.g. `flows`, `imports`,\n`connections`). An empty object `{}` means no dependents.\n","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/DependencyEntry"}}},"DependencyEntry":{"type":"object","description":"A single resource that depends on the queried resource.","properties":{"id":{"type":"string","description":"Unique identifier of the dependent resource."},"name":{"type":"string","description":"Display name of the dependent resource."},"paths":{"type":"array","description":"Dot-notation paths within the dependent resource that reference\nthe target resource. `[*]` denotes array elements.","items":{"type":"string"}},"accessLevel":{"type":"string","description":"The caller's access level on the dependent resource."},"dependencyIds":{"type":"object","description":"Map of resource types to arrays of IDs that this dependent\nresource references on the target. Keys are singular or plural\nresource type strings; values are arrays of ID strings.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["id","name","paths","accessLevel","dependencyIds"]}},"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/scripts/{_id}/dependencies":{"get":{"operationId":"listScriptDependencies","tags":["Scripts"],"summary":"List dependencies of a script","description":"Returns the set of resources that depend on the specified script.","parameters":[{"name":"_id","in":"path","required":true,"description":"Script ID.","schema":{"type":"string","format":"objectId"}}],"responses":{"200":{"description":"Dependency map. Keys are resource-type strings; values are arrays\nof dependency entries. Returns `{}` when no dependents exist.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DependencyResponse"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"}}}}}}
```


---

# 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/scripts.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.
