List procedures

GET/v2/agents/{agentId}/procedures

Return the procedures of an agent, the plain-language step-by-step instructions it follows, with their names, steps and enabled state.

Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.

Returns a page of the procedures of one agent. Call it to review how the agent is told to handle each type of request, to back up procedures to your own repository, or to find the prc_ ID you need to read or change one.

Request

GET /v2/agents/{agentId}/procedures

Path parameters:

Name Type Required Description
agentId string Yes The ID of the agent, starting with agt_.

Query parameters:

Name Type Required Description
limit integer No Items per page, from 1 to 100. Defaults to 20.
cursor string No The nextCursor value from the previous page.
enabled boolean No true or false to return only enabled or disabled procedures.

A procedure is a set of steps in plain language, for example how to handle a refund request. In the dashboard you find them under Build > Procedures, and Procedures overview explains how to write good ones.

Example request

curl "https://api.askocto.co/v2/agents/agt_8f3k2m/procedures?enabled=true" \
  -H "Authorization: Bearer $OCTO_API_KEY"
const url = new URL("https://api.askocto.co/v2/agents/agt_8f3k2m/procedures")
url.searchParams.set("enabled", "true")

const response = await fetch(url, {
  headers: { Authorization: `Bearer ${process.env.OCTO_API_KEY}` },
})

const { data } = await response.json()
for (const procedure of data) console.log(procedure.id, procedure.name, procedure.steps.length)

Example response

A successful call returns 200 OK.

{
  "data": [
    {
      "id": "prc_3v8k5d",
      "agentId": "agt_8f3k2m",
      "name": "Refund request",
      "description": "Use when a customer asks for their money back.",
      "steps": [
        "Look up the order.",
        "If the order is under 30 days old, offer a refund.",
        "Otherwise offer store credit and escalate if the customer objects."
      ],
      "enabled": true,
      "createdAt": "2026-02-12T10:00:00Z",
      "updatedAt": "2026-03-05T11:30:00Z"
    },
    {
      "id": "prc_6h2q9m",
      "agentId": "agt_8f3k2m",
      "name": "Order tracking",
      "description": "Use when a customer asks where their order is.",
      "steps": [
        "Ask for the order number if the customer has not given it.",
        "Look up the order and share the tracking status."
      ],
      "enabled": true,
      "createdAt": "2026-02-12T10:15:00Z",
      "updatedAt": "2026-02-12T10:15:00Z"
    }
  ],
  "nextCursor": null
}

Response fields

Name Type Description
data[].id string The procedure ID, starting with prc_.
data[].agentId string The agent the procedure belongs to.
data[].name string The name of the procedure.
data[].description string Tells the agent when the procedure applies.
data[].steps array of strings The steps in order, each written in plain language.
data[].enabled boolean Whether the agent follows the procedure.
data[].createdAt, data[].updatedAt string ISO 8601 UTC times.
nextCursor string or null Pass it as cursor for the next page. null on the last page.

Errors

Status Code When
400 invalid_request limit is outside 1 to 100, or enabled is not true or false.
401 unauthorized The API key is missing, malformed or deleted.
404 not_found No agent has this ID in your workspace.
429 rate_limited Too many requests. Wait for the number of seconds in the Retry-After header.

See Pagination for how cursors work.

Something unclear or missing? Tell us and we will fix the page.