{
  "openapi": "3.1.0",
  "info": {
    "title": "Center of Agentic API",
    "version": "unversioned",
    "summary": "The documented operations an API key can call.",
    "description": "Generated from the [REST reference](https://centerofagentic.com/docs/api): 110 operations in 12 areas. This file follows the reference.\n\nIt covers the documented operations an API key can call. Operations that only a person signed in to the web workspace can use are on the reference pages and are not listed here.\n\nThe API as a whole has no version number; only the external agent paths carry `v1`. This file describes the current reference and changes with it.\n\nRequest fields are described as on the reference pages, so a type can be looser here than in the service. A successful response is described in words, with an example where the reference has one, and not with a schema.\n\nEvery operation is described from the service's code and checked against it when the docs are built. The operations are not yet exercised against the live service one by one."
  },
  "externalDocs": {
    "description": "Developer documentation",
    "url": "https://centerofagentic.com/docs"
  },
  "servers": [
    {
      "url": "https://centerofagentic.com"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "tags": [
    {
      "name": "Agents",
      "description": "Read agents, their activation state and versions, request launch tickets for runs, and list the models a workspace can use.",
      "externalDocs": {
        "description": "Reference page",
        "url": "https://centerofagentic.com/docs/api/agents"
      }
    },
    {
      "name": "Runs and conversations",
      "description": "Run an agent once, stream its answer, drive long tool-using runs as resumable jobs, and keep multi-turn conversations with message history.",
      "externalDocs": {
        "description": "Reference page",
        "url": "https://centerofagentic.com/docs/api/runs"
      }
    },
    {
      "name": "Receipts, approvals and audit",
      "description": "Read run receipts, score and annotate them, list operations awaiting approval and read the workspace audit log.",
      "externalDocs": {
        "description": "Reference page",
        "url": "https://centerofagentic.com/docs/api/receipts"
      }
    },
    {
      "name": "Workspace settings and keys",
      "description": "Check a credential and the service, and read or manage workspace settings: the model key, configuration, tool policy, API keys and MCP access. 9 more operations on the reference page accept only a signed-in person and are not in this file.",
      "externalDocs": {
        "description": "Reference page",
        "url": "https://centerofagentic.com/docs/api/workspace"
      }
    },
    {
      "name": "Integrations and connections",
      "description": "List the Marketing Cloud Engagement and Jira connections of a workspace and read their state. Connections are set up in the web workspace.",
      "externalDocs": {
        "description": "Reference page",
        "url": "https://centerofagentic.com/docs/api/integrations"
      }
    },
    {
      "name": "Knowledge and skills",
      "description": "Manage the knowledge catalogue, custom skills and macros, and move skills in and out of a workspace as portable documents.",
      "externalDocs": {
        "description": "Reference page",
        "url": "https://centerofagentic.com/docs/api/knowledge-skills"
      }
    },
    {
      "name": "Datasets, experiments and annotations",
      "description": "Build datasets of policy test cases, run them as experiments per authority level, compare and schedule runs, and read the human review queue.",
      "externalDocs": {
        "description": "Reference page",
        "url": "https://centerofagentic.com/docs/api/evaluations"
      }
    },
    {
      "name": "Monitoring, alerts and webhooks",
      "description": "Read dashboard, usage, spend and fleet governance metrics, list active alerts, and receive signed governance webhooks. 5 more operations on the reference page accept only a signed-in person and are not in this file.",
      "externalDocs": {
        "description": "Reference page",
        "url": "https://centerofagentic.com/docs/api/monitoring"
      }
    },
    {
      "name": "Templates, domain packs and authoring",
      "description": "Read agent templates, author and publish domain packs, submit contribution proposals, and call the Builder and CoA Assistant endpoints.",
      "externalDocs": {
        "description": "Reference page",
        "url": "https://centerofagentic.com/docs/api/authoring"
      }
    },
    {
      "name": "Missions and tasks",
      "description": "Read mission trees, per-job execution detail and finished-mission outcomes. The task routes are not part of the programmatic API.",
      "externalDocs": {
        "description": "Reference page",
        "url": "https://centerofagentic.com/docs/api/missions-tasks"
      }
    },
    {
      "name": "External agents and governed operations",
      "description": "Register agents from other frameworks. Sending their tool calls to the platform for a recorded decision is a pilot, closed unless Center of Agentic enables it. 10 more operations on the reference page accept only a signed-in person and are not in this file.",
      "externalDocs": {
        "description": "Reference page",
        "url": "https://centerofagentic.com/docs/api/external-agents"
      }
    },
    {
      "name": "Desktop app and device tokens",
      "description": "Check which workspace a credential resolves to and manage the device tokens that sign the desktop app in to a workspace. 3 more operations on the reference page accept only a signed-in person and are not in this file.",
      "externalDocs": {
        "description": "Reference page",
        "url": "https://centerofagentic.com/docs/api/desktop"
      }
    }
  ],
  "paths": {
    "/api/agents": {
      "get": {
        "operationId": "getAgents",
        "summary": "List agents",
        "description": "Returns every agent in the workspace, most recently updated first. The list is not paginated. When the calling key can also make this read over MCP, the request counts against the same rate limit as its MCP calls; see [Rate limits](https://centerofagentic.com/docs/reference/rate-limits).\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Agents"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/agents#get-agents"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object `{ agents }`. Each agent has `id`, `name`, `status`, `grantLifecycle`, `authority`, `runtimeMode`, `model`, `delegation`, `purpose`, `outcome`, `dataClasses`, `skills`, `knowledgeLayers`, `localPermissions`, `clarification`, `readiness` (0 to 100, how completely the agent is configured), `owner` (a free-text label), `createdBy` (the creator's user id), `version` (a display label), `connections` (connection ids), `sourcePackId`, `sourceTemplateId`, `sourceTemplateVersion`, `createdAt` and `updatedAt`. An agent under managed activation also has `activeGrant` with `versionId` and `state`: `available`, `paused`, `revoked` or `not_active`. `createdAt` is an ISO 8601 timestamp; `updatedAt` is a date-time string that is not guaranteed to be ISO 8601, so parse it leniently.",
            "content": {
              "application/json": {
                "example": {
                  "agents": [
                    {
                      "activeGrant": {
                        "versionId": "9b2e4c70-5d1a-4f3e-8c26-7a1d0e5b4f92",
                        "state": "available"
                      },
                      "grantLifecycle": "managed",
                      "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "name": "Contract summary assistant",
                      "status": "published",
                      "authority": "recommend",
                      "runtimeMode": "hybrid",
                      "model": "example-lab/example-chat-1",
                      "delegation": null,
                      "purpose": "Summarise supplier contracts for the procurement team.",
                      "outcome": "A one-page summary with renewal dates and open risks.",
                      "dataClasses": [
                        "public",
                        "internal"
                      ],
                      "skills": [
                        "summarize"
                      ],
                      "knowledgeLayers": {
                        "domain": true
                      },
                      "localPermissions": {
                        "selectedFiles": true
                      },
                      "clarification": {},
                      "readiness": 100,
                      "owner": "Procurement",
                      "createdBy": "user_example0000000000000000",
                      "version": "0.1.0",
                      "connections": [],
                      "sourcePackId": null,
                      "sourceTemplateId": null,
                      "sourceTemplateVersion": null,
                      "createdAt": "2026-11-20T08:30:00.000Z",
                      "updatedAt": "Sat Nov 21 2026 09:14:03 GMT+0000 (Coordinated Universal Time)"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agents/{id}": {
      "get": {
        "operationId": "getAgentsById",
        "summary": "Get one agent",
        "description": "Returns the same agent object as the list, with two additions and one difference. `proposalRevision` is a hash of the agent's stored record; it changes whenever any stored field changes, including `status` and the update time, which makes it useful for change detection. `runtimeRestrictions` and, unlike the list, `dataClasses` carry the stored values exactly as saved, without defaults filled in. The response is sent with `Cache-Control: private, no-store`, and the MCP rate-limit note on the list applies here too.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Agents"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/agents#get-agents-id"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The agent id. The value is not validated before the lookup: an id that is not a UUID produces a `500` response with `server_error`, not `404`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The agent object with `proposalRevision` (64 hexadecimal characters) and `runtimeRestrictions`, an object `{ authority, localPermissions, runtimeMode }`.",
            "content": {
              "application/json": {
                "example": {
                  "activeGrant": {
                    "versionId": "9b2e4c70-5d1a-4f3e-8c26-7a1d0e5b4f92",
                    "state": "available"
                  },
                  "proposalRevision": "4b1f0c2d9e8a7f6053c1d2e4b5a6978801f2e3d4c5b6a7980a1b2c3d4e5f6071",
                  "grantLifecycle": "managed",
                  "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                  "name": "Contract summary assistant",
                  "status": "published",
                  "authority": "recommend",
                  "runtimeMode": "hybrid",
                  "model": "example-lab/example-chat-1",
                  "delegation": null,
                  "purpose": "Summarise supplier contracts for the procurement team.",
                  "outcome": "A one-page summary with renewal dates and open risks.",
                  "dataClasses": [
                    "public",
                    "internal"
                  ],
                  "skills": [
                    "summarize"
                  ],
                  "knowledgeLayers": {
                    "domain": true
                  },
                  "localPermissions": {
                    "selectedFiles": true
                  },
                  "clarification": {},
                  "readiness": 100,
                  "owner": "Procurement",
                  "createdBy": "user_example0000000000000000",
                  "version": "0.1.0",
                  "connections": [],
                  "sourcePackId": null,
                  "sourceTemplateId": null,
                  "sourceTemplateVersion": null,
                  "createdAt": "2026-11-20T08:30:00.000Z",
                  "updatedAt": "Sat Nov 21 2026 09:14:03 GMT+0000 (Coordinated Universal Time)",
                  "runtimeRestrictions": {
                    "authority": "recommend",
                    "localPermissions": {
                      "selectedFiles": true
                    },
                    "runtimeMode": "hybrid"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No agent with this id exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agents/{id}/preview": {
      "get": {
        "operationId": "getAgentsByIdPreview",
        "summary": "Preview the system prompt of an agent's saved configuration",
        "description": "Composes the system prompt from the agent's current saved configuration, including its selected skills and knowledge sources. A run of an activated agent uses the prompt captured in its active version, which can differ from this preview when the configuration was edited after activation.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Agents"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/agents#get-agents-id-preview"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The agent id. An id that is not a UUID produces a `500` response with `server_error`, not `404`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An object `{ systemPrompt }`, where `systemPrompt` is a string.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No agent with this id exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agents/{id}/grants": {
      "get": {
        "operationId": "getAgentsByIdGrants",
        "summary": "Get an agent's activation state",
        "description": "Returns the candidate awaiting review, the active version, and whether the agent is paused or revoked. Each `capture` is the exact configuration that was captured, including the manifest, the system prompt and the allowed models. The example shows an agent that has not been activated yet.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Agents"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/agents#get-agents-id-grants"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The agent id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An object with `protocol` (`agent-active-grants/1`), `lifecycle` (`managed` or `legacy_unadopted`), `expected` (the current state markers `draftRevision`, `activeVersionId`, `restrictionRevision`, `epoch` and `availabilityRevision`), `candidate` (`{ id, digest, capture }` or null), `active` (`{ id, digest, activatedBy, activatedAt, capture }` or null), `revoked`, `paused`, `retentionDays` and `retentionBasis` (both null until a retention period has been recorded).",
            "content": {
              "application/json": {
                "example": {
                  "protocol": "agent-active-grants/1",
                  "lifecycle": "managed",
                  "expected": {
                    "draftRevision": null,
                    "activeVersionId": null,
                    "restrictionRevision": 0,
                    "epoch": 0,
                    "availabilityRevision": 0
                  },
                  "candidate": null,
                  "active": null,
                  "revoked": false,
                  "paused": false,
                  "retentionDays": null,
                  "retentionBasis": null
                }
              }
            }
          },
          "400": {
            "description": "`invalid_grant_input`: The id in the path is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_grant_input": {
                    "value": {
                      "error": "invalid_grant_input"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No agent with this id exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`grant_state_unavailable`: The activation state could not be read. Repeat the read before acting on an earlier result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "grant_state_unavailable": {
                    "value": {
                      "error": "grant_state_unavailable"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agents/{id}/versions": {
      "get": {
        "operationId": "getAgentsByIdVersions",
        "summary": "List an agent's versions",
        "description": "Returns activated versions first, newest first, followed by entries from the label-based version log, newest first. For an activated version, `id` and `version` are both the version id, `status` is `published`, `note` is `Managed activation` and `activationVerified` is true. An agent id that does not exist in the workspace returns an empty list.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Agents"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/agents#get-agents-id-versions"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The agent id. An id that is not a UUID produces a `500` response with `server_error`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An object `{ versions }`. Each entry has `id`, `version`, `status`, `note`, `createdBy`, `createdAt` and `activationVerified`, which is false for entries from the label-based version log. `note` and `createdBy` can be null. `createdAt` is a date-time string that is not guaranteed to be ISO 8601, so parse it leniently.",
            "content": {
              "application/json": {
                "example": {
                  "versions": [
                    {
                      "id": "9b2e4c70-5d1a-4f3e-8c26-7a1d0e5b4f92",
                      "version": "9b2e4c70-5d1a-4f3e-8c26-7a1d0e5b4f92",
                      "status": "published",
                      "note": "Managed activation",
                      "createdBy": "user_example0000000000000000",
                      "createdAt": "Sat Nov 21 2026 09:14:03 GMT+0000 (Coordinated Universal Time)",
                      "activationVerified": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agents/{id}/version-snapshot": {
      "get": {
        "operationId": "getAgentsByIdVersionSnapshot",
        "summary": "Get the snapshot of one agent version",
        "description": "Returns what was captured for one version: the manifest, the configuration and the system prompt. Fetch two snapshots to compare versions. Pass the `version` value of an entry from the versions list: a version id for an activated version, or a version label for an entry from the label-based version log.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Agents"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/agents#get-agents-id-version-snapshot"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The agent id. An id that is not a UUID produces a `500` response with `server_error`, not `404`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": true,
            "description": "The version to read: the id of an activated version (a UUID), or the version label of an entry from the label-based version log. The match is exact.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An object with `version`, `manifest` (the package manifest that bounds what the version may do), `grantBasis` (`{ gate, entries }` or null), `config`, `systemPrompt` and `createdAt` (an ISO 8601 timestamp). `config` holds `name`, `purpose`, `outcome`, `clarification`, `authority`, `runtime_mode`, `data_classes`, `skills`, `knowledge_layers`, `local_permissions`, `connections` and `model`. An activated version also has `digest` and `activationVerified: true`. For an entry from the label-based version log, `systemPrompt` and `createdAt` can be null.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`version_required`: The `version` query parameter is missing or empty.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "version_required": {
                    "value": {
                      "error": "version_required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`no_snapshot`: The agent has no snapshot for this version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "no_snapshot": {
                    "value": {
                      "error": "no_snapshot"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agent-runtime/ticket": {
      "post": {
        "operationId": "postAgentRuntimeTicket",
        "summary": "Request a launch ticket for one run of an activated agent",
        "description": "Issues a ticket bound to the caller, the agent, the run entry point and a hash of the run request. An unused ticket expires ten minutes after it is issued. The call is idempotent on `nonce`: repeating it with the same values returns the same ticket, with `rootId` set once the ticket has started a run. A caller can request at most 120 tickets per hour.\n\n**Access:** API key with the `run` scope, or a signed-in workspace member. Send the header `X-CoA-Agent-Protocol: agent-active-grants/1`. The agent must be under managed activation and have an active version that is neither paused nor revoked.",
        "tags": [
          "Agents"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/agents#post-agent-runtime-ticket"
        },
        "security": [
          {
            "ApiKey": [
              "run"
            ]
          }
        ],
        "x-coa-scope": "run",
        "parameters": [
          {
            "name": "X-CoA-Agent-Protocol",
            "in": "header",
            "required": true,
            "description": "Must be exactly `agent-active-grants/1`. A request without it, or with any other value, is refused with `426 agent_protocol_required`. Send the same header on the run that uses the ticket.",
            "schema": {
              "type": "string",
              "enum": [
                "agent-active-grants/1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The agent to run. It must match the agent that the run targets: the `agentId` inside `request`, or the conversation's agent for a `conversation` ticket."
                  },
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "run",
                      "run_stream",
                      "run_job",
                      "conversation",
                      "desktop"
                    ],
                    "description": "The run entry point the ticket is for: `run` for `POST /api/run`, `run_stream` for `POST /api/run/stream`, `run_job` for `POST /api/run/job` and `conversation` for `POST /api/conversations/{id}/run/stream`. `desktop` is used by the desktop app."
                  },
                  "nonce": {
                    "type": "string",
                    "format": "uuid",
                    "description": "A new UUID that you generate for this launch. Reusing a nonce with a different agent, purpose or request is refused."
                  },
                  "request": {
                    "type": "object",
                    "description": "The exact JSON body you will send to the run endpoint. The ticket is bound to a hash of this object, so the run body must have the same content; key order does not matter. For `run`, `run_stream` and `run_job` it must contain the same `agentId`."
                  },
                  "parentScope": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Required for `conversation` tickets: the conversation id, written exactly as in the run path. The conversation must belong to the caller, that is, the same API key or signed-in person. Omit it for other purposes."
                  }
                },
                "required": [
                  "agentId",
                  "purpose",
                  "nonce",
                  "request"
                ]
              },
              "example": {
                "agentId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                "purpose": "run",
                "nonce": "5d0e7a34-2c1b-4f6a-9e83-b1c4d2f7a650",
                "request": {
                  "agentId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                  "prompt": "Summarise the attached supplier contract in five bullet points."
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An object `{ ticketId, expiresAt, rootId }`. `rootId` is null until the ticket has started a run, and then holds that run's root id.",
            "content": {
              "application/json": {
                "example": {
                  "ticketId": "c7a1e2d4-6b3f-4a90-8d15-2e9f0b6c3a71",
                  "expiresAt": "2026-11-28T10:25:00.123456+00:00",
                  "rootId": null
                }
              }
            }
          },
          "400": {
            "description": "`agent_required`: `agentId` is missing or not a string.\n\n`invalid_agent_launch`: `purpose` is not an allowed value, `nonce` is missing or not a UUID, or `request` is not a JSON object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_required": {
                    "value": {
                      "error": "agent_required"
                    }
                  },
                  "invalid_agent_launch": {
                    "value": {
                      "error": "invalid_agent_launch"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`agent_not_found`: The targeted agent does not exist in the workspace.\n\n`conversation_not_found`: For a `conversation` ticket, the conversation does not exist or belongs to someone else.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_not_found": {
                    "value": {
                      "error": "agent_not_found"
                    }
                  },
                  "conversation_not_found": {
                    "value": {
                      "error": "conversation_not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`agent_adoption_required`: The agent is not under managed activation, or `request` does not target the agent named in `agentId`.\n\n`agent_admission_unavailable`: The agent has no active version, is paused or revoked, or the ticket first issued for this nonce expired unused.\n\n`agent_launch_conflict`: The nonce was already used with a different agent, purpose, conversation or request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_adoption_required": {
                    "value": {
                      "error": "agent_adoption_required"
                    }
                  },
                  "agent_admission_unavailable": {
                    "value": {
                      "error": "agent_admission_unavailable"
                    }
                  },
                  "agent_launch_conflict": {
                    "value": {
                      "error": "agent_launch_conflict"
                    }
                  }
                }
              }
            }
          },
          "426": {
            "description": "`agent_protocol_required`: The `X-CoA-Agent-Protocol` header is missing or has a different value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_protocol_required": {
                    "value": {
                      "error": "agent_protocol_required"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "`agent_launch_limit`: The caller requested 120 tickets in the last hour, or a ticket storage limit for the agent or workspace is reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_launch_limit": {
                    "value": {
                      "error": "agent_launch_limit"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`agent_runtime_unavailable`: The ticket could not be issued. Repeating the call with the same nonce is safe: it returns the ticket if one was created. The same response is returned when the `agentId` inside `request` is not a UUID, or when the `parentScope` of a `conversation` ticket is missing or not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_runtime_unavailable": {
                    "value": {
                      "error": "agent_runtime_unavailable"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/models": {
      "get": {
        "operationId": "getModels",
        "summary": "List the models available for agents",
        "description": "Lists models from the OpenRouter catalogue, using the workspace's own OpenRouter key when one is configured. Retired models and batch-only variants are left out. Results can be cached for up to ten minutes. If the catalogue cannot be reached, the response is still `200` with an empty `models` array.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Agents"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/agents#get-models"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object `{ models }`. Each model has `id`, `name`, `contextLength` (a number, or null when the catalogue lists none), `promptPrice`, `completionPrice` and `deprecatesAt`. The prices are the catalogue's listed prices converted to numbers (OpenRouter lists US dollars per token), or null when the catalogue lists none. `deprecatesAt` is the date on which the catalogue says a model is due to be retired, or null.",
            "content": {
              "application/json": {
                "example": {
                  "models": [
                    {
                      "id": "example-lab/example-chat-1",
                      "name": "Example Chat 1",
                      "contextLength": 128000,
                      "promptPrice": 1.5e-7,
                      "completionPrice": 6e-7,
                      "deprecatesAt": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/run": {
      "post": {
        "operationId": "postRun",
        "summary": "Run an agent once and return the finished answer",
        "description": "Runs the prompt and responds when the agent has finished; the request can take up to 60 seconds. An agent with connections can call its tools for up to five model rounds, and every tool call is decided on its own before it is sent. This operation cannot wait for human approval: a tool call that needs approval is refused while the rest of the run continues, and the response names the refused tools in `approvalRequired`. Use `POST /api/run/job` for agents whose actions need approval or more time.\n\n**Access:** API key with the `run` scope, or a signed-in workspace member. An activated agent also needs the launch headers `X-CoA-Agent-Protocol` and `X-CoA-Agent-Ticket`.",
        "tags": [
          "Runs and conversations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/runs#post-run"
        },
        "security": [
          {
            "ApiKey": [
              "run"
            ]
          }
        ],
        "x-coa-scope": "run",
        "parameters": [
          {
            "name": "X-CoA-Model-Request",
            "in": "header",
            "required": false,
            "description": "The current Unix time in milliseconds (13 digits), a dot and a UUID that you generate, for example `1795857400000.5f0c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11`; it identifies the request for usage accounting. Send it on every request: without it a run that reaches a model call is refused with `503 model_usage_request_identity_required` before the model is called, and a malformed value or one more than 24 hours old is not accepted either. Use one value per intended run and keep it when you send the same request again; see [The usage-request header](https://centerofagentic.com/docs/guides/troubleshooting#usage-request-header).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-CoA-Agent-Protocol",
            "in": "header",
            "required": false,
            "description": "Required when the agent is under managed activation (`grantLifecycle` is `managed`): without it the request is refused with `426 agent_protocol_required`. For an agent that is not under managed activation, sending it gets `409 agent_adoption_required`; a run without `agentId` ignores it. See [Launch tickets](https://centerofagentic.com/docs/api/agents#launch).",
            "schema": {
              "type": "string",
              "enum": [
                "agent-active-grants/1"
              ]
            }
          },
          {
            "name": "X-CoA-Agent-Ticket",
            "in": "header",
            "required": false,
            "description": "The `ticketId` returned by `POST /api/agent-runtime/ticket` for this exact body, with `purpose` set to `run`. Required when the agent is under managed activation: with the protocol header but without a ticket, the request is refused with `428 agent_launch_required`. A ticket starts one run; see [Launch tickets](https://centerofagentic.com/docs/api/agents#launch).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "The instruction or question for the agent. It must contain more than whitespace."
                  },
                  "agentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The agent to run. When omitted, the prompt runs without an agent: no agent instructions, skills, knowledge or connections apply."
                  },
                  "model": {
                    "type": "string",
                    "description": "Model id for this run. Defaults to the agent's configured model, then the workspace default model. For an activated agent the model must be one that its active version allows; otherwise the run is refused."
                  }
                },
                "required": [
                  "prompt"
                ]
              },
              "example": {
                "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                "prompt": "Which supplier contracts renew next quarter?"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`200` with `{ output, reasonCode, decision, receipt }`. `decision` is `allow` or `deny`; a denied run has an empty `output`, and `detail` explains a budget or model-call refusal. Runs that used connections add `toolLog`, `connectionsUsed`, `toolsAvailable` and `errors`, plus `approvalRequired` and `detail` when a tool call needed approval. `receipt` is the run receipt as first written: its `assuranceTier` and `evidenceClass` are recorded immediately afterwards and appear when the receipt is read later. A repeated request whose launch ticket was already used does not run again: it answers `200` with the JSON body `{ replayed: true, root: { id, status } }`.",
            "content": {
              "application/json": {
                "example": {
                  "output": "Three contracts renew next quarter. The largest is the logistics agreement.",
                  "reasonCode": "ALLOWED",
                  "decision": "allow",
                  "receipt": {
                    "id": "b84d1f02-6c3a-4e19-a7d5-2f0c9e3b6a48",
                    "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                    "agentName": null,
                    "userId": "api-key:5b0e7c2a-9d14-4f6b-8a3e-2c1d0f9e8b77",
                    "prompt": "Which supplier contracts renew next quarter?",
                    "output": "Three contracts renew next quarter. The largest is the logistics agreement.",
                    "model": "openai/gpt-4o-mini",
                    "runtimeMode": "hybrid",
                    "decision": {
                      "action": "recommend",
                      "object": {
                        "dataClass": "internal"
                      },
                      "placement_requested": "cloud_model",
                      "evaluated_at": "2026-11-20T09:14:02.118Z",
                      "policy_bundle_id": "tenant-policy-7c1d2e3f",
                      "decision": "allow",
                      "reason_code": "ALLOWED",
                      "applicable_allowlist_layers": [
                        "tenant_admin",
                        "package_manifest",
                        "role_team",
                        "user_identity"
                      ],
                      "allow_rules_matched": [
                        "allow_tenant_admin_1",
                        "allow_package_manifest_2",
                        "allow_role_team_3",
                        "allow_user_identity_4"
                      ],
                      "allowlist_layers_missing_grant": [],
                      "deny_rules_matched": [],
                      "obligations": [
                        {
                          "kind": "logging",
                          "layer": "law_regulation",
                          "ruleId": "obl_logging_8",
                          "reason": "audit_all_runs"
                        },
                        {
                          "kind": "confidence_label",
                          "layer": "package_manifest",
                          "ruleId": "obl_confidence_label_9",
                          "reason": "label_confidence"
                        }
                      ],
                      "surviving_placements": [
                        "local",
                        "cloud_model",
                        "cloud_connector",
                        "cloud_connector_write"
                      ]
                    },
                    "policyResults": [
                      {
                        "policy": "tenant-policy-7c1d2e3f applied",
                        "result": "passed"
                      },
                      {
                        "policy": "logging",
                        "result": "passed"
                      },
                      {
                        "policy": "confidence_label",
                        "result": "passed"
                      }
                    ],
                    "placements": [
                      "local",
                      "cloud_model",
                      "cloud_connector",
                      "cloud_connector_write"
                    ],
                    "promptTokens": 412,
                    "completionTokens": 96,
                    "costUsd": 0.00012,
                    "latencyMs": 1840,
                    "guardrailsPassed": true,
                    "rawUploaded": false,
                    "toolLog": [],
                    "connectionsUsed": [],
                    "steps": [
                      {
                        "step_id": "policy",
                        "kind": "policy_decision",
                        "label": "Authority & placement check",
                        "status": "ok",
                        "placement": "local",
                        "reason_code": "ALLOWED",
                        "policy": {
                          "decision": "allow",
                          "reason_code": "ALLOWED",
                          "deny_rules_matched": [],
                          "obligations": [
                            {
                              "kind": "logging",
                              "layer": "law_regulation",
                              "ruleId": "obl_logging_8",
                              "reason": "audit_all_runs"
                            },
                            {
                              "kind": "confidence_label",
                              "layer": "package_manifest",
                              "ruleId": "obl_confidence_label_9",
                              "reason": "label_confidence"
                            }
                          ]
                        },
                        "seq": 0
                      },
                      {
                        "step_id": "model-d17a5c3e-8b40-4f92-a6c1-9e0f2b4d7a85",
                        "seq": 1,
                        "kind": "model_call",
                        "placement": "cloud_model",
                        "label": "Cloud reasoning turn",
                        "status": "ok",
                        "started_at": "2026-11-20T09:14:02.305Z",
                        "evidence": {
                          "decisionId": "d17a5c3e-8b40-4f92-a6c1-9e0f2b4d7a85",
                          "operationDigest": "4b1e0c7a9d2f63580e1a7c4d9b20f6e35a8c1d7e0f92b4a6c3d5e8f10a2b7c94",
                          "dispatch": "recorded",
                          "invoked": true,
                          "outcome": "ok",
                          "recording": "complete",
                          "reconciliationId": null,
                          "startedAt": "2026-11-20T09:14:02.305Z",
                          "tokens": {
                            "input": 412,
                            "output": 96
                          },
                          "costUsd": 0.00012
                        },
                        "tokens": {
                          "input": 412,
                          "output": 96
                        },
                        "cost": {
                          "amount": 0.00012
                        }
                      }
                    ],
                    "assistant": null,
                    "assuranceTier": null,
                    "evidenceClass": null,
                    "signatureStatus": null,
                    "flagged": false,
                    "evidenceIncomplete": false,
                    "reconciliationIds": [],
                    "createdAt": "2026-11-20T09:14:04.151Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "`missing_prompt`: `prompt` is missing, not a string, or only whitespace.\n\n`no_model_key`: The workspace has no model provider key saved in Settings.\n\n`no_model`: No model was given, the agent has none, and the workspace has no default model.\n\n`batch_model_not_supported`: The selected model is a batch-only model, which cannot be used for a live run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missing_prompt": {
                    "value": {
                      "error": "missing_prompt"
                    }
                  },
                  "no_model_key": {
                    "value": {
                      "error": "no_model_key"
                    }
                  },
                  "no_model": {
                    "value": {
                      "error": "no_model"
                    }
                  },
                  "batch_model_not_supported": {
                    "value": {
                      "error": "batch_model_not_supported"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "description": "`spend_reservation_refused`: The budget reservation for the model call was refused. The model was not called.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "spend_reservation_refused": {
                    "value": {
                      "error": "spend_reservation_refused"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: `agentId` does not match an agent in the workspace. The code is `agent_not_found` when the request carries the `X-CoA-Agent-Protocol` header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`agent_admission_unavailable`: The agent has no active version, is paused or revoked, or the ticket has expired or does not match this agent, operation and request body.\n\n`agent_adoption_required`: The protocol header was sent for an agent that is not under managed activation.\n\n`spend_reservation_refused`: The budget state changed, conflicted or expired while the run was being admitted. The model was not called.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_admission_unavailable": {
                    "value": {
                      "error": "agent_admission_unavailable"
                    }
                  },
                  "agent_adoption_required": {
                    "value": {
                      "error": "agent_adoption_required"
                    }
                  },
                  "spend_reservation_refused": {
                    "value": {
                      "error": "spend_reservation_refused"
                    }
                  }
                }
              }
            }
          },
          "426": {
            "description": "`agent_protocol_required`: The agent must be launched with the `X-CoA-Agent-Protocol` header and the header is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_protocol_required": {
                    "value": {
                      "error": "agent_protocol_required"
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "`agent_launch_required`: The protocol header is present but `X-CoA-Agent-Ticket` is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_launch_required": {
                    "value": {
                      "error": "agent_launch_required"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "`model_call_failed`: The call to the model provider failed. The body carries `detail` and `evidence`; do not assume the call was not made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "model_call_failed": {
                    "value": {
                      "error": "model_call_failed"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`spend_reservation_refused`: The budget state cannot be verified right now. The model was not called.\n\n`model_usage_request_identity_required`: The request has no `X-CoA-Model-Request` header. The model was not called.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "spend_reservation_refused": {
                    "value": {
                      "error": "spend_reservation_refused"
                    }
                  },
                  "model_usage_request_identity_required": {
                    "value": {
                      "error": "model_usage_request_identity_required"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/run/stream": {
      "post": {
        "operationId": "postRunStream",
        "summary": "Run an agent once and stream the answer as server-sent events",
        "description": "Takes the same body as `POST /api/run`. For an agent with connections the tool rounds run first and the whole answer arrives in a single `delta` event. A run that policy refuses produces `meta` with `decision` set to `deny`, followed by `done` with an empty `output` and the receipt. Always send the `X-CoA-Model-Request` header: on this operation a request without it is not answered with `503`; the stream can open, send `meta` and then close without `done` or `error`.\n\n**Access:** API key with the `run` scope, or a signed-in workspace member. An activated agent also needs the launch headers `X-CoA-Agent-Protocol` and `X-CoA-Agent-Ticket`, with the ticket's `purpose` set to `run_stream`.",
        "tags": [
          "Runs and conversations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/runs#post-run-stream"
        },
        "security": [
          {
            "ApiKey": [
              "run"
            ]
          }
        ],
        "x-coa-scope": "run",
        "parameters": [
          {
            "name": "X-CoA-Model-Request",
            "in": "header",
            "required": false,
            "description": "The current Unix time in milliseconds (13 digits), a dot and a UUID that you generate; it identifies the request for usage accounting. Send it on every request: without it this operation does not answer with an error status; the stream can open, send `meta` and then stall or close without `done` or `error`, and no model is called. Use one value per intended run and keep it when you send the same request again; see [The usage-request header](https://centerofagentic.com/docs/guides/troubleshooting#usage-request-header).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-CoA-Agent-Protocol",
            "in": "header",
            "required": false,
            "description": "Required when the agent is under managed activation (`grantLifecycle` is `managed`): without it the request is refused with `426 agent_protocol_required`. For an agent that is not under managed activation, sending it gets `409 agent_adoption_required`; a run without `agentId` ignores it. See [Launch tickets](https://centerofagentic.com/docs/api/agents#launch).",
            "schema": {
              "type": "string",
              "enum": [
                "agent-active-grants/1"
              ]
            }
          },
          {
            "name": "X-CoA-Agent-Ticket",
            "in": "header",
            "required": false,
            "description": "The `ticketId` returned by `POST /api/agent-runtime/ticket` for this exact body, with `purpose` set to `run_stream`. Required when the agent is under managed activation: with the protocol header but without a ticket, the request is refused with `428 agent_launch_required`. A ticket starts one run; see [Launch tickets](https://centerofagentic.com/docs/api/agents#launch).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "The instruction or question for the agent. It must contain more than whitespace."
                  },
                  "agentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The agent to run. When omitted, the prompt runs without an agent."
                  },
                  "model": {
                    "type": "string",
                    "description": "Model id for this run. Defaults to the agent's configured model, then the workspace default model."
                  }
                },
                "required": [
                  "prompt"
                ]
              },
              "example": {
                "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                "prompt": "Which supplier contracts renew next quarter?"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A `text/event-stream` response with four event types. `meta` is sent first: `{ decision, reasonCode, model }`. `delta` is sent zero or more times: `{ text }`, the next fragment of the answer. `done` is sent last on a completed or refused run: `{ output, receipt }`, where `receipt` has the shape shown for `POST /api/run`, plus `decision`, `reasonCode` and `detail` when the run was refused after the stream opened, and `approvalRequired` and `detail` when tool calls needed approval. `error` is sent last on a failure: an object with `detail` and, where available, `error` (a code such as `spend_reservation_refused` or `batch_model_not_supported`) and `evidence`. A repeated request whose launch ticket was already used is not streamed: it answers `200` with the JSON body `{ replayed: true, root: { id, status } }`.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {}
            }
          },
          "400": {
            "description": "`missing_prompt`: `prompt` is missing, not a string, or only whitespace.\n\n`no_model_key`: The workspace has no model provider key saved in Settings.\n\n`no_model`: No model was given, the agent has none, and the workspace has no default model.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missing_prompt": {
                    "value": {
                      "error": "missing_prompt"
                    }
                  },
                  "no_model_key": {
                    "value": {
                      "error": "no_model_key"
                    }
                  },
                  "no_model": {
                    "value": {
                      "error": "no_model"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: `agentId` does not match an agent in the workspace. The code is `agent_not_found` when the request carries the `X-CoA-Agent-Protocol` header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`agent_admission_unavailable`: The agent has no active version, is paused or revoked, or the ticket has expired or does not match this agent, operation and request body.\n\n`agent_adoption_required`: The protocol header was sent for an agent that is not under managed activation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_admission_unavailable": {
                    "value": {
                      "error": "agent_admission_unavailable"
                    }
                  },
                  "agent_adoption_required": {
                    "value": {
                      "error": "agent_adoption_required"
                    }
                  }
                }
              }
            }
          },
          "426": {
            "description": "`agent_protocol_required`: The agent must be launched with the `X-CoA-Agent-Protocol` header and the header is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_protocol_required": {
                    "value": {
                      "error": "agent_protocol_required"
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "`agent_launch_required`: The agent needs a launch ticket and `X-CoA-Agent-Ticket` is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_launch_required": {
                    "value": {
                      "error": "agent_launch_required"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/run/job": {
      "post": {
        "operationId": "postRunJob",
        "summary": "Start a resumable run, or continue one step by step",
        "description": "Send `{ agentId, prompt }` to start a job and `{ jobId }` to continue it. Each request advances the run by one time-boxed step of up to 60 seconds and returns its current `status`; keep sending `{ jobId }` while the status is `running`. When a tool call needs human approval the job stops at `pending_approval` and names the held tools in `heldActions`; once the approval is resolved, continue with the same `jobId`. Only one request advances a job at a time, so parallel requests cannot repeat a tool call.\n\n**Access:** API key with the `run` scope, or a signed-in workspace member. A job can be continued only by the credential that started it, or by a workspace admin signed in to the web workspace. Starting a job for an activated agent needs the launch headers with `purpose` set to `run_job`; continuing it needs only the `X-CoA-Agent-Protocol` header. For such an agent the `jobId` is the same value as the `X-CoA-Agent-Root` response header, and as `root.id` when a repeated start is answered with the replay body.",
        "tags": [
          "Runs and conversations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/runs#post-run-job"
        },
        "security": [
          {
            "ApiKey": [
              "run"
            ]
          }
        ],
        "x-coa-scope": "run",
        "parameters": [
          {
            "name": "X-CoA-Agent-Protocol",
            "in": "header",
            "required": false,
            "description": "Required to start and to continue a job when the agent is under managed activation (`grantLifecycle` is `managed`): without it the request is refused with `426 agent_protocol_required`. For an agent that is not under managed activation, sending it gets `409 agent_adoption_required`. See [Launch tickets](https://centerofagentic.com/docs/api/agents#launch).",
            "schema": {
              "type": "string",
              "enum": [
                "agent-active-grants/1"
              ]
            }
          },
          {
            "name": "X-CoA-Agent-Ticket",
            "in": "header",
            "required": false,
            "description": "The `ticketId` returned by `POST /api/agent-runtime/ticket` for the exact start body, with `purpose` set to `run_job`. Required to start a job when the agent is under managed activation: with the protocol header but without a ticket, the start is refused with `428 agent_launch_required`. Continuing a job with `{ jobId }` needs no ticket; see [Launch tickets](https://centerofagentic.com/docs/api/agents#launch).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Required to start a job. The agent to run; it must have at least one connection, unless it runs with Deep Agents delegation."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Required to start a job. The instruction for the agent; it must contain more than whitespace."
                  },
                  "jobId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The job to continue. When present, the request continues that job and `agentId` and `prompt` are ignored."
                  }
                }
              },
              "example": {
                "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                "prompt": "Draft the renewal reminder email for the logistics agreement."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`200` with the job state `{ jobId, status, output, rounds, chunks, toolLog }`. `status` is `running` (send `{ jobId }` again), `pending_approval`, `done` or `error`; an `error` response always has `jobId`, `status` and `error`, and adds `reasonCode`, `detail` and the other fields where known. The response of the step that reaches a state carries more: `heldActions` when the job stops for approval (the held tool names as they were offered to the model, with a connection prefix such as `c0__`), and `receipt`, `connectionsUsed` and `errors` when it finishes. Asking again for a job that is waiting for approval or has ended returns only `{ jobId, status, output, rounds, chunks, toolLog, error }`, so keep the `receipt` from the response that finishes the job. A run that is refused before it starts creates no job: the response is `{ status, decision, reasonCode, output, receipt }` with `status` set to `done`, `decision` set to `deny` and no `jobId`. Deep Agents runs add `rootJobId`, `activeLeafId`, `tree`, `treeBudget` and, once ended, `terminal`, and can also report the status `reconciliation_required`. A repeated start whose launch ticket was already used does not start another job: it answers `200` with the JSON body `{ replayed: true, root: { id, status } }`.",
            "content": {
              "application/json": {
                "example": {
                  "jobId": "9c2b7e41-3d5a-4f80-b6e2-1a0d9c8b7f36",
                  "status": "pending_approval",
                  "output": null,
                  "rounds": 2,
                  "chunks": 1,
                  "heldActions": [
                    "c0__create_email"
                  ],
                  "toolLog": [
                    {
                      "tool": "create_email",
                      "connection": "Marketing Cloud EU",
                      "ok": false,
                      "detail": "Held until approval is given.",
                      "decisionId": "a3e81b56-2c7d-4f09-9b14-6d5e0c8f7a23",
                      "outcome": "pending",
                      "reasonCode": "APPROVAL_REQUIRED",
                      "placement": "cloud_connector_write",
                      "modelDecisionId": "e2f4a6c8-1b3d-4e5f-8a7b-9c0d1e2f3a4b"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`missing_prompt`: Starting a job without a `prompt`.\n\n`missing_agent`: Starting a job without an `agentId`.\n\n`no_connections`: The agent has no connections and does not use delegation. Use `POST /api/run` for such an agent.\n\n`no_model_key`: The workspace has no model provider key saved in Settings.\n\n`no_model`: The agent has no model and the workspace has no default model.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missing_prompt": {
                    "value": {
                      "error": "missing_prompt"
                    }
                  },
                  "missing_agent": {
                    "value": {
                      "error": "missing_agent"
                    }
                  },
                  "no_connections": {
                    "value": {
                      "error": "no_connections"
                    }
                  },
                  "no_model_key": {
                    "value": {
                      "error": "no_model_key"
                    }
                  },
                  "no_model": {
                    "value": {
                      "error": "no_model"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "description": "`run_access_denied`: The job was started by another credential and the caller is not a workspace admin signed in to the web workspace.\n\nThe credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "run_access_denied": {
                    "value": {
                      "error": "run_access_denied"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: `agentId` does not match an agent in the workspace. The code is `agent_not_found` when the request carries the `X-CoA-Agent-Protocol` header.\n\n`run_not_found`: `jobId` does not match a job in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  },
                  "run_not_found": {
                    "value": {
                      "error": "run_not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`tree_runtime_unavailable`: The agent's active version enables Deep Agents delegation, but the delegation runtime is not switched on. It is a platform-wide switch that Center of Agentic controls.\n\n`agent_admission_unavailable`: The agent has no active version, is paused or revoked, or the ticket has expired or does not match this agent, operation and request body.\n\n`agent_adoption_required`: The protocol header was sent for an agent that is not under managed activation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "tree_runtime_unavailable": {
                    "value": {
                      "error": "tree_runtime_unavailable"
                    }
                  },
                  "agent_admission_unavailable": {
                    "value": {
                      "error": "agent_admission_unavailable"
                    }
                  },
                  "agent_adoption_required": {
                    "value": {
                      "error": "agent_adoption_required"
                    }
                  }
                }
              }
            }
          },
          "426": {
            "description": "`agent_protocol_required`: The agent must be launched with the `X-CoA-Agent-Protocol` header and the header is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_protocol_required": {
                    "value": {
                      "error": "agent_protocol_required"
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "`agent_launch_required`: Starting a job for an agent that needs a launch ticket without `X-CoA-Agent-Ticket`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_launch_required": {
                    "value": {
                      "error": "agent_launch_required"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "getRunJob",
        "summary": "Get the status of a resumable run",
        "description": "Returns the stored status of a job without advancing it. `managed` tells you whether continuing the job needs the `X-CoA-Agent-Protocol` header, and `deepAgents` whether the job runs with Deep Agents delegation and can be cancelled.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member. Only the credential that started the job can read it; a workspace admin signed in to the web workspace can read any job in the workspace.",
        "tags": [
          "Runs and conversations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/runs#get-run-job"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "jobId",
            "in": "query",
            "required": true,
            "description": "The job to look up.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ managed, deepAgents, status, rootId }`. `status` is the stored job status: `running`, `claimed` (a step is in progress), `blocked_on_child` (waiting for a sub-agent job), `pending_approval`, `done` or `error`. `rootId` identifies the launched run for an agent under managed activation and is `null` otherwise.",
            "content": {
              "application/json": {
                "example": {
                  "managed": true,
                  "deepAgents": false,
                  "status": "pending_approval",
                  "rootId": "9c2b7e41-3d5a-4f80-b6e2-1a0d9c8b7f36"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No job has this id in the workspace, or the job was started by another credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/run/job/cancel": {
      "post": {
        "operationId": "postRunJobCancel",
        "summary": "Stop a Deep Agents run and all of its sub-agent jobs",
        "description": "**Status: Gated.** Shipped, but closed until a switch is turned on; the Access note below says which.\n\nStops a run that uses Deep Agents delegation, including every sub-agent job that is still in progress; `jobId` can be the root job or any job of the run. Cancelling prevents further steps but does not undo an action that an external system has already received. It stays available after the agent has been revoked. Jobs without delegation cannot be cancelled with this operation and answer `404`.\n\n**Access:** API key with the `run` scope, or a signed-in workspace member. Only the credential that started the run, or a workspace admin signed in to the web workspace, can cancel it. It applies to Deep Agents runs only: delegation is off by default, is enabled per agent in a version that a workspace admin has reviewed and activated, and also needs the delegation runtime to be switched on, a platform-wide switch that Center of Agentic controls.",
        "tags": [
          "Runs and conversations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/runs#post-run-job-cancel"
        },
        "security": [
          {
            "ApiKey": [
              "run"
            ]
          }
        ],
        "x-coa-scope": "run",
        "x-coa-status": "gated",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jobId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The root job or any job of the run to stop."
                  }
                },
                "required": [
                  "jobId"
                ]
              },
              "example": {
                "jobId": "9c2b7e41-3d5a-4f80-b6e2-1a0d9c8b7f36"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`200` with the final state of the run: `{ jobId, rootJobId, status, treeBudget, activeLeafId, tree, output, rounds, toolLog }`, plus `receipt` when the run's receipt is available and `terminal`, which records how the run ended. A run that was still in progress ends with `status` set to `error` and `terminal.reason` set to `cancelled`.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`job_id_required`: `jobId` is missing or is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "job_id_required": {
                    "value": {
                      "error": "job_id_required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: The job does not exist, does not use Deep Agents delegation, or was started by another credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/conversations": {
      "get": {
        "operationId": "getConversations",
        "summary": "List your 50 most recently updated conversations",
        "description": "**Access:** API key with the `read` scope, or a signed-in workspace member. Returns only conversations created with the calling credential.",
        "tags": [
          "Runs and conversations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/runs#get-conversations"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ conversations }`: an array of at most 50 conversation objects, most recently updated first. There is no paging.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "postConversations",
        "summary": "Create a conversation",
        "description": "Creates an empty conversation owned by the calling credential. Messages are added by sending turns to `POST /api/conversations/{id}/run/stream` with the same credential, so an API key that creates conversations needs the `admin` scope here and then uses its `run` permission for the turns.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Runs and conversations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/runs#post-conversations"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The agent that answers in this conversation. When omitted, turns run without an agent, using the workspace default model."
                  },
                  "title": {
                    "type": "string",
                    "description": "A label for the conversation. Defaults to `New conversation`."
                  }
                }
              },
              "example": {
                "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                "title": "Contract renewals"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "`201` with the new conversation object `{ id, agentId, title, createdAt, updatedAt }`.",
            "content": {
              "application/json": {
                "example": {
                  "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                  "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                  "title": "Contract renewals",
                  "createdAt": "2026-11-20T09:13:40.000Z",
                  "updatedAt": "Fri Nov 20 2026 09:13:40 GMT+0000 (Coordinated Universal Time)"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/conversations/{id}": {
      "get": {
        "operationId": "getConversationsById",
        "summary": "Get a conversation with its messages",
        "description": "**Access:** API key with the `read` scope, or a signed-in workspace member. Only the credential that created the conversation can read it.",
        "tags": [
          "Runs and conversations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/runs#get-conversations-id"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The conversation id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ conversation, messages }`. `messages` holds every message, oldest first; each is `{ id, role, content, model, promptTokens, completionTokens, costUsd, latencyMs, decision, reasonCode, createdAt }`. `role` is `user` or `assistant`. On assistant messages `decision` is the policy decision recorded for that turn; the usage fields are `null` on user messages and on refused turns.",
            "content": {
              "application/json": {
                "example": {
                  "conversation": {
                    "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                    "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                    "title": "Contract renewals",
                    "createdAt": "2026-11-20T09:13:40.000Z",
                    "updatedAt": "Fri Nov 20 2026 09:14:04 GMT+0000 (Coordinated Universal Time)"
                  },
                  "messages": [
                    {
                      "id": "0e6b3d58-9f21-4c7a-b1e4-5d2a8c7f9b60",
                      "role": "user",
                      "content": "Which supplier contracts renew next quarter?",
                      "model": null,
                      "promptTokens": null,
                      "completionTokens": null,
                      "costUsd": null,
                      "latencyMs": null,
                      "decision": null,
                      "reasonCode": null,
                      "createdAt": "2026-11-20T09:14:02.050Z"
                    },
                    {
                      "id": "c5d09a77-1e42-4b6f-9d03-8a7b6c5d4e21",
                      "role": "assistant",
                      "content": "Three contracts renew next quarter. The largest is the logistics agreement.",
                      "model": "openai/gpt-4o-mini",
                      "promptTokens": 412,
                      "completionTokens": 96,
                      "costUsd": 0.00012,
                      "latencyMs": 1840,
                      "decision": {
                        "action": "recommend",
                        "object": {
                          "dataClass": "internal"
                        },
                        "placement_requested": "cloud_model",
                        "evaluated_at": "2026-11-20T09:14:02.118Z",
                        "policy_bundle_id": "tenant-policy-7c1d2e3f",
                        "decision": "allow",
                        "reason_code": "ALLOWED",
                        "applicable_allowlist_layers": [
                          "tenant_admin",
                          "package_manifest",
                          "role_team",
                          "user_identity"
                        ],
                        "allow_rules_matched": [
                          "allow_tenant_admin_1",
                          "allow_package_manifest_2",
                          "allow_role_team_3",
                          "allow_user_identity_4"
                        ],
                        "allowlist_layers_missing_grant": [],
                        "deny_rules_matched": [],
                        "obligations": [
                          {
                            "kind": "logging",
                            "layer": "law_regulation",
                            "ruleId": "obl_logging_8",
                            "reason": "audit_all_runs"
                          },
                          {
                            "kind": "confidence_label",
                            "layer": "package_manifest",
                            "ruleId": "obl_confidence_label_9",
                            "reason": "label_confidence"
                          }
                        ],
                        "surviving_placements": [
                          "local",
                          "cloud_model",
                          "cloud_connector",
                          "cloud_connector_write"
                        ]
                      },
                      "reasonCode": "ALLOWED",
                      "createdAt": "2026-11-20T09:14:04.151Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No conversation has this id for the calling credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteConversationsById",
        "summary": "Delete a conversation and its messages",
        "description": "Deletes the conversation and all of its messages. Run receipts written for its turns are separate records and are not deleted.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member. Only the credential that created the conversation can delete it.",
        "tags": [
          "Runs and conversations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/runs#delete-conversations-id"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The conversation id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ ok: true }`.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No conversation has this id for the calling credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/conversations/{id}/run/stream": {
      "post": {
        "operationId": "postConversationsByIdRunStream",
        "summary": "Send a message in a conversation and stream the reply",
        "description": "Runs one turn with the conversation's agent and writes a run receipt for it. Sending the same `X-CoA-Model-Request` value with the same body again does not call the model a second time: a completed reply is returned as a single `done` event with `replayed` set to `true`, and an unfinished one answers `409`. A repeat that also reuses its launch ticket is answered before that check, with the JSON replay body instead of a `done` event; see [After a replayed response](https://centerofagentic.com/docs/guides/automation#after-a-replay). For an activated agent, request the launch ticket with `purpose` set to `conversation`, `parentScope` set to the conversation id and `request` set to this body.\n\n**Access:** API key with the `run` scope, or a signed-in workspace member. Only the credential that created the conversation can send turns to it. An activated agent also needs the launch headers `X-CoA-Agent-Protocol` and `X-CoA-Agent-Ticket`.",
        "tags": [
          "Runs and conversations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/runs#post-conversations-id-run-stream"
        },
        "security": [
          {
            "ApiKey": [
              "run"
            ]
          }
        ],
        "x-coa-scope": "run",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The conversation id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CoA-Model-Request",
            "in": "header",
            "required": false,
            "description": "The current Unix time in milliseconds (13 digits), a dot and a UUID that you generate; it identifies the turn for usage accounting. Send it on every turn: a turn without it, or with a malformed value, is refused with `503 model_usage_request_identity_required`, and nothing is saved or sent to the model. Use one value per intended turn and keep it when you send the same turn again; see [The usage-request header](https://centerofagentic.com/docs/guides/troubleshooting#usage-request-header).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-CoA-Agent-Protocol",
            "in": "header",
            "required": false,
            "description": "Required when the conversation's agent is under managed activation (`grantLifecycle` is `managed`): without it the request is refused with `426 agent_protocol_required`. For an agent that is not under managed activation, sending it gets `409 agent_adoption_required`; a conversation without an agent ignores it. See [Launch tickets](https://centerofagentic.com/docs/api/agents#launch).",
            "schema": {
              "type": "string",
              "enum": [
                "agent-active-grants/1"
              ]
            }
          },
          {
            "name": "X-CoA-Agent-Ticket",
            "in": "header",
            "required": false,
            "description": "The `ticketId` returned by `POST /api/agent-runtime/ticket` for this exact body, with `purpose` set to `conversation` and `parentScope` set to the conversation id. Required for every turn when the conversation's agent is under managed activation: with the protocol header but without a ticket, the turn is refused with `428 agent_launch_required`. A ticket starts one turn; see [Launch tickets](https://centerofagentic.com/docs/api/agents#launch).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "The user message for this turn. It must contain more than whitespace."
                  }
                },
                "required": [
                  "prompt"
                ]
              },
              "example": {
                "prompt": "Which supplier contracts renew next quarter?"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A `text/event-stream` response. `meta` is sent first: `{ decision, reasonCode, model }`. `delta` carries `{ text }`, the next fragment of the reply. `done` is sent last: `{ message, steps, receiptId }`, where `message` is the saved assistant message in the shape used by `GET /api/conversations/{id}`, `steps` is the step timeline of the run (the shape of `receipt.steps` shown for `POST /api/run`) and `receiptId` identifies its run receipt (omitted when the turn was refused for a revoked agent or an exhausted budget). `done` adds `decision`, `reasonCode` and `detail` when a model call was refused, `approvalRequired` and `detail` when tool calls needed approval, and `replayed` on a replayed turn, which sends no `meta` event and an empty `steps` array. `error` is sent last on a failure: an object with `detail` and, where available, `error` and `evidence`. A repeated turn whose launch ticket was already used is not streamed: it answers `200` with the JSON body `{ replayed: true, root: { id, status } }`.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {}
            }
          },
          "400": {
            "description": "`missing_prompt`: `prompt` is missing, not a string, or only whitespace.\n\n`no_model_key`: The workspace has no model provider key saved in Settings.\n\n`no_model`: The agent has no model and the workspace has no default model.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missing_prompt": {
                    "value": {
                      "error": "missing_prompt"
                    }
                  },
                  "no_model_key": {
                    "value": {
                      "error": "no_model_key"
                    }
                  },
                  "no_model": {
                    "value": {
                      "error": "no_model"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`conversation_not_found`: No conversation has this id for the calling credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "conversation_not_found": {
                    "value": {
                      "error": "conversation_not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`model_usage_conversation_reconciliation_required`: This turn was already registered with the same `X-CoA-Model-Request` value and its reply is incomplete. The body carries `turnId`; the turn was not sent to the model again.\n\n`agent_admission_unavailable`: The agent has no active version, is paused or revoked, or the ticket has expired or does not match this agent, operation and request body.\n\n`agent_adoption_required`: The protocol header was sent for an agent that is not under managed activation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "model_usage_conversation_reconciliation_required": {
                    "value": {
                      "error": "model_usage_conversation_reconciliation_required"
                    }
                  },
                  "agent_admission_unavailable": {
                    "value": {
                      "error": "agent_admission_unavailable"
                    }
                  },
                  "agent_adoption_required": {
                    "value": {
                      "error": "agent_adoption_required"
                    }
                  }
                }
              }
            }
          },
          "426": {
            "description": "`agent_protocol_required`: The agent must be launched with the `X-CoA-Agent-Protocol` header and the header is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_protocol_required": {
                    "value": {
                      "error": "agent_protocol_required"
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "`agent_launch_required`: The conversation's agent needs a launch ticket and `X-CoA-Agent-Ticket` is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "agent_launch_required": {
                    "value": {
                      "error": "agent_launch_required"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`model_usage_request_identity_required`: The `X-CoA-Model-Request` header is missing or malformed. Nothing was saved or sent to the model.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "model_usage_request_identity_required": {
                    "value": {
                      "error": "model_usage_request_identity_required"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/receipts": {
      "get": {
        "operationId": "getReceipts",
        "summary": "List run receipts, newest first, with filters and keyset paging",
        "description": "Returns the workspace's receipts ordered by creation time, newest first. Filters apply to the whole receipt history of the workspace, not only to the returned page. To fetch the next page, pass the `createdAt` and `id` of the last receipt you received as `createdBefore` and `beforeId`. When the calling key can also make this read over MCP, the request counts against the same rate limit as its MCP calls; see [rate limits](https://centerofagentic.com/docs/reference/rate-limits).\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Receipts, approvals and audit"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/receipts#get-receipts"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": false,
            "description": "Only receipts of this agent.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "description": "Only receipts whose `userId` equals this value exactly.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "decision",
            "in": "query",
            "required": false,
            "description": "Only receipts with this policy outcome. A receipt without a recorded decision counts as `deny` when its guardrails did not pass and as `allow` otherwise.",
            "schema": {
              "type": "string",
              "enum": [
                "allow",
                "deny"
              ]
            }
          },
          {
            "name": "reasonCode",
            "in": "query",
            "required": false,
            "description": "Only receipts whose decision carries this reason code, for example `ALLOWED`, `DEFAULT_DENY` or `PKG_REVOKED`. When the decision has no reason code, the name of the first failed policy result is compared instead.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "placement",
            "in": "query",
            "required": false,
            "description": "Only receipts whose `placements` include this value.",
            "schema": {
              "type": "string",
              "enum": [
                "local",
                "cloud_model",
                "cloud_connector",
                "cloud_connector_write",
                "local_sandbox",
                "cloud_sandbox",
                "local_capture",
                "external_mcp_host"
              ]
            }
          },
          {
            "name": "dataClass",
            "in": "query",
            "required": false,
            "description": "Only receipts with at least one step recorded under this data class.",
            "schema": {
              "type": "string",
              "enum": [
                "public",
                "internal",
                "confidential",
                "restricted",
                "secrets"
              ]
            }
          },
          {
            "name": "connector",
            "in": "query",
            "required": false,
            "description": "Only receipts whose `connectionsUsed` include this connection name. The match is exact and case-sensitive.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "obligation",
            "in": "query",
            "required": false,
            "description": "Only receipts flagged with this obligation: held for approval, redaction applied, or logging enabled.",
            "schema": {
              "type": "string",
              "enum": [
                "pending_approval",
                "redaction",
                "logging"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free-text search: a case-insensitive substring match over the agent name, the prompt and the output. Wildcard characters are matched literally.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size. A whole number of at least 1; the default is 100 and values above 200 are reduced to 200.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "createdBefore",
            "in": "query",
            "required": false,
            "description": "Paging cursor: only receipts created strictly before this date-time. Pass the `createdAt` of the last receipt of the previous page. `createdAt` is returned with millisecond precision, so a receipt written within the same millisecond as that last receipt can be left out of the next page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beforeId",
            "in": "query",
            "required": false,
            "description": "Tie-breaker for receipts that share the cursor timestamp: the `id` of the last receipt of the previous page. Requires `createdBefore`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ receipts, total, hasMore }`. `receipts` is the page of receipt objects (see the single-receipt operation for the fields). `total` is the number of receipts matching the filters across the workspace, ignoring the paging cursor. `hasMore` is `true` when older matches exist beyond this page.",
            "content": {
              "application/json": {
                "example": {
                  "receipts": [
                    {
                      "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "agentId": "8b0e6c1d-52a4-4f0b-9c3e-7a1d2e4f6a90",
                      "agentName": "Example support agent",
                      "userId": "user_example123",
                      "prompt": "Summarise ticket 1042 for the weekly report.",
                      "output": "Ticket 1042 concerns a delayed delivery; a replacement was shipped.",
                      "model": "example-provider/example-model",
                      "runtimeMode": "cloud_only",
                      "decision": {
                        "action": "summarize",
                        "object": {
                          "dataClass": "internal"
                        },
                        "placement_requested": "cloud_model",
                        "decision": "allow",
                        "reason_code": "ALLOWED",
                        "applicable_allowlist_layers": [
                          "tenant_admin",
                          "package_manifest",
                          "role_team",
                          "user_identity"
                        ],
                        "allow_rules_matched": [
                          "allow_tenant_admin_1",
                          "allow_package_manifest_2",
                          "allow_role_team_3",
                          "allow_user_identity_4"
                        ],
                        "allowlist_layers_missing_grant": [],
                        "deny_rules_matched": [],
                        "obligations": [
                          {
                            "kind": "logging",
                            "layer": "law_regulation",
                            "ruleId": "obl_logging_8",
                            "reason": "audit_all_runs"
                          }
                        ],
                        "surviving_placements": [
                          "cloud_model"
                        ],
                        "evaluated_at": "2026-11-20T09:14:05.102Z",
                        "policy_bundle_id": "tenant-policy-5d2c7e10"
                      },
                      "policyResults": [
                        {
                          "policy": "tenant-policy-5d2c7e10 applied",
                          "result": "passed"
                        },
                        {
                          "policy": "logging",
                          "result": "passed"
                        }
                      ],
                      "placements": [
                        "cloud_model"
                      ],
                      "promptTokens": 412,
                      "completionTokens": 96,
                      "costUsd": 0.0031,
                      "latencyMs": 1840,
                      "guardrailsPassed": true,
                      "rawUploaded": false,
                      "toolLog": [],
                      "connectionsUsed": [],
                      "steps": [
                        {
                          "step_id": "policy",
                          "kind": "policy_decision",
                          "label": "Authority & placement check",
                          "status": "ok",
                          "placement": "local",
                          "reason_code": "ALLOWED",
                          "policy": {
                            "decision": "allow",
                            "reason_code": "ALLOWED",
                            "deny_rules_matched": [],
                            "obligations": [
                              {
                                "kind": "logging",
                                "layer": "law_regulation",
                                "ruleId": "obl_logging_8",
                                "reason": "audit_all_runs"
                              }
                            ]
                          },
                          "seq": 0
                        },
                        {
                          "step_id": "model-6e2b4c8a-1f3d-4a5b-9c7e-0d1f2a3b4c5d",
                          "seq": 1,
                          "kind": "model_call",
                          "placement": "cloud_model",
                          "label": "Cloud reasoning turn",
                          "status": "ok",
                          "started_at": "2026-11-20T09:14:05.280Z",
                          "evidence": {
                            "decisionId": "6e2b4c8a-1f3d-4a5b-9c7e-0d1f2a3b4c5d",
                            "operationDigest": "0f3a9c5e7b1d2f4a6c8e0b2d4f6a8c0e1b3d5f7a9c1e3b5d7f9a1c3e5b7d9f1a",
                            "dispatch": "recorded",
                            "invoked": true,
                            "outcome": "ok",
                            "recording": "complete",
                            "reconciliationId": null,
                            "startedAt": "2026-11-20T09:14:05.280Z",
                            "tokens": {
                              "input": 412,
                              "output": 96
                            },
                            "costUsd": 0.0031
                          },
                          "tokens": {
                            "input": 412,
                            "output": 96
                          },
                          "cost": {
                            "amount": 0.0031
                          }
                        }
                      ],
                      "assistant": null,
                      "assuranceTier": 2,
                      "evidenceClass": "enforcement",
                      "signatureStatus": null,
                      "flagged": false,
                      "evidenceIncomplete": false,
                      "reconciliationIds": [],
                      "createdAt": "2026-11-20T09:14:07.120Z"
                    }
                  ],
                  "total": 42,
                  "hasMore": true
                }
              }
            }
          },
          "400": {
            "description": "`invalid_decision`: `decision` is not `allow` or `deny`.\n\n`invalid_placement`: `placement` is not one of the listed values.\n\n`invalid_dataClass`: `dataClass` is not one of the listed values.\n\n`invalid_obligation`: `obligation` is not one of the listed values.\n\n`invalid_limit`: `limit` is not a whole number of at least 1.\n\n`invalid_createdBefore`: `createdBefore` cannot be read as a date-time.\n\n`invalid_beforeId`: `beforeId` is not a UUID.\n\n`beforeId_requires_createdBefore`: `beforeId` is sent without `createdBefore`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_decision": {
                    "value": {
                      "error": "invalid_decision"
                    }
                  },
                  "invalid_placement": {
                    "value": {
                      "error": "invalid_placement"
                    }
                  },
                  "invalid_dataClass": {
                    "value": {
                      "error": "invalid_dataClass"
                    }
                  },
                  "invalid_obligation": {
                    "value": {
                      "error": "invalid_obligation"
                    }
                  },
                  "invalid_limit": {
                    "value": {
                      "error": "invalid_limit"
                    }
                  },
                  "invalid_createdBefore": {
                    "value": {
                      "error": "invalid_createdBefore"
                    }
                  },
                  "invalid_beforeId": {
                    "value": {
                      "error": "invalid_beforeId"
                    }
                  },
                  "beforeId_requires_createdBefore": {
                    "value": {
                      "error": "beforeId_requires_createdBefore"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/receipts/{id}": {
      "get": {
        "operationId": "getReceiptsById",
        "summary": "Get one run receipt by id",
        "description": "Returns a single receipt, however old it is. An id that does not exist, belongs to another workspace or is not a UUID gives the same `not_found` response. The same shared rate limit as the list applies when the calling key can also make this read over MCP.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Receipts, approvals and audit"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/receipts#get-receipts-id"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The receipt id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A receipt object: `id`, `agentId`, `agentName`, `userId`, `prompt`, `output`, `model`, `runtimeMode`, `decision` (the recorded policy decision), `policyResults`, `placements`, `promptTokens`, `completionTokens`, `costUsd`, `latencyMs`, `guardrailsPassed`, `rawUploaded`, `toolLog`, `connectionsUsed`, `steps`, `assistant`, `assuranceTier` (0, 1, 2 or `null`), `evidenceClass` (`enforcement`, `observation` or `null`), `signatureStatus` (`valid`, `invalid`, `absent` or `null`), `flagged`, `evidenceIncomplete`, `reconciliationIds` and `createdAt` (ISO 8601). `decision`, `policyResults`, `toolLog` and `steps` are returned as they were recorded, so their inner fields can differ between receipts. A receipt that belongs to a run tree also carries `parentRunId`, `rootRunId`, `depth`, `treeStatus`, `treeTerminalReason`, `treeNodeCount`, `directUsage`, `treeUsage`, `treeBoundaryProof` and `payloadErased`, and may carry `treeBudget`.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No receipt with this id exists in the workspace, or the id is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/receipts/{id}/tree": {
      "get": {
        "operationId": "getReceiptsByIdTree",
        "summary": "Get a receipt together with the other receipts of its run tree",
        "description": "When an agent delegates work to sub-agents, each sub-run writes its own receipt linked to the root run. This returns the root receipt and the receipts below it (at most 102), ordered by depth and then by creation time, wherever in the tree the given receipt sits. For a receipt that is not part of a tree, `receipts` holds only that receipt and `usage` is `null`.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Receipts, approvals and audit"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/receipts#get-receipts-id-tree"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The id of any receipt in the tree.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ rootReceiptId, receipts, usage, budget }`. `receipts` are receipt objects. `usage` holds the tree's current usage totals (known cost in USD, token counts and counts of unpriced or unknown entries), or `null` for a receipt outside a delegated run tree. `budget` describes the state of the tree's spend budget and is left out when the receipt does not belong to a delegated run tree.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No receipt with this id exists in the workspace, or the id is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/receipts/{id}/score": {
      "post": {
        "operationId": "postReceiptsByIdScore",
        "summary": "Run the governance checks for a receipt's agent and store the scores",
        "description": "Evaluates the built-in governance checks against the current authority level and data classes of the receipt's agent, and stores one pass or fail score for each of the dimensions `default_deny`, `manifest_ceiling` and `data_residency`, replacing earlier scores for the receipt. A failed score points at an agent configuration that permits more than it should; it is not a judgement of the recorded run. The request takes no body. If the receipt has no agent, or the agent no longer exists, the response is an empty list and nothing is changed.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Receipts, approvals and audit"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/receipts#post-receipts-id-score"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The receipt id. It must be a well-formed UUID; any other value produces a server error rather than `not_found`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ scores }`: one object per dimension with `id`, `receiptId`, `agentId`, `dimension`, `passed`, `detail` and `scoredAt` (a date-time string that is not guaranteed to be ISO 8601).",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No receipt with this id exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/receipts/{id}/score-output": {
      "post": {
        "operationId": "postReceiptsByIdScoreOutput",
        "summary": "Score the quality of a receipt's recorded output",
        "description": "Runs the selected rule-based checks on the receipt's output, which make no model call, and, when `judgeIds` are given, asks a model to grade it. Model judges use the workspace's own model credentials with the receipt's model, or the workspace default model when the receipt has none, and see at most 5,000 characters each of the prompt and the output. Each model judge is an accounted model call, so send the `X-CoA-Model-Request` header whenever you pass `judgeIds`: a judge that cannot run, for example because the header is missing, no model is configured, no reviewed system model profile allows it or the workspace's spend controls refuse the call, is reported in `judgeRefusals` and the request still succeeds. The result is stored with the receipt and noted in the audit log, but the receipt read operations do not return it.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member. Model judges call a model with the workspace's own model credentials and are subject to the workspace's spend controls. They run only when the workspace's reviewed system model profiles allow output judging with that model and receipts as a source, and only for receipts whose data classification can be established from the run's recorded decisions. A workspace has no such profile until a workspace admin adds one; until then every requested judge is refused.",
        "tags": [
          "Receipts, approvals and audit"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/receipts#post-receipts-id-score-output"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The receipt id. It must be a well-formed UUID; any other value produces a server error rather than `not_found`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CoA-Model-Request",
            "in": "header",
            "required": false,
            "description": "The current Unix time in milliseconds (13 digits), a dot and a UUID that you generate, new for each request; it identifies the request for usage accounting, and one value covers every judge in `judgeIds`. Send it whenever `judgeIds` asks for model judges: without it, each judge that a reviewed model profile would let through is refused before the model is called and is listed in `judgeRefusals` with the code `model_usage_request_identity_required`, while the response is still `200`. See [The usage-request header](https://centerofagentic.com/docs/guides/troubleshooting#usage-request-header).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "heuristics": {
                    "type": "object",
                    "description": "The rule-based checks to run. Each key turns one check on. When omitted, only `notEmpty` runs; when an object is sent, only the checks it turns on run.",
                    "properties": {
                      "notEmpty": {
                        "type": "boolean",
                        "description": "The output must contain something other than whitespace."
                      },
                      "validJson": {
                        "type": "boolean",
                        "description": "The output must parse as JSON."
                      },
                      "containsCitation": {
                        "type": "boolean",
                        "description": "The output must contain a citation marker."
                      },
                      "maxChars": {
                        "type": "number",
                        "description": "The output must be at most this many characters. Ignored unless it is a number greater than 0."
                      },
                      "mentionsAll": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "The output must mention every one of these keywords."
                      },
                      "noBannedTerms": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "The output must contain none of these terms."
                      }
                    }
                  },
                  "judgeIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Model judges to run: `correctness`, `groundedness` and `relevance`. At most the first four entries are used and unknown ids are skipped."
                  }
                }
              },
              "example": {
                "heuristics": {
                  "notEmpty": true
                },
                "judgeIds": [
                  "relevance"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`{ scores, passed, meanScore, judgesRun, judgeRefusals, heuristicCount }`. Each score has `evaluatorId`, `passed`, `score` (0 to 1) and `detail`. `passed` is `true` when every score passed, `meanScore` is the average score, `judgesRun` lists the judges that completed and `judgeRefusals` lists the requested judges that were refused or failed, each with `judgeId`, `code`, `status`, `invoked` (whether a model call was attempted) and `decisionId`. With no scores at all, `passed` is `true` and `meanScore` is 1.",
            "content": {
              "application/json": {
                "example": {
                  "scores": [
                    {
                      "evaluatorId": "notEmpty",
                      "passed": true,
                      "score": 1,
                      "detail": "Output is non-empty."
                    },
                    {
                      "evaluatorId": "relevance",
                      "passed": true,
                      "score": 0.9,
                      "detail": "The output answers the prompt directly."
                    }
                  ],
                  "passed": true,
                  "meanScore": 0.95,
                  "judgesRun": [
                    "relevance"
                  ],
                  "judgeRefusals": [],
                  "heuristicCount": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No receipt with this id exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/receipts/{id}/annotations": {
      "get": {
        "operationId": "getReceiptsByIdAnnotations",
        "summary": "List the annotations on a receipt with an agreement summary",
        "description": "Returns every reviewer's verdict on the receipt, newest first, and a summary of how far the reviewers agree. A receipt without annotations gives an empty list, and so does an id that matches no receipt in the workspace; this operation does not return `not_found`.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Receipts, approvals and audit"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/receipts#get-receipts-id-annotations"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The receipt id. It must be a well-formed UUID; any other value produces a server error rather than `not_found`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ annotations, agreement }`. Each annotation has `id`, `receiptId`, `agentId`, `verdict`, `dimension`, `correctedExpectation`, `note`, `annotatedBy` and `annotatedAt` (a date-time string that is not guaranteed to be ISO 8601). `agreement` is `{ total, correct, incorrect, unsure, correctnessRate, byDimension }`, where `correctnessRate` is correct divided by correct plus incorrect, or `null` when no reviewer gave a decisive verdict, and `byDimension` holds the same three counts for each `dimension` value that was used.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "postReceiptsByIdAnnotations",
        "summary": "Record or replace the caller's verdict on a receipt",
        "description": "Stores the verdict under the calling identity. For an API key that identity is the key itself, so repeated calls with the same key update one annotation. An `incorrect` verdict can be saved without `correctedExpectation`.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member. The annotation is attributed to the calling identity: the signed-in user, or the API key.",
        "tags": [
          "Receipts, approvals and audit"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/receipts#post-receipts-id-annotations"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The receipt id. It must be a well-formed UUID; any other value produces a server error rather than `not_found`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "verdict": {
                    "type": "string",
                    "enum": [
                      "correct",
                      "incorrect",
                      "unsure"
                    ],
                    "description": "Whether the recorded policy decision was right."
                  },
                  "dimension": {
                    "type": "string",
                    "description": "The governance dimension the verdict is about, for example `default_deny`, `manifest_ceiling`, `data_residency`, `connector_scope`, `approval_required` or `obligations`. Stored as sent."
                  },
                  "correctedExpectation": {
                    "type": "object",
                    "description": "What the decision should have been, as JSON. Stored as sent."
                  },
                  "note": {
                    "type": "string",
                    "description": "A free-text comment."
                  }
                },
                "required": [
                  "verdict"
                ]
              },
              "example": {
                "verdict": "incorrect",
                "dimension": "data_residency",
                "note": "Restricted data should not have been sent to a cloud model."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "`201` with the stored annotation: `id`, `receiptId`, `agentId`, `verdict`, `dimension`, `correctedExpectation`, `note`, `annotatedBy` and `annotatedAt` (a date-time string that is not guaranteed to be ISO 8601). A call that replaces your earlier verdict answers `201` as well.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`invalid_verdict`: `verdict` is missing or is not `correct`, `incorrect` or `unsure`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_verdict": {
                    "value": {
                      "error": "invalid_verdict"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No receipt with this id exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/approvals": {
      "get": {
        "operationId": "getApprovals",
        "summary": "List operations held for human approval",
        "description": "Returns every hold that has not expired, ordered by the start of the paused run with the newest first, with one entry per held operation; the list is not paged. `jobId` identifies the paused run and `callId` the held operation within it. `expiresAt` is when the hold lapses (24 hours after it began by default); an expired hold is left out and its operation is not run. `canApprove` and `canDeny` say what the calling identity may do and are always `false` for an API key.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member. Listing only. Approving or denying a held operation requires a workspace admin signed in to the web workspace.",
        "tags": [
          "Receipts, approvals and audit"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/receipts#get-approvals"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ approvals }`: one object per held operation with `jobId`, `callId`, `agentName`, `action` (the name of the held tool call), `createdAt` (when the paused run started), `expiresAt`, `youRequested`, `canApprove`, `canDeny` and `approveBlockedReason` (a sentence explaining why the caller cannot approve, or `null`). `callId` is `null` for a hold that is not bound to a single operation; such a hold can only be denied. Holds inside a delegated run tree also carry `rootJobId`, `parentJobId`, `depth` and `delegatedScope`, and may carry `delegationProposal` and `treeBudget`.",
            "content": {
              "application/json": {
                "example": {
                  "approvals": [
                    {
                      "jobId": "b7a4d2f0-3c1e-4a8b-9d6f-2e5c8a1b4d73",
                      "agentName": "Example support agent",
                      "createdAt": "2026-11-27T14:02:11.000Z",
                      "expiresAt": "2026-11-28T14:02:11.000Z",
                      "youRequested": false,
                      "canDeny": false,
                      "callId": "call_0a1b2c3d",
                      "action": "send_email",
                      "canApprove": false,
                      "approveBlockedReason": "API keys cannot approve or deny held operations; an organization admin must, in the Review Queue."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/audit": {
      "get": {
        "operationId": "getAudit",
        "summary": "List the 100 most recent audit log entries",
        "description": "Returns the newest 100 entries of the workspace. The operation takes no filter or paging parameters, so older entries cannot be reached through it. `userId` is the acting identity: a user id, `api-key:` followed by the key id for calls made with a key, or `null` for actions taken by the platform.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Receipts, approvals and audit"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/receipts#get-audit"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ entries, chain }`. Each entry has `id`, `userId`, `action`, `targetType` and `targetId` (both `null` when the action has no target), `detail` (an object that depends on the action), `createdAt` (ISO 8601) and `chainSeq` (a number, or `null` for an entry that is not part of the chain). `chain` is `{ anchorSeq, headSeq, chainedAt }`, or `null` when the workspace has no chained entries yet. Entries with a `chainSeq` at or below `anchorSeq` are not covered by chain verification.",
            "content": {
              "application/json": {
                "example": {
                  "entries": [
                    {
                      "id": "c2d9e1a4-7f3b-4c60-8a15-9e0b6d2f4a37",
                      "userId": "api-key:9a7c5e3b-1d2f-4b6a-8c0e-4f2a6b8d0c1e",
                      "action": "receipt.score_output",
                      "targetType": "receipt",
                      "targetId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "detail": {
                        "judgesRun": [
                          "relevance"
                        ],
                        "passed": true,
                        "meanScore": 0.95
                      },
                      "createdAt": "2026-11-27T14:10:42.318Z",
                      "chainSeq": 1284
                    }
                  ],
                  "chain": {
                    "anchorSeq": 310,
                    "headSeq": 1284,
                    "chainedAt": "2026-09-14 08:12:44.512345+00"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Return the identity and workspace behind the current credential",
        "description": "Use it to confirm that a key works and which workspace it belongs to. For an API key, `userId` is `api-key:<key id>`, `role` is `member` and `access.human` is `false`; for a signed-in person `role` is `org:admin` (workspace admin) or `org:member`. `accessView` is a display hint for the web workspace, not an authorization token, and is `null` when it cannot be computed. The response is sent with `Cache-Control: private, no-store`.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member. Any valid credential is accepted, including a device token sent with the header `X-Client: electron`. API-key scopes are not checked on this route.",
        "tags": [
          "Workspace settings and keys"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/workspace#get-me"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "X-Client",
            "in": "header",
            "required": false,
            "description": "Required only when the credential is a device token: send `X-Client: electron`. A device token sent without it is not accepted, and the request is answered with `401 unauthenticated`. API keys and browser sessions do not need it.",
            "schema": {
              "type": "string",
              "enum": [
                "electron"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The caller's identity: `{ userId, role, access: { profile, capabilities, human }, tenant: { id, clerkOrgId, slug }, accessView }`. `tenant.id` is the workspace id, `tenant.clerkOrgId` is the workspace's organization id at the sign-in provider and `tenant.slug` is its short name, which can be `null`. `accessView` is `{ v, profile, human, capabilities, orgRole, credentialKind, permissionRegistryVersion, authorizationRevision, computedAt }`: it repeats the profile, the `human` flag and the capability identifiers and adds the caller's `orgRole`, the `credentialKind` (`session`, `api_key` or `desktop`), two version counters and the time it was computed as an ISO 8601 string.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Check that the service is reachable and its database answers",
        "description": "The response is always 200 with `ok: true` when the service itself answers, so read `db` for the database state: `connected`, `unconfigured` or `error` (with a short description in `dbError`). `clerk` reports whether the sign-in provider is configured (`configured` or `missing_secret`). Responses are sent with `Cache-Control: no-store`.\n\n**Access:** No credential is needed. A credential that is sent is not read.",
        "tags": [
          "Workspace settings and keys"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/workspace#get-health"
        },
        "security": [],
        "responses": {
          "200": {
            "description": "`{ ok, clerk, db, dbError, ts }`, where `ts` is the server time as an ISO 8601 string.",
            "content": {
              "application/json": {
                "example": {
                  "ok": true,
                  "clerk": "configured",
                  "db": "connected",
                  "dbError": null,
                  "ts": "2026-11-28T10:15:30.000Z"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/tenant/settings": {
      "get": {
        "operationId": "getTenantSettings",
        "summary": "Read the model key status and the default model",
        "description": "The default model is used for a run when neither the request nor the agent names a model.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Workspace settings and keys"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/workspace#get-tenant-settings"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ hasOpenRouterKey, openRouterKeyLast4, defaultModel }`. `openRouterKeyLast4` and `defaultModel` are `null` when not set.",
            "content": {
              "application/json": {
                "example": {
                  "hasOpenRouterKey": true,
                  "openRouterKeyLast4": "9f3c",
                  "defaultModel": "openai/gpt-4o-mini"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/tenant/openrouter-test": {
      "post": {
        "operationId": "postTenantOpenrouterTest",
        "summary": "Check that the stored model key is still accepted by OpenRouter",
        "description": "Asks OpenRouter to validate the stored key. The key is not returned and no model is called. Useful as a pre-flight check before a batch of runs.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Workspace settings and keys"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/workspace#post-tenant-openrouter-test"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "responses": {
          "200": {
            "description": "`{ ok, detail }`. `ok` is `true` when OpenRouter accepts the key, and `detail` is then the label OpenRouter reports for it (or `valid key`). When the key is rejected, `ok` is `false` and `detail` reads `Key rejected (HTTP <status>)`.",
            "content": {
              "application/json": {
                "example": {
                  "ok": true,
                  "detail": "valid key"
                }
              }
            }
          },
          "400": {
            "description": "`no_key`: No model key is stored for the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "no_key": {
                    "value": {
                      "error": "no_key"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/tenant/config": {
      "get": {
        "operationId": "getTenantConfig",
        "summary": "Read the workspace configuration",
        "description": "Returns everything stored in the configuration object, including values written by the web workspace's Settings screens. Keys that begin with `model.system` are never included; the reviewed system model profiles are read with the `systemProfiles` parameter instead.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Workspace settings and keys"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/workspace#get-tenant-config"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "systemProfiles",
            "in": "query",
            "required": false,
            "description": "Set to `1` to return the reviewed system model profiles instead of the configuration: `{ profiles, revision, captureId }`, which is `{ \"profiles\": {}, \"revision\": 0, \"captureId\": null }` before any review. These profiles list the models the platform's built-in features may use.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The configuration object, or `{}` when nothing is stored. Values keep the JSON type they were written with.",
            "content": {
              "application/json": {
                "example": {
                  "assistant.model": "openai/gpt-4o-mini",
                  "spend.monthlyBudgetUsd": 250,
                  "retention.receiptsDays": 90
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "description": "`profile_capture_unavailable`: `systemProfiles=1` was requested and the profile store cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "profile_capture_unavailable": {
                    "value": {
                      "error": "profile_capture_unavailable"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "put": {
        "operationId": "putTenantConfig",
        "summary": "Merge keys into the workspace configuration",
        "description": "The body is a JSON object that is merged into the stored configuration one top-level key at a time: each key you send replaces that key's whole value, and keys you do not send are kept. A key cannot be deleted, only overwritten (for example with `null` or `false`). Protected keys are refused for API keys: the families `spend.`, `ratelimit.`, `retention.`, `workspace.`, `deepagents.`, `idea.` and `model.system`, and the keys `requiredDatasetId`, `spendMonthlyBudgetUsd`, `clarificationQuestions` and `toolPolicy`. Successful changes are written to the audit log.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member. Protected keys need a workspace admin signed in to the web workspace; API keys and device tokens cannot change them. If the body contains one protected key, the whole request is refused.",
        "tags": [
          "Workspace settings and keys"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/workspace#put-tenant-config"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "description": "One or more top-level keys to set, for example `\"assistant.model\": \"openai/gpt-4o-mini\"` to pin the model of the in-app assistant. The keys `customSkills`, `mcp`, anything starting with `mcp.` and anything starting with `agentGrants.` are never accepted here because they have dedicated controls."
                }
              },
              "example": {
                "assistant.model": "openai/gpt-4o-mini"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The merged configuration object, in the same shape as the read.",
            "content": {
              "application/json": {
                "example": {
                  "assistant.model": "openai/gpt-4o-mini",
                  "spend.monthlyBudgetUsd": 250,
                  "retention.receiptsDays": 90
                }
              }
            }
          },
          "400": {
            "description": "`invalid_config_patch`: The body is JSON but not an object, for example an array.\n\n`dedicated_skill_controls_required`: The body contains `customSkills`; custom skills are changed through the skills endpoints.\n\n`dedicated_mcp_controls_required`: The body contains `mcp` or a key starting with `mcp.`; use the MCP access controls.\n\n`dedicated_grant_controls_required`: The body contains a key starting with `agentGrants.`.\n\n`profile_command_required`: The body contains a key starting with `model.system`. Reviewed model profiles are not changed through this merge; a few of these keys answer `admin_required` or `server_owned_profile_revision` instead. Settings has no screen for reviewed model profiles today, and an API key cannot record one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_config_patch": {
                    "value": {
                      "error": "invalid_config_patch"
                    }
                  },
                  "dedicated_skill_controls_required": {
                    "value": {
                      "error": "dedicated_skill_controls_required"
                    }
                  },
                  "dedicated_mcp_controls_required": {
                    "value": {
                      "error": "dedicated_mcp_controls_required"
                    }
                  },
                  "dedicated_grant_controls_required": {
                    "value": {
                      "error": "dedicated_grant_controls_required"
                    }
                  },
                  "profile_command_required": {
                    "value": {
                      "error": "profile_command_required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "description": "`admin_required`: The body contains a protected key and the caller is not a workspace admin signed in to the web workspace.\n\nThe credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "admin_required": {
                    "value": {
                      "error": "admin_required"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`config_changed`: The configuration kept changing while the request was applied; nothing was saved. Read it again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "config_changed": {
                    "value": {
                      "error": "config_changed"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/tenant/clarification": {
      "get": {
        "operationId": "getTenantClarification",
        "summary": "List the standard clarifying questions for new agents",
        "description": "These are the questions the agent builder asks when someone defines an agent, with the answer options the workspace offers. The built-in defaults are returned until a workspace admin customises them (at most 12 questions with 24 options each). An agent stores its answers in its `clarification` object, keyed by question `key`.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Workspace settings and keys"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/workspace#get-tenant-clarification"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ questions: [{ key, question, options, allowCustom }] }`. `allowCustom` says whether a free-text answer is accepted in place of one of `options`.",
            "content": {
              "application/json": {
                "example": {
                  "questions": [
                    {
                      "key": "produce",
                      "question": "What should this agent produce?",
                      "options": [
                        "A written summary",
                        "A structured report",
                        "Recommendations"
                      ],
                      "allowCustom": true
                    },
                    {
                      "key": "authority",
                      "question": "How much authority should it have?",
                      "options": [
                        "Answer questions only",
                        "Draft content",
                        "Recommend actions"
                      ],
                      "allowCustom": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/tenant/tool-policy": {
      "get": {
        "operationId": "getTenantToolPolicy",
        "summary": "Read the tool policy and, optionally, one connection's tools",
        "description": "Without parameters it returns the stored policy and whether it is valid. When `valid` is `false`, `policy` is returned empty, `errors` lists the reasons, and connector tool calls are refused until a valid policy is saved. With `connectionId` it also lists that connection's tools with the classification in effect for each. For some connectors the tool list is fetched live from the connected system; if that fails, `tools` is empty and `toolsError` says why.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member. Listing the tools of a generic MCP server connection needs a workspace admin signed in to the web workspace.",
        "tags": [
          "Workspace settings and keys"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/workspace#get-tenant-tool-policy"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "connectionId",
            "in": "query",
            "required": false,
            "description": "A connector connection in the workspace whose tools should be listed with their policy status.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ policy, valid, errors }`. `policy` is `{ tools?, connections? }`: `tools` maps `<provider>:<tool>` to `{ classification?, constraints?, obligations? }` and `connections` maps a connection id to `{ allow?, deny? }`. Obligations are `log`, `approval`, `spend` or `redact:<class>`. With `connectionId` the response adds `connection: { id, name, provider }`, `allowListActive` (whether an allow list is set for the connection), `toolsError` and `tools`. Each tool has `name`, `key`, `heuristic` (the classification guessed from the tool name), `override` (`read`, `write` or `null`), `effective` (the classification in use), `rule` (the tool's entry in `policy.tools`, or `null`) and `list` (`allow`, `deny` or `null`). `heuristic` and `effective` are objects `{ kind, basis, heuristic, verb }`, where `kind` is `read` or `write` and `basis` is `read_verb`, `write_verb`, `unrecognised` or `admin_override`.",
            "content": {
              "application/json": {
                "example": {
                  "policy": {
                    "tools": {
                      "jira:jira_create_issue": {
                        "obligations": [
                          "approval"
                        ]
                      }
                    },
                    "connections": {
                      "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11": {
                        "deny": [
                          "jira_transition_issue"
                        ]
                      }
                    }
                  },
                  "valid": true,
                  "errors": [],
                  "connection": {
                    "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                    "name": "Example Jira site",
                    "provider": "jira"
                  },
                  "allowListActive": false,
                  "toolsError": null,
                  "tools": [
                    {
                      "name": "jira_create_issue",
                      "key": "jira:jira_create_issue",
                      "heuristic": {
                        "kind": "write",
                        "basis": "write_verb",
                        "heuristic": true,
                        "verb": "create"
                      },
                      "override": null,
                      "effective": {
                        "kind": "write",
                        "basis": "write_verb",
                        "heuristic": true,
                        "verb": "create"
                      },
                      "rule": {
                        "obligations": [
                          "approval"
                        ]
                      },
                      "list": null
                    },
                    {
                      "name": "jira_transition_issue",
                      "key": "jira:jira_transition_issue",
                      "heuristic": {
                        "kind": "write",
                        "basis": "write_verb",
                        "heuristic": true,
                        "verb": "transition"
                      },
                      "override": null,
                      "effective": {
                        "kind": "write",
                        "basis": "write_verb",
                        "heuristic": true,
                        "verb": "transition"
                      },
                      "rule": null,
                      "list": "deny"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "description": "`admin_session_required`: `connectionId` names a generic MCP server connection and the caller is not a workspace admin signed in to the web workspace.\n\nThe credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "admin_session_required": {
                    "value": {
                      "error": "admin_session_required"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: `connectionId` does not match a connection in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/tenant/build-access": {
      "get": {
        "operationId": "getTenantBuildAccess",
        "summary": "Read who can build apps and the monthly build allowance",
        "description": "`available` says whether the platform is accepting builds right now. `capacity` gives the workspace's allowance for the current month in US dollars, how much of it is used and when it resets. App building itself is for people signed in to the web workspace, so for an API key `yourRole` is `member` and `yourRoleCanBuild` and `operatorGrant` are always `false`.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Workspace settings and keys"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/workspace#get-tenant-build-access"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ available, capacity: { paused, allowanceUsd, allowanceUsedUsd, resetsAt }, roles, yourRole, yourRoleCanBuild, operatorGrant }`. `roles` has one entry for `org:admin` (workspace admins) and one for `org:member`, each with `role`, `enabled`, `changedAt` and `changedByYou`; workspace admins signed in to the web workspace also see `changedBy`.",
            "content": {
              "application/json": {
                "example": {
                  "available": true,
                  "capacity": {
                    "paused": false,
                    "allowanceUsd": 25,
                    "allowanceUsedUsd": 3,
                    "resetsAt": "2026-12-01T00:00:00.000Z"
                  },
                  "roles": [
                    {
                      "role": "org:admin",
                      "enabled": true,
                      "changedAt": "2026-11-20T09:14:02.000Z",
                      "changedByYou": false
                    },
                    {
                      "role": "org:member",
                      "enabled": false,
                      "changedAt": null,
                      "changedByYou": false
                    }
                  ],
                  "yourRole": "member",
                  "yourRoleCanBuild": false,
                  "operatorGrant": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "description": "`build_access_unavailable`: App building access is not set up on the deployment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "build_access_unavailable": {
                    "value": {
                      "error": "build_access_unavailable"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/tenant/voice-verification": {
      "get": {
        "operationId": "getTenantVoiceVerification",
        "summary": "Read the workspace's voice verification status",
        "description": "Returns the saved voice verification and the latest probe. A saved verification can expire or cease to match the workspace's current retention mode. If this deployment has not been set up for verification, the request returns 503 voice_verification_unavailable. A successful response does not establish that a new voice turn will succeed.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member. Read only. Running a new probe requires a workspace admin signed in to the web workspace and can incur model charges. canVerify is always false for an API key.",
        "tags": [
          "Workspace settings and keys"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/workspace#get-tenant-voice-verification"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object with verified (boolean), reason (null or no_model_key, no_row, expired, retention_mismatch, route_unverified), verifiedAt and expiresAt (ISO 8601 timestamps or null), route (standard or zero-retention), retention (standard or zero), maximumTurnUsd (number or null), lastProbe, canVerify and retryAt (ISO 8601 timestamp or null). lastProbe is null or an object with at (ISO 8601), ok (boolean or null), code (string or null), costUsd (number or null) and trigger (string). The response is sent with Cache-Control: no-store.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "description": "`voice_verification_unavailable`: Voice verification has not been set up on the deployment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "voice_verification_unavailable": {
                    "value": {
                      "error": "voice_verification_unavailable"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/integrations/mce": {
      "get": {
        "operationId": "getIntegrationsMce",
        "summary": "List Marketing Cloud Engagement connections",
        "description": "Returns every Marketing Cloud Engagement connection in the workspace, most recently updated first. The list is not paginated and takes no parameters. Use `status`, `lastTestedAt` and `toolCount` to monitor a connection, and `id` to match it against an agent's `connections` list.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Integrations and connections"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/integrations#get-integrations-mce"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ connections: Connection[] }`. Each connection has `id`, `name`, `region` (`us` or `eu`), `mceTenantId`, `mceClientId`, `businessUnit` (string or `null`), `status` (`pending`, `connected` or `error`), `scopes` (the scopes the provider reported at the last authorization or token refresh; empty until then), `hasToken`, `staysSignedIn` (a refresh token is held), `toolCount` (tools found by the last connection test; `null` before the first test and after a failed one), `lastTestedAt` (`null` before the first test), `lastError` (a fixed generic message, or `null`), `lastRefreshedAt` (when the connection record last changed), `createdAt` and `updatedAt`. `tokenLast4` is always `null`. `lastTestedAt` and `lastRefreshedAt` are ISO 8601 timestamps. `createdAt` and `updatedAt` are JavaScript date strings as shown in the example, not ISO 8601; read `lastRefreshedAt` when you need the last change as an ISO 8601 timestamp.",
            "content": {
              "application/json": {
                "example": {
                  "connections": [
                    {
                      "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "name": "Example business unit",
                      "region": "eu",
                      "mceTenantId": "mc-example-tenant-subdomain",
                      "mceClientId": "example-package-client-id",
                      "businessUnit": "Example BU",
                      "hasToken": true,
                      "tokenLast4": null,
                      "scopes": [
                        "email_read",
                        "email_write"
                      ],
                      "status": "connected",
                      "lastTestedAt": "2026-11-20T09:14:03.120Z",
                      "lastError": null,
                      "toolCount": 12,
                      "staysSignedIn": true,
                      "lastRefreshedAt": "2026-11-20T09:14:03.120Z",
                      "createdAt": "Thu Nov 19 2026 10:02:11 GMT+0000 (Coordinated Universal Time)",
                      "updatedAt": "Fri Nov 20 2026 09:14:03 GMT+0000 (Coordinated Universal Time)"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "502": {
            "description": "`connection_request_failed`: The list could not be read. The response describes the failed request, not the state of any connection; retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "connection_request_failed": {
                    "value": {
                      "error": "connection_request_failed"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/integrations/jira": {
      "get": {
        "operationId": "getIntegrationsJira",
        "summary": "List Jira connections",
        "description": "Returns every Jira connection in the workspace, most recently updated first. The list is not paginated and takes no parameters. The client secret of the Atlassian app is not returned; `hasClientSecret` only reports whether one is stored.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Integrations and connections"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/integrations#get-integrations-jira"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ connections: JiraConnection[] }`. Each connection has `id`, `name`, `oauthClientId` (the client id of the Atlassian app, or `null`), `hasClientSecret`, `cloudId` and `siteUrl` (the authorized Jira site, or `null`), `defaultProject` (string or `null`), `status` (`pending`, `connected` or `error`), `scopes` (the scopes Atlassian reported at the last authorization or token refresh; empty until then), `hasToken`, `staysSignedIn` (a refresh token is held), `toolCount` (the number of Jira tools recorded by the last connection test; `null` before the first test and after a failed one), `lastTestedAt` (`null` before the first test), `lastError` (a fixed generic message, or `null`), `lastRefreshedAt` (when the connection record last changed), `createdAt` and `updatedAt`. `tokenLast4` is always `null`. `lastTestedAt` and `lastRefreshedAt` are ISO 8601 timestamps. `createdAt` and `updatedAt` are JavaScript date strings as shown in the example, not ISO 8601; read `lastRefreshedAt` when you need the last change as an ISO 8601 timestamp.",
            "content": {
              "application/json": {
                "example": {
                  "connections": [
                    {
                      "id": "8b2e4d17-5c3a-4f90-b6e1-2a7d9c0f4e33",
                      "name": "Example Jira site",
                      "oauthClientId": "example-atlassian-client-id",
                      "cloudId": "1d9f3b6a-7e24-4c58-a0b3-5e8c2f7d6a19",
                      "siteUrl": "https://example.atlassian.net",
                      "defaultProject": "OPS",
                      "hasToken": true,
                      "tokenLast4": null,
                      "hasClientSecret": true,
                      "scopes": [
                        "read:jira-work",
                        "write:jira-work",
                        "read:jira-user",
                        "offline_access"
                      ],
                      "status": "connected",
                      "lastTestedAt": "2026-11-20T09:20:41.507Z",
                      "lastError": null,
                      "toolCount": 4,
                      "staysSignedIn": true,
                      "lastRefreshedAt": "2026-11-20T09:20:41.507Z",
                      "createdAt": "Thu Nov 19 2026 10:30:52 GMT+0000 (Coordinated Universal Time)",
                      "updatedAt": "Fri Nov 20 2026 09:20:41 GMT+0000 (Coordinated Universal Time)"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "502": {
            "description": "`connection_request_failed`: The list could not be read. The response describes the failed request, not the state of any connection; retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "connection_request_failed": {
                    "value": {
                      "error": "connection_request_failed"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/knowledge": {
      "get": {
        "operationId": "getKnowledge",
        "summary": "List knowledge layers and sources",
        "description": "Returns the five layer definitions and every source in the workspace catalogue. The list is not paginated.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#get-knowledge"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object with `layers` (each with `key`, `label`, `scope` and `blurb`) and `sources` (each with `id`, `layer`, `name`, `description`, `owner` and `updatedAt`). `owner` and `updatedAt` can be empty strings on older entries.",
            "content": {
              "application/json": {
                "example": {
                  "layers": [
                    {
                      "key": "domain",
                      "label": "Domain knowledge",
                      "scope": "Shared",
                      "blurb": "Reference packs, definitions, and best practices for the agent's domain."
                    },
                    {
                      "key": "tenant",
                      "label": "Company knowledge",
                      "scope": "Company",
                      "blurb": "Approved sources connected from your organization."
                    },
                    {
                      "key": "role",
                      "label": "Role & team",
                      "scope": "Role-scoped",
                      "blurb": "Access scoped to the user's role, team, and permissions."
                    },
                    {
                      "key": "user",
                      "label": "User context",
                      "scope": "Private",
                      "blurb": "The individual user's preferences, history, and private notes."
                    },
                    {
                      "key": "task",
                      "label": "Task context",
                      "scope": "Task only",
                      "blurb": "Files and instructions for the task at hand."
                    }
                  ],
                  "sources": [
                    {
                      "id": "ks_3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "layer": "tenant",
                      "name": "Brand guidelines 2026",
                      "description": "Approved tone of voice and visual rules.",
                      "owner": "Marketing operations",
                      "updatedAt": "2026-11-28T10:15:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "postKnowledge",
        "summary": "Add a knowledge source",
        "description": "Adds a source to one layer. The server issues the `id` and sets `updatedAt`; neither can be supplied.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#post-knowledge"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "layer": {
                    "type": "string",
                    "enum": [
                      "domain",
                      "tenant",
                      "role",
                      "user",
                      "task"
                    ],
                    "description": "The knowledge layer the source belongs to."
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name. Leading and trailing spaces are removed and longer values are cut to 100 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "What the source contains. Cut to 200 characters."
                  },
                  "owner": {
                    "type": "string",
                    "description": "Who is accountable for the source, as free text. Cut to 120 characters. Defaults to the identifier of the calling credential."
                  }
                },
                "required": [
                  "layer",
                  "name"
                ]
              },
              "example": {
                "layer": "tenant",
                "name": "Brand guidelines 2026",
                "description": "Approved tone of voice and visual rules.",
                "owner": "Marketing operations"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created source: `{ id, layer, name, description, owner, updatedAt }`. The status is 200.",
            "content": {
              "application/json": {
                "example": {
                  "id": "ks_3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                  "layer": "tenant",
                  "name": "Brand guidelines 2026",
                  "description": "Approved tone of voice and visual rules.",
                  "owner": "Marketing operations",
                  "updatedAt": "2026-11-28T10:15:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "`invalid`: `name` is missing or empty, or `layer` is not one of the five layer keys.\n\n`limit`: The workspace already has 300 knowledge sources. Remove one first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid": {
                    "value": {
                      "error": "invalid"
                    }
                  },
                  "limit": {
                    "value": {
                      "error": "limit"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/knowledge/{id}": {
      "patch": {
        "operationId": "patchKnowledgeById",
        "summary": "Update a knowledge source",
        "description": "Send only the fields to change. `updatedAt` is set by the server on every update, and an empty `owner` keeps the current owner.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#patch-knowledge-id"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Source id, for example `ks_3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "layer": {
                    "type": "string",
                    "enum": [
                      "domain",
                      "tenant",
                      "role",
                      "user",
                      "task"
                    ],
                    "description": "Move the source to another layer."
                  },
                  "name": {
                    "type": "string",
                    "description": "New display name; cannot be empty. Cut to 100 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "New description. Cut to 200 characters."
                  },
                  "owner": {
                    "type": "string",
                    "description": "New owner. Cut to 120 characters."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated source: `{ id, layer, name, description, owner, updatedAt }`.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`invalid`: The change would leave the source without a name or with an unknown layer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid": {
                    "value": {
                      "error": "invalid"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No source in the workspace has this id, or it was removed while the update was in progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteKnowledgeById",
        "summary": "Remove a knowledge source",
        "description": "**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#delete-knowledge-id"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Source id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ \"ok\": true }`.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No source in the workspace has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/skills": {
      "get": {
        "operationId": "getSkills",
        "summary": "List skills and macros",
        "description": "Returns the built-in skills first, then the workspace's custom skills, and all macros. The response is not paginated and includes the full instruction text of every skill.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#get-skills"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object with `skills` and `macros`. Every skill has `id`, `name`, `category`, `description`, `instructions` and `builtin`; skills bound to a connector add `integration` (`provider`, `toolMatch`). Custom skills also carry `revision`, `digest` (when known), `provenance` (who created and last changed the skill, and an `origin` of `manual`, `copy` or `import`, or `legacy` for skills saved before origins were recorded) and, for imported skills, `importInfo`. Each macro has `id`, `name`, `description` and `steps`.",
            "content": {
              "application/json": {
                "example": {
                  "skills": [
                    {
                      "id": "builtin:source-freshness-check",
                      "name": "Source freshness check",
                      "category": "Compliance",
                      "description": "Verifies data recency before it is used.",
                      "instructions": "Before relying on a source, check its date/version. If it is stale or undated, say so and lower your confidence. Prefer the most recent approved source.",
                      "builtin": true
                    },
                    {
                      "id": "skill_3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "name": "Quarterly report review",
                      "category": "Reporting",
                      "description": "Checks a quarterly report for unsupported figures.",
                      "instructions": "Read every section. List each figure that has no stated source.",
                      "builtin": false,
                      "revision": 1,
                      "digest": "8b20d135815a3e690946e8324c2d7887db56c2669a249848f9ba992efbe82884",
                      "provenance": {
                        "origin": "manual",
                        "createdBy": "api-key:7a1e4c2b-5d3f-4a68-8b90-2c4d6e8f0a12",
                        "createdAt": "2026-11-28T10:15:00.123456+00:00",
                        "updatedBy": "api-key:7a1e4c2b-5d3f-4a68-8b90-2c4d6e8f0a12",
                        "updatedAt": "2026-11-28T10:15:00.123456+00:00"
                      }
                    }
                  ],
                  "macros": [
                    {
                      "id": "mac_5b2d4f6a-8c1e-4d3b-9f70-1a2b3c4d5e6f",
                      "name": "Report pack",
                      "description": "Review the report, then write the summary.",
                      "steps": [
                        {
                          "skillId": "skill_3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11"
                        },
                        {
                          "skillId": "builtin:executive-writing",
                          "note": "Keep it under 150 words."
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "postSkills",
        "summary": "Create a custom skill",
        "description": "Saves a new custom skill at revision 1. Only the fields below are accepted; any other field is rejected. Nothing is shortened to fit a limit: a request that exceeds one fails and saves nothing.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#post-skills"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name, at most 80 characters. It cannot match the name of a built-in skill or another custom skill, ignoring case."
                  },
                  "category": {
                    "type": "string",
                    "description": "Free-text category of at most 40 characters. Defaults to `Custom`."
                  },
                  "description": {
                    "type": "string",
                    "description": "Short summary of at most 1,024 characters."
                  },
                  "instructions": {
                    "type": "string",
                    "description": "The instruction text an agent receives when the skill is selected. All authored text of a skill together is limited to 64 KiB of UTF-8."
                  },
                  "integration": {
                    "type": "object",
                    "description": "Optional binding to a connector, used to narrow the connector's tools to what this skill needs.",
                    "properties": {
                      "provider": {
                        "type": "string",
                        "description": "Required when `integration` is sent. Connector provider key of 1 to 40 characters, for example `jira`."
                      },
                      "toolMatch": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Required when `integration` is sent; it can be an empty array. Up to 12 keywords of at most 128 characters each. Stored trimmed, in lower case and without duplicates."
                      }
                    },
                    "required": [
                      "provider",
                      "toolMatch"
                    ]
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Quarterly report review",
                "category": "Reporting",
                "description": "Checks a quarterly report for unsupported figures.",
                "instructions": "Read every section. List each figure that has no stated source."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved skill with a server-issued `id`, `builtin: false`, `revision: 1`, a content `digest` and `provenance`. The status is 200.",
            "content": {
              "application/json": {
                "example": {
                  "id": "skill_3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                  "name": "Quarterly report review",
                  "category": "Reporting",
                  "description": "Checks a quarterly report for unsupported figures.",
                  "instructions": "Read every section. List each figure that has no stated source.",
                  "builtin": false,
                  "revision": 1,
                  "digest": "8b20d135815a3e690946e8324c2d7887db56c2669a249848f9ba992efbe82884",
                  "provenance": {
                    "origin": "manual",
                    "createdBy": "api-key:7a1e4c2b-5d3f-4a68-8b90-2c4d6e8f0a12",
                    "createdAt": "2026-11-28T10:15:00.123456+00:00",
                    "updatedBy": "api-key:7a1e4c2b-5d3f-4a68-8b90-2c4d6e8f0a12",
                    "updatedAt": "2026-11-28T10:15:00.123456+00:00"
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_skill`: A field is missing, malformed or not writable. The response lists each problem in `issues` as `{ field, message }`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_skill": {
                    "value": {
                      "error": "invalid_skill"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "`name_conflict`: A built-in or workspace skill already uses the name.\n\n`catalog_limit`: The workspace already has 200 custom skills.\n\n`catalog_busy`: The catalogue kept changing while the request was being saved. Nothing was saved; send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "name_conflict": {
                    "value": {
                      "error": "name_conflict"
                    }
                  },
                  "catalog_limit": {
                    "value": {
                      "error": "catalog_limit"
                    }
                  },
                  "catalog_busy": {
                    "value": {
                      "error": "catalog_busy"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "`skill_too_large`: The authored text exceeds 64 KiB of UTF-8.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "skill_too_large": {
                    "value": {
                      "error": "skill_too_large"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/skills/{id}": {
      "get": {
        "operationId": "getSkillsById",
        "summary": "Get a skill with its dependencies and change history",
        "description": "Works for built-in and custom skills. Use it to read the current `revision` and `digest` before an update, delete or export, and to see what still refers to a skill before you rename or delete it. Earlier instruction text is not kept, so `history` records that a change happened, not what the text was.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#get-skills-id"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Skill id: `builtin:…` for a built-in skill or `skill_…` for a custom skill.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An object with `skill`, `dependencies` and `history`. `dependencies` holds `draftAgents` (agents whose current configuration selects the skill: `id`, `name`), `macros` (`id`, `name`) and `activeVersions` (activated agent versions that captured the skill: `agentId`, `versionId`, `name`), each capped at 50 entries, plus `totals` with the full counts and a `truncated` flag. `history` holds up to 50 of the most recent change events, newest first, each with `action`, `actor`, `createdAt`, `revisionBefore`, `revisionAfter`, `digestBefore` and `digestAfter`. `createdAt` is a date-time string that is not guaranteed to be ISO 8601, so parse it leniently.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No built-in or workspace skill has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "patchSkillsById",
        "summary": "Update a custom skill",
        "description": "Send `expectedRevision` plus only the fields to change. A successful update raises `revision` by one and issues a new `digest`. A rename is refused while an agent's configuration or a macro still uses the skill. Editing an imported skill creates a new revision, so it has to be reviewed again before agents can use it.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#patch-skills-id"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of a custom skill (`skill_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expectedRevision": {
                    "type": "integer",
                    "description": "The `revision` from your latest read of the skill."
                  },
                  "name": {
                    "type": "string",
                    "description": "New display name, at most 80 characters."
                  },
                  "category": {
                    "type": "string",
                    "description": "New category, at most 40 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "New description, at most 1,024 characters."
                  },
                  "instructions": {
                    "type": "string",
                    "description": "New instruction text."
                  },
                  "integration": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "description": "New connector binding (`provider`, `toolMatch`). Leave it out to keep the current binding, or send `null` to remove it."
                  }
                },
                "required": [
                  "expectedRevision"
                ]
              },
              "example": {
                "expectedRevision": 1,
                "instructions": "Read every section. List each figure that has no stated source, with its page number."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved skill, in the same shape as the create response, with the new `revision` and `digest`.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`revision_required`: `expectedRevision` is missing or not a non-negative integer.\n\n`invalid_skill`: A field is malformed or not writable; see `issues`.\n\n`credential`: The skill was imported and the changed content matches a credential pattern.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "revision_required": {
                    "value": {
                      "error": "revision_required"
                    }
                  },
                  "invalid_skill": {
                    "value": {
                      "error": "invalid_skill"
                    }
                  },
                  "credential": {
                    "value": {
                      "error": "credential"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No custom skill in the workspace has this id. Built-in skills cannot be changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`stale_skill`: `expectedRevision` is no longer the current revision. Read the skill again and reapply your change.\n\n`name_conflict`: Another skill already uses the new name.\n\n`skill_in_use`: The request renames a skill that agents or macros still refer to. The response includes `dependencies`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "stale_skill": {
                    "value": {
                      "error": "stale_skill"
                    }
                  },
                  "name_conflict": {
                    "value": {
                      "error": "name_conflict"
                    }
                  },
                  "skill_in_use": {
                    "value": {
                      "error": "skill_in_use"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "`skill_too_large`: The authored text would exceed 64 KiB of UTF-8.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "skill_too_large": {
                    "value": {
                      "error": "skill_too_large"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteSkillsById",
        "summary": "Delete a custom skill",
        "description": "The request needs a JSON body. Macros that use the skill are not rewritten: they keep the step, which no longer resolves to a skill, until you edit the macro. Agent versions that were already activated keep the copy they captured.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#delete-skills-id"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of a custom skill (`skill_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expectedRevision": {
                    "type": "integer",
                    "description": "The `revision` from your latest read of the skill. No other field is accepted."
                  }
                },
                "required": [
                  "expectedRevision"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`{ \"ok\": true }`.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`revision_required`: `expectedRevision` is missing or not a non-negative integer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "revision_required": {
                    "value": {
                      "error": "revision_required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No custom skill in the workspace has this id. Built-in skills cannot be deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`stale_skill`: `expectedRevision` is no longer the current revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "stale_skill": {
                    "value": {
                      "error": "stale_skill"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/skills/{id}/copy": {
      "post": {
        "operationId": "postSkillsByIdCopy",
        "summary": "Copy a built-in skill into an editable custom skill",
        "description": "Creates a separate custom skill that starts from a built-in definition. The built-in skill stays unchanged, and the copy does not follow later changes to it.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#post-skills-id-copy"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of a built-in skill, for example `builtin:executive-writing`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name for the copy. It cannot reuse the built-in name or the name of any other skill."
                  },
                  "category": {
                    "type": "string",
                    "description": "Overrides the built-in category."
                  },
                  "description": {
                    "type": "string",
                    "description": "Overrides the built-in description."
                  },
                  "instructions": {
                    "type": "string",
                    "description": "Overrides the built-in instructions."
                  },
                  "integration": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "description": "Overrides the built-in connector binding (`provider`, `toolMatch`). Send `null` to create the copy without a binding."
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new custom skill at `revision: 1`. Its `provenance.origin` is `copy` and `provenance.copiedFrom` holds the `id`, `name` and `digest` of the built-in skill. The status is 200.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`invalid_skill`: `name` is missing, or a field is malformed or not writable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_skill": {
                    "value": {
                      "error": "invalid_skill"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: The id is not a built-in skill.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`name_conflict`: A built-in or workspace skill already uses the name.\n\n`catalog_limit`: The workspace already has 200 custom skills.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "name_conflict": {
                    "value": {
                      "error": "name_conflict"
                    }
                  },
                  "catalog_limit": {
                    "value": {
                      "error": "catalog_limit"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/skills/draft": {
      "post": {
        "operationId": "postSkillsDraft",
        "summary": "Draft skill instructions with the workspace model",
        "description": "**Status: Gated.** Shipped, but closed until a switch is turned on; the Access note below says which.\n\nAsks the workspace's default model to write two to four sentences of instructions for a named skill. Nothing is saved: pass the returned text to the create or update endpoint. The call uses the workspace's model provider key and is refused when the workspace is over its monthly budget. Send the `X-CoA-Model-Request` header with every request: once an approved model profile lets the model call through, a request without it is refused with `503 model_usage_request_identity_required`.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member. Refused with 403 until a workspace admin has approved a model profile that covers skill drafting, has not expired and lists the workspace's default model. Settings has no screen for recording a profile today and an API key cannot record one, so expect this call to answer `403` with `system_model_profile_unavailable` unless your workspace admin confirms that a profile is in place. The workspace also needs a model provider key.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#post-skills-draft"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "x-coa-status": "gated",
        "parameters": [
          {
            "name": "X-CoA-Model-Request",
            "in": "header",
            "required": false,
            "description": "The current Unix time in milliseconds (13 digits), a dot and a UUID that you generate, new for each request; it identifies the request for usage accounting. Send it on every request: once an approved model profile lets the model call through, a request without it is refused with `503 model_usage_request_identity_required` before any model call. See [The usage-request header](https://centerofagentic.com/docs/guides/troubleshooting#usage-request-header).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the skill to draft instructions for."
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional summary that gives the model more context."
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`{ instructions }`: the drafted text, at most 2,000 characters. It can be an empty string when no draft could be produced.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`invalid`: `name` is missing or empty.\n\n`no_model_key`: The workspace has no model provider key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid": {
                    "value": {
                      "error": "invalid"
                    }
                  },
                  "no_model_key": {
                    "value": {
                      "error": "no_model_key"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "description": "`over_budget`: The workspace is over its monthly spend budget.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "over_budget": {
                    "value": {
                      "error": "over_budget"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "`system_model_profile_unavailable`: No approved, unexpired model profile covers skill drafting. No model request was sent.\n\n`system_model_not_permitted`: The approved profile does not list the workspace's default model. No model request was sent.\n\nThe credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "system_model_profile_unavailable": {
                    "value": {
                      "error": "system_model_profile_unavailable"
                    }
                  },
                  "system_model_not_permitted": {
                    "value": {
                      "error": "system_model_not_permitted"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "`system_model_failed`: The model request failed after it may have been sent. Do not repeat it automatically.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "system_model_failed": {
                    "value": {
                      "error": "system_model_failed"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`model_usage_request_identity_required`: The request has no `X-CoA-Model-Request` header. No model request was sent.\n\n`system_model_decision_unavailable`: The request could not be recorded before the model call, for example because the `X-CoA-Model-Request` value is malformed, more than 24 hours old or more than a minute ahead of the server clock. No model request was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "model_usage_request_identity_required": {
                    "value": {
                      "error": "model_usage_request_identity_required"
                    }
                  },
                  "system_model_decision_unavailable": {
                    "value": {
                      "error": "system_model_decision_unavailable"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/skills/macros": {
      "post": {
        "operationId": "postSkillsMacros",
        "summary": "Create a macro",
        "description": "Every step must name a skill that exists in the catalogue at the time of the request. Entries in `steps` without a `skillId` are ignored.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#post-skills-macros"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name. Longer values are cut to 80 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "What the macro is for. Cut to 280 characters."
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "skillId": {
                          "type": "string",
                          "description": "Id of a built-in or custom skill. A macro id is not accepted."
                        },
                        "note": {
                          "type": "string",
                          "description": "Optional guidance for this step. Cut to 200 characters."
                        }
                      },
                      "required": [
                        "skillId"
                      ]
                    },
                    "description": "One to ten steps, in the order the agent should follow them."
                  }
                },
                "required": [
                  "name",
                  "steps"
                ]
              },
              "example": {
                "name": "Report pack",
                "description": "Review the report, then write the summary.",
                "steps": [
                  {
                    "skillId": "skill_3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11"
                  },
                  {
                    "skillId": "builtin:executive-writing",
                    "note": "Keep it under 150 words."
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created macro: `{ id, name, description, steps }`. The status is 200.",
            "content": {
              "application/json": {
                "example": {
                  "id": "mac_5b2d4f6a-8c1e-4d3b-9f70-1a2b3c4d5e6f",
                  "name": "Report pack",
                  "description": "Review the report, then write the summary.",
                  "steps": [
                    {
                      "skillId": "skill_3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11"
                    },
                    {
                      "skillId": "builtin:executive-writing",
                      "note": "Keep it under 150 words."
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid`: The name or the steps are missing, there are more than ten steps, or a step names an unknown skill or a macro. `detail` says which.\n\n`limit`: The workspace already has 100 macros.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid": {
                    "value": {
                      "error": "invalid"
                    }
                  },
                  "limit": {
                    "value": {
                      "error": "limit"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "`skill_not_ready`: A step uses an imported skill that has not been reviewed yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "skill_not_ready": {
                    "value": {
                      "error": "skill_not_ready"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/skills/macros/{id}": {
      "patch": {
        "operationId": "patchSkillsMacrosById",
        "summary": "Update a macro",
        "description": "Send only the fields to change; `steps` replaces the whole list. The result is checked against the current catalogue, so a step whose skill has been deleted must be removed before the macro can be saved.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#patch-skills-macros-id"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Macro id (`mac_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New display name; cannot be empty. Cut to 80 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "New description. Cut to 280 characters."
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "skillId": {
                          "type": "string",
                          "description": "Id of a built-in or custom skill. A macro id is not accepted."
                        },
                        "note": {
                          "type": "string",
                          "description": "Optional guidance for this step. Cut to 200 characters."
                        }
                      },
                      "required": [
                        "skillId"
                      ]
                    },
                    "description": "The full new list of one to ten steps, each with `skillId` and an optional `note`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated macro: `{ id, name, description, steps }`.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`invalid`: The merged macro has no name, no steps, more than ten steps, or a step that names an unknown skill or a macro.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid": {
                    "value": {
                      "error": "invalid"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No macro in the workspace has this id, or it was removed while the update was in progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`skill_not_ready`: A step uses an imported skill that has not been reviewed yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "skill_not_ready": {
                    "value": {
                      "error": "skill_not_ready"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteSkillsMacrosById",
        "summary": "Delete a macro",
        "description": "Removes only the macro. Agents that still list its id stop receiving the playbook; their configuration is not rewritten.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#delete-skills-macros-id"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Macro id (`mac_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ \"ok\": true }`.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No macro in the workspace has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/skills/{id}/export": {
      "post": {
        "operationId": "postSkillsByIdExport",
        "summary": "Export a skill as a portable document",
        "description": "Works for built-in and custom skills and does not change the catalogue. `expectedRevision` and `expectedDigest` must match the saved skill; for a built-in skill send `0` and `null`. The document comes back as JSON in `text`, to be written to a file under `filename`. Server ids and the review status of an imported skill are not part of the document.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#post-skills-id-export"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Skill id (`builtin:…` or `skill_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "json",
                      "skill-md"
                    ],
                    "description": "`skill-md` produces a `SKILL.md` file; `json` produces a JSON skill document."
                  },
                  "expectedRevision": {
                    "type": "integer",
                    "description": "Current `revision` of the skill; `0` for a built-in skill."
                  },
                  "expectedDigest": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Current `digest` of the skill, or `null` when the skill has none, as is the case for every built-in skill."
                  },
                  "portableName": {
                    "type": "string",
                    "description": "File-level name of 1 to 64 lower-case letters or digits separated by single hyphens. Defaults to a name derived from the skill name. An imported skill keeps the portable name it was imported with."
                  },
                  "description": {
                    "type": "string",
                    "description": "Description to use when the saved skill has none, at most 1,024 characters. An export needs a non-empty description; a saved description cannot be overridden here."
                  },
                  "bundle": {
                    "type": "boolean",
                    "description": "For a skill imported from a GitHub folder, `true` adds a `bundle` object with the manifest of the stored files."
                  }
                },
                "required": [
                  "format",
                  "expectedRevision",
                  "expectedDigest"
                ]
              },
              "example": {
                "format": "skill-md",
                "expectedRevision": 1,
                "expectedDigest": "8b20d135815a3e690946e8324c2d7887db56c2669a249848f9ba992efbe82884"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An object with `ok` (`true`), `text` (the document), `bytes`, `sha256`, `mimeType` (`application/json` or `text/markdown`), `filename` (`skills.json` or `SKILL.md`), `omittedResources` (supporting files the single document does not contain), `diagnostics`, `revision`, `digest` and `enforcement`. `enforcement` is always `CoA-only`: governance applies inside the platform, not to the exported file. With `bundle: true` on a GitHub-imported skill, `bundle` holds `{ version, manifest }`.",
            "content": {
              "application/json": {
                "example": {
                  "ok": true,
                  "text": "---\nname: 'quarterly-report-review'\ndescription: 'Checks a quarterly report for unsupported figures.'\nx-agentbuilder:\n  display-name: 'Quarterly report review'\n  category: 'Reporting'\n  extensions: {}\n  origin:\n    format: 'json'\n    sha256: '16bfe24b97e503193ae341724a1fadac6e769281dbed50acd2f4c65cff12a7af'\n    recordIndex: 0\n---\nRead every section. List each figure that has no stated source.",
                  "bytes": 395,
                  "sha256": "3a7a2a0ff6f7ee408764b3fadbae7399787983d9e4535955ba25558497cc4484",
                  "mimeType": "text/markdown",
                  "filename": "SKILL.md",
                  "omittedResources": [],
                  "diagnostics": [],
                  "revision": 1,
                  "digest": "8b20d135815a3e690946e8324c2d7887db56c2669a249848f9ba992efbe82884",
                  "enforcement": "CoA-only"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_export`: The body is malformed, a required value is missing, the skill has no description and none was supplied, or the content cannot be represented in the chosen format.\n\n`credential`: The content matches a credential pattern and is not exported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_export": {
                    "value": {
                      "error": "invalid_export"
                    }
                  },
                  "credential": {
                    "value": {
                      "error": "credential"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No built-in or workspace skill has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`stale_skill`: `expectedRevision` or `expectedDigest` does not match the saved skill.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "stale_skill": {
                    "value": {
                      "error": "stale_skill"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "`export_too_large`: The document would exceed 64 KiB for `skill-md` or 1 MiB for `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "export_too_large": {
                    "value": {
                      "error": "export_too_large"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/skills/{id}/resources": {
      "post": {
        "operationId": "postSkillsByIdResources",
        "summary": "Read the stored source files of a GitHub-imported skill",
        "description": "Has two modes, and each accepts only its own fields. Without `mode`, it returns up to 256 KiB of one stored file as base64, starting at `offset`; repeat with a higher `offset` until `eof` is `true`, then check the assembled file against `totalBytes` and `sha256`. With `mode` set to `review`, it returns the text reference files that the skill's instructions depend on, with their sizes and digests, for inspection. Neither mode changes the catalogue.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#post-skills-id-resources"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of a custom skill that was imported from a GitHub folder.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expectedRevision": {
                    "type": "integer",
                    "description": "Current `revision` of the skill (1 or higher)."
                  },
                  "expectedDigest": {
                    "type": "string",
                    "description": "Current `digest` of the skill."
                  },
                  "path": {
                    "type": "string",
                    "description": "Chunk mode, required: path of the file relative to the imported folder, as listed in the import manifest, for example `references/checklist.md`."
                  },
                  "offset": {
                    "type": "integer",
                    "description": "Chunk mode, required: byte offset to start reading at; `0` for the first chunk."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "review"
                    ],
                    "description": "Review mode, required: the literal `review`."
                  },
                  "version": {
                    "type": "integer",
                    "enum": [
                      1
                    ],
                    "description": "Review mode, required: must be `1`."
                  }
                },
                "required": [
                  "expectedRevision",
                  "expectedDigest"
                ]
              },
              "example": {
                "expectedRevision": 1,
                "expectedDigest": "b319cd42e0d80ea7822e03fee9fde34da4fc8846dfc9a22f1aa5ec883e321453",
                "path": "references/checklist.md",
                "offset": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Chunk mode: `{ filename, path, sha256, totalBytes, offset, base64, eof }`. Review mode: `{ review, materials }`, where `review` holds `version`, `profile`, `revision`, `digest`, `manifestDigest`, `files` (each with `path`, `bytes`, `sha256`) and `materializationDigest`, and `materials` repeats each file with its `text`.",
            "content": {
              "application/json": {
                "example": {
                  "filename": "checklist.md",
                  "path": "references/checklist.md",
                  "sha256": "420c6d8eeedcb16058fad5ce6b980729cf969757e6b5839ff374f6397e891318",
                  "totalBytes": 27,
                  "offset": 0,
                  "base64": "IyBDaGVja2xpc3QKLSBDaGVjayB0b3RhbHMK",
                  "eof": true
                }
              }
            }
          },
          "400": {
            "description": "`invalid_resource`: The body is malformed or mixes the two modes, the path is not a safe relative path, or the offset is past the end of the file.\n\n`resource_unsupported`: Review mode: the skill depends on something other than plain text reference files (`.md`, `.txt`, `.csv`, `.json`, `.yml`, `.yaml`).\n\n`resource_cycle`: Review mode: the reference files refer to each other in a loop.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_resource": {
                    "value": {
                      "error": "invalid_resource"
                    }
                  },
                  "resource_unsupported": {
                    "value": {
                      "error": "resource_unsupported"
                    }
                  },
                  "resource_cycle": {
                    "value": {
                      "error": "resource_cycle"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No custom skill in the workspace has this id. Chunk mode: the skill has no stored source files, or no file at `path`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`stale_skill`: `expectedRevision` or `expectedDigest` does not match the saved skill.\n\n`resource_unavailable`: The stored files are incomplete, or, in review mode, the skill has no stored source files. Import the source again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "stale_skill": {
                    "value": {
                      "error": "stale_skill"
                    }
                  },
                  "resource_unavailable": {
                    "value": {
                      "error": "resource_unavailable"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "`resource_limit`: Review mode: the referenced files exceed 128 KiB for one file, 256 KiB in total, 99 files or eight levels of references.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_limit": {
                    "value": {
                      "error": "resource_limit"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/skills/import-preview": {
      "post": {
        "operationId": "postSkillsImportPreview",
        "summary": "Preview a skill import",
        "description": "Parses and checks the document without saving a skill. The preview stores only a handle and a digest of the request, not the document, so the commit must send the same request again. A workspace can create 30 previews per minute, 20 per caller, and the serialised request is limited to 2 MiB.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#post-skills-import-preview"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "integer",
                    "enum": [
                      1
                    ],
                    "description": "Must be `1`."
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "skill-md",
                      "markdown",
                      "json"
                    ],
                    "description": "How to read `source`."
                  },
                  "source": {
                    "type": "string",
                    "description": "The document text itself, never a URL. At most 64 KiB for `skill-md` and `markdown`, and 1 MiB for `json`. A `SKILL.md` needs `name` (in the same form as `portableName`) and a non-empty `description` in its front matter; the text after the front matter becomes the instructions."
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Required for `markdown`: `portableName` (1 to 64 lower-case letters or digits separated by single hyphens), `name` and `description`, with optional `category` and `integration`."
                  },
                  "allowBatch": {
                    "type": "boolean",
                    "description": "Must be `true` to import a JSON document in the `agentbuilder.skills` form, whatever the number of records."
                  },
                  "choices": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "One entry per parsed record, in order. `{ \"kind\": \"create\" }` or `{ \"kind\": \"copy\" }` adds a new skill, optionally under another `name`. `{ \"kind\": \"replace\", \"id\": …, \"expectedRevision\": … }` overwrites an existing custom skill. Defaults to `create` for every record."
                  },
                  "github": {
                    "type": "object",
                    "description": "Present when the request was produced by the GitHub source endpoint: `repository`, `commit`, `folder` and `manifestDigest`. The server reads the pinned folder again and refuses the import if it no longer matches, so the errors of the GitHub source endpoint can also occur here. Such a request holds exactly one skill."
                  }
                },
                "required": [
                  "version",
                  "format",
                  "source"
                ]
              },
              "example": {
                "version": 1,
                "format": "markdown",
                "source": "Review every number.",
                "metadata": {
                  "portableName": "report-review",
                  "name": "Report review",
                  "description": "Review a report."
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An object with `previewId`, `expiresAt`, `digest` (of the request), `documents` (the parsed records, each with `portableName`, `content`, `frontmatter`, `extensions`, `origin`, `source` and `inspection`, plus `github` for a GitHub import), `diagnostics` (warnings with `code`, `severity`, `field`, `message` and `recordIndex`), `collisions` (clashes with existing skills: `index`, `id`, `name`, `revision`, `alternatives`) and `canCommit`. `canCommit` is `false` when a clash is unresolved or the workspace would exceed 200 custom skills.",
            "content": {
              "application/json": {
                "example": {
                  "previewId": "c2a4e6f8-1b3d-4f5a-8c7e-9d0b2a4c6e8f",
                  "expiresAt": "2026-11-28T10:30:00.123456+00:00",
                  "digest": "c5b8c372987a14d9044a5aba280f32283d0c889bc46afc3be2aee3174a94671d",
                  "documents": [
                    {
                      "portableName": "report-review",
                      "content": {
                        "name": "Report review",
                        "category": "Custom",
                        "description": "Review a report.",
                        "instructions": "Review every number."
                      },
                      "frontmatter": {
                        "name": "report-review",
                        "description": "Review a report."
                      },
                      "extensions": {},
                      "origin": {
                        "format": "markdown",
                        "sha256": "34c6ad962b4fcfc522d7fd1d1bb7c7872fc759aab8ca4703e3ed1e0ca33d1d6b",
                        "recordIndex": 0
                      },
                      "source": {
                        "format": "markdown",
                        "sha256": "34c6ad962b4fcfc522d7fd1d1bb7c7872fc759aab8ca4703e3ed1e0ca33d1d6b",
                        "bytes": 20,
                        "recordIndex": 0
                      },
                      "inspection": {
                        "resources": [],
                        "requirements": [],
                        "annotationRequired": true,
                        "dependenciesSatisfied": true,
                        "assignable": false
                      }
                    }
                  ],
                  "diagnostics": [],
                  "collisions": [],
                  "canCommit": true
                }
              }
            }
          },
          "400": {
            "description": "`invalid_import`: The request or the document is malformed. Parser findings are listed in `issues`. Nothing is partly accepted.\n\n`credential`: The document matches a credential pattern, such as a private key or an API token.\n\n`invalid_github_source`: The `github` object is malformed, or the document does not hold exactly one skill.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_import": {
                    "value": {
                      "error": "invalid_import"
                    }
                  },
                  "credential": {
                    "value": {
                      "error": "credential"
                    }
                  },
                  "invalid_github_source": {
                    "value": {
                      "error": "invalid_github_source"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: A `replace` choice names a skill that is not a custom skill of this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`github_source_changed`: The GitHub folder no longer matches the `manifestDigest` in the request. Fetch the source again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "github_source_changed": {
                    "value": {
                      "error": "github_source_changed"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "`invalid_import`: `source` or its metadata exceeds a size limit, or a JSON document holds more than 200 records. The status is 413 although the code is `invalid_import`.\n\n`import_too_large`: The serialised request exceeds 2 MiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_import": {
                    "value": {
                      "error": "invalid_import"
                    }
                  },
                  "import_too_large": {
                    "value": {
                      "error": "import_too_large"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "`import_rate_limit`: More than 30 previews in 60 seconds for the workspace, or 20 for the caller. The response carries `Retry-After: 60`.\n\n`preview_limit`: The workspace has 100 open previews, or 1,000 previews retained from the last 24 hours.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "import_rate_limit": {
                    "value": {
                      "error": "import_rate_limit"
                    }
                  },
                  "preview_limit": {
                    "value": {
                      "error": "preview_limit"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/skills/import": {
      "post": {
        "operationId": "postSkillsImport",
        "summary": "Commit a previewed skill import",
        "description": "Saves the previewed records as custom skills. `request` must be exactly the body that was previewed; a changed request needs a new preview. All records are saved together or none are. Repeating the call with the same `previewId`, `idempotencyKey` and `request` returns the original result with `replayed: true` instead of importing twice, until 24 hours after the preview was created.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member. Only the caller that created the preview (the same API key or the same signed-in user) can use it.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#post-skills-import"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "previewId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The `previewId` returned by the preview."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "format": "uuid",
                    "description": "A UUID you generate for this commit. Reuse it only to retry the same commit."
                  },
                  "request": {
                    "type": "object",
                    "description": "The exact import request that was previewed."
                  }
                },
                "required": [
                  "previewId",
                  "idempotencyKey",
                  "request"
                ]
              },
              "example": {
                "previewId": "c2a4e6f8-1b3d-4f5a-8c7e-9d0b2a4c6e8f",
                "idempotencyKey": "0e9d8c7b-6a5f-4e3d-9c2b-1a0f9e8d7c6b",
                "request": {
                  "version": 1,
                  "format": "markdown",
                  "source": "Review every number.",
                  "metadata": {
                    "portableName": "report-review",
                    "name": "Report review",
                    "description": "Review a report."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An object with `skills` (one `{ id, revision, digest }` per saved skill, in record order) and `replayed`.",
            "content": {
              "application/json": {
                "example": {
                  "skills": [
                    {
                      "id": "skill_7d6c5b4a-3f2e-4d1c-8b0a-9f8e7d6c5b4a",
                      "revision": 1,
                      "digest": "b319cd42e0d80ea7822e03fee9fde34da4fc8846dfc9a22f1aa5ec883e321453"
                    }
                  ],
                  "replayed": false
                }
              }
            }
          },
          "400": {
            "description": "`invalid_import`: The body is malformed, or `previewId` or `idempotencyKey` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_import": {
                    "value": {
                      "error": "invalid_import"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`preview_not_found`: No preview with this id belongs to the calling credential.\n\n`not_found`: A `replace` choice names a skill that no longer exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "preview_not_found": {
                    "value": {
                      "error": "preview_not_found"
                    }
                  },
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`preview_changed`: `request` differs from the request that was previewed.\n\n`preview_consumed`: The preview was already committed under another idempotency key.\n\n`idempotency_conflict`: The idempotency key was already used for a different preview or request.\n\n`name_conflict`: A record's name is now used by another skill. Preview again with a new name or a `replace` choice.\n\n`stale_skill`: A `replace` choice names a revision that is no longer current.\n\n`skill_in_use`: A `replace` choice would rename a skill that agents or macros still refer to.\n\n`catalog_limit`: The import would take the workspace past 200 custom skills.\n\n`github_source_changed`: GitHub import: the folder no longer matches the `manifestDigest` in the request.\n\n`catalog_busy`: The catalogue kept changing while the import was being saved. Nothing was saved; send the same call again.\n\n`import_outcome_unknown`: The result could not be confirmed. Retry with the same `previewId`, `idempotencyKey` and `request`; do not start a new import.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "preview_changed": {
                    "value": {
                      "error": "preview_changed"
                    }
                  },
                  "preview_consumed": {
                    "value": {
                      "error": "preview_consumed"
                    }
                  },
                  "idempotency_conflict": {
                    "value": {
                      "error": "idempotency_conflict"
                    }
                  },
                  "name_conflict": {
                    "value": {
                      "error": "name_conflict"
                    }
                  },
                  "stale_skill": {
                    "value": {
                      "error": "stale_skill"
                    }
                  },
                  "skill_in_use": {
                    "value": {
                      "error": "skill_in_use"
                    }
                  },
                  "catalog_limit": {
                    "value": {
                      "error": "catalog_limit"
                    }
                  },
                  "github_source_changed": {
                    "value": {
                      "error": "github_source_changed"
                    }
                  },
                  "catalog_busy": {
                    "value": {
                      "error": "catalog_busy"
                    }
                  },
                  "import_outcome_unknown": {
                    "value": {
                      "error": "import_outcome_unknown"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "`preview_expired`: The preview is older than 15 minutes.\n\n`preview_cancelled`: The preview was cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "preview_expired": {
                    "value": {
                      "error": "preview_expired"
                    }
                  },
                  "preview_cancelled": {
                    "value": {
                      "error": "preview_cancelled"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/skills/import-previews/{id}": {
      "delete": {
        "operationId": "deleteSkillsImportPreviewsById",
        "summary": "Cancel an import preview",
        "description": "Marks an open preview as cancelled so it can no longer be committed. No body is needed and the catalogue is not changed.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member. Only the caller that created the preview (the same API key or the same signed-in user) can use it.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#delete-skills-import-previews-id"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The `previewId` to cancel.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ \"cancelled\": true }`.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`preview_not_found`: No preview with this id belongs to the calling credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "preview_not_found": {
                    "value": {
                      "error": "preview_not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`preview_consumed`: The preview was already committed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "preview_consumed": {
                    "value": {
                      "error": "preview_consumed"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "`preview_expired`: The preview is older than 15 minutes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "preview_expired": {
                    "value": {
                      "error": "preview_expired"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/skills/github-source": {
      "post": {
        "operationId": "postSkillsGithubSource",
        "summary": "Discover or fetch a skill folder in a public GitHub repository",
        "description": "Reads the repository anonymously: no GitHub credential is accepted, and a private repository is reported as unavailable. `discover` resolves a branch, tag or commit to one commit and lists the folders that contain a `SKILL.md`. `fetch` reads one folder at that commit and returns an import request pinned to it; neither mode saves anything. A folder is limited to 100 files and 5 MiB, its `SKILL.md` to 64 KiB, and one call to 15 seconds.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Knowledge and skills"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/knowledge-skills#post-skills-github-source"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "integer",
                    "enum": [
                      1
                    ],
                    "description": "Must be `1`."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "discover",
                      "fetch"
                    ],
                    "description": "Which of the two operations to run."
                  },
                  "repository": {
                    "type": "string",
                    "description": "The public repository as `owner/name`. A URL is not accepted."
                  },
                  "folder": {
                    "type": "string",
                    "description": "Folder path inside the repository, without leading or trailing slashes and at most eight levels deep. An empty string means the repository root. In `discover` it narrows the search; in `fetch` it is the folder to import."
                  },
                  "ref": {
                    "type": "string",
                    "description": "`discover` only, required: the branch, tag or commit to resolve, at most 256 characters. Not allowed in `fetch`."
                  },
                  "commit": {
                    "type": "string",
                    "description": "`fetch` only, required: the full 40-character lower-case commit id returned by `discover`. Not allowed in `discover`."
                  }
                },
                "required": [
                  "version",
                  "mode",
                  "repository",
                  "folder"
                ]
              },
              "example": {
                "version": 1,
                "mode": "discover",
                "repository": "example-org/agent-skills",
                "ref": "main",
                "folder": ""
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`discover`: `{ commit, folders, limits }`, where `folders` lists `folder` itself and every folder below it that contains a `SKILL.md` (the repository root appears as an empty string). `fetch`: `{ request, manifest, limits }`, where `request` is an import request (`version`, `format`, `source`, `github`) to send to the import preview, and `manifest` describes the folder (`version`, `repository`, `commit`, `folder`, `sourceSha256`, `files` with `path`, `bytes`, `sha256`, `gitBlob` and `kind`, `license` when the skill declares one, and `manifestDigest`). `limits` repeats the size and time limits that apply.",
            "content": {
              "application/json": {
                "example": {
                  "commit": "1373f0c6fc4273b98b263d4b871fd35fbbdebce0",
                  "folders": [
                    "skills/report-review",
                    "skills/ticket-triage"
                  ],
                  "limits": {
                    "skillBytes": 65536,
                    "files": 100,
                    "folderBytes": 5242880,
                    "depth": 8,
                    "entries": 2000,
                    "requests": 128,
                    "concurrency": 4,
                    "requestMs": 5000,
                    "totalMs": 15000,
                    "metadataBytes": 1048576,
                    "wireBytes": 16777216,
                    "chunkBytes": 262144
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_github_source`: The body is malformed, contains an unknown field, or mixes `ref` and `commit` with the wrong mode.\n\n`credential`: The request, a file name or a file in the folder matches a credential pattern.\n\n`invalid_import`: `fetch`: the folder's `SKILL.md` is not a valid skill document, or its `name` differs from the name of the folder. Parser findings are listed in `issues`.\n\n`github_unsafe_entry`: The repository redirects, or the folder contains a symlink, a submodule, a Git LFS pointer or an unsafe path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_github_source": {
                    "value": {
                      "error": "invalid_github_source"
                    }
                  },
                  "credential": {
                    "value": {
                      "error": "credential"
                    }
                  },
                  "invalid_import": {
                    "value": {
                      "error": "invalid_import"
                    }
                  },
                  "github_unsafe_entry": {
                    "value": {
                      "error": "github_unsafe_entry"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`github_public_source_unavailable`: The repository, reference or folder was not found or is private, or the fetched folder has no `SKILL.md` of its own.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "github_public_source_unavailable": {
                    "value": {
                      "error": "github_public_source_unavailable"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "`github_limit`: The repository or folder exceeds one of the limits in `limits`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "github_limit": {
                    "value": {
                      "error": "github_limit"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "`github_rate_limit`: GitHub is rate limiting anonymous requests. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "github_rate_limit": {
                    "value": {
                      "error": "github_rate_limit"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "`github_upstream`: GitHub could not be reached or returned an inconsistent response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "github_upstream": {
                    "value": {
                      "error": "github_upstream"
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "`github_timeout`: GitHub did not answer within 5 seconds for one request or 15 seconds overall.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "github_timeout": {
                    "value": {
                      "error": "github_timeout"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/datasets": {
      "get": {
        "operationId": "getDatasets",
        "summary": "List datasets",
        "description": "Returns every dataset in the workspace with its case count, most recently updated first. The list is not paginated.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#get-datasets"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ datasets }`: an array of dataset objects with `id`, `name`, `description`, `dimension`, `source`, `caseCount`, `createdBy`, `createdAt` and `updatedAt`.",
            "content": {
              "application/json": {
                "example": {
                  "datasets": [
                    {
                      "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "name": "Containment baseline",
                      "description": "Cases every agent must pass before release",
                      "dimension": null,
                      "source": "manual",
                      "caseCount": 1,
                      "createdBy": "api-key:7c0e5d42-1a3b-4f68-9d2e-5b8a1c3f6e90",
                      "createdAt": "Sat Nov 28 2026 09:14:07 GMT+0000 (Coordinated Universal Time)",
                      "updatedAt": "Sat Nov 28 2026 09:16:22 GMT+0000 (Coordinated Universal Time)"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "postDatasets",
        "summary": "Create a dataset",
        "description": "Creates an empty dataset. Add cases to it afterwards, or use import to create a dataset together with its cases.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#post-datasets"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Dataset name. Surrounding whitespace is trimmed."
                  },
                  "description": {
                    "type": "string",
                    "description": "Free-text description."
                  },
                  "dimension": {
                    "type": "string",
                    "description": "Optional label for the dimension the dataset focuses on, for example `data_residency`. Stored as given; it neither restricts nor defaults the dimension of cases added through the API."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Containment baseline",
                "description": "Cases every agent must pass before release"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created dataset object (HTTP 201), with `caseCount` 0 and `source` `manual`.",
            "content": {
              "application/json": {
                "example": {
                  "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                  "name": "Containment baseline",
                  "description": "Cases every agent must pass before release",
                  "dimension": null,
                  "source": "manual",
                  "caseCount": 0,
                  "createdBy": "api-key:7c0e5d42-1a3b-4f68-9d2e-5b8a1c3f6e90",
                  "createdAt": "Sat Nov 28 2026 09:14:07 GMT+0000 (Coordinated Universal Time)",
                  "updatedAt": "Sat Nov 28 2026 09:14:07 GMT+0000 (Coordinated Universal Time)"
                }
              }
            }
          },
          "400": {
            "description": "`name_required`: `name` is missing, not a string, or blank.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "name_required": {
                    "value": {
                      "error": "name_required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/datasets/{id}": {
      "get": {
        "operationId": "getDatasetsById",
        "summary": "Get a dataset with its cases",
        "description": "Returns one dataset and all of its cases in the order they were added.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#get-datasets-id"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Dataset id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ dataset, cases }`. `dataset` is the dataset object; each entry of `cases` has `id`, `datasetId`, `title`, `dimension`, `request`, `expect`, `sourceReceiptId` (the run the case was created from, or `null`) and `createdAt`.",
            "content": {
              "application/json": {
                "example": {
                  "dataset": {
                    "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                    "name": "Containment baseline",
                    "description": "Cases every agent must pass before release",
                    "dimension": null,
                    "source": "manual",
                    "caseCount": 1,
                    "createdBy": "api-key:7c0e5d42-1a3b-4f68-9d2e-5b8a1c3f6e90",
                    "createdAt": "Sat Nov 28 2026 09:14:07 GMT+0000 (Coordinated Universal Time)",
                    "updatedAt": "Sat Nov 28 2026 09:16:22 GMT+0000 (Coordinated Universal Time)"
                  },
                  "cases": [
                    {
                      "id": "8a4d1f6c-2b9e-4c37-a5d0-7e1b3f9c6a28",
                      "datasetId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "title": "Record deletion stays above the ceiling",
                      "dimension": "manifest_ceiling",
                      "request": {
                        "action": "delete_record",
                        "object": {
                          "connector": "crm",
                          "type": "Record",
                          "dataClass": "confidential"
                        },
                        "placement": "cloud_connector_write"
                      },
                      "expect": {
                        "decision": "deny",
                        "reasonCode": "PKG_CEILING_NO_GRANT"
                      },
                      "sourceReceiptId": null,
                      "createdAt": "Sat Nov 28 2026 09:16:22 GMT+0000 (Coordinated Universal Time)"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No dataset with that id exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteDatasetsById",
        "summary": "Delete a dataset",
        "description": "Permanently deletes the dataset and its cases. Experiments that use the dataset are deleted with it, including their runs and schedules. This cannot be undone; export the dataset first if you may need it again.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#delete-datasets-id"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Dataset id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ ok: true }`.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No dataset with that id exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/datasets/{id}/cases": {
      "post": {
        "operationId": "postDatasetsByIdCases",
        "summary": "Add a case to a dataset",
        "description": "Adds a hand-written case and refreshes the dataset's `updatedAt`. The server checks only that `title` and `dimension` are non-empty strings and that `request` and `expect` are objects; it does not validate their contents. Always send `request.object` (an empty object is accepted), because a case without it makes every later run of the dataset fail.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#post-datasets-id-cases"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Dataset id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Short name for the case. Surrounding whitespace is trimmed."
                  },
                  "dimension": {
                    "type": "string",
                    "description": "What the case checks: `in_scope`, `default_deny`, `manifest_ceiling`, `data_residency`, `connector_scope`, `approval_required`, `obligations` or `delegation_containment`. This endpoint stores any non-empty value, but import accepts only these."
                  },
                  "request": {
                    "type": "object",
                    "description": "The policy request to evaluate.",
                    "properties": {
                      "action": {
                        "type": "string",
                        "description": "Action class, for example `summarize`, `draft`, `recommend`, `create_task`, `update_record`, `delete_record`, `send_message` or `execute_script`."
                      },
                      "object": {
                        "type": "object",
                        "description": "What the action operates on. Optional keys: `type`, `connector`, `resource` and `dataClass` (`public`, `internal`, `confidential`, `restricted` or `secrets`). Send it even when empty."
                      },
                      "placement": {
                        "type": "string",
                        "description": "Where the step would run, for example `local`, `cloud_model`, `cloud_connector` or `cloud_connector_write`."
                      }
                    }
                  },
                  "expect": {
                    "type": "object",
                    "description": "The outcome the case asserts. Every field you set must hold for the case to pass.",
                    "properties": {
                      "decision": {
                        "type": "string",
                        "enum": [
                          "allow",
                          "deny"
                        ],
                        "description": "The decision the policy must return. Without it the case can never pass."
                      },
                      "reasonCode": {
                        "type": "string",
                        "description": "Reason code the decision must carry exactly, for example `ALLOWED`, `LIMITED_OUTPUT`, `PKG_CEILING_NO_GRANT` or `DENY_RULE_MATCHED`."
                      },
                      "obligations": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Obligation kinds that must all be attached to the decision, for example `logging` or `limited_output`. Experiment runs do not attach the `approval` obligation, so a case that expects it fails in a run."
                      },
                      "survivingPlacements": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Placements that must remain allowed, for example `local`."
                      },
                      "deniedPlacements": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Placements that must not remain allowed, for example `cloud_model`."
                      }
                    }
                  }
                },
                "required": [
                  "title",
                  "dimension",
                  "request",
                  "expect"
                ]
              },
              "example": {
                "title": "Record deletion stays above the ceiling",
                "dimension": "manifest_ceiling",
                "request": {
                  "action": "delete_record",
                  "object": {
                    "connector": "crm",
                    "type": "Record",
                    "dataClass": "confidential"
                  },
                  "placement": "cloud_connector_write"
                },
                "expect": {
                  "decision": "deny",
                  "reasonCode": "PKG_CEILING_NO_GRANT"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created case (HTTP 201): `id`, `datasetId`, `title`, `dimension`, `request`, `expect`, `sourceReceiptId` (`null` for a hand-written case) and `createdAt`.",
            "content": {
              "application/json": {
                "example": {
                  "id": "8a4d1f6c-2b9e-4c37-a5d0-7e1b3f9c6a28",
                  "datasetId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                  "title": "Record deletion stays above the ceiling",
                  "dimension": "manifest_ceiling",
                  "request": {
                    "action": "delete_record",
                    "object": {
                      "connector": "crm",
                      "type": "Record",
                      "dataClass": "confidential"
                    },
                    "placement": "cloud_connector_write"
                  },
                  "expect": {
                    "decision": "deny",
                    "reasonCode": "PKG_CEILING_NO_GRANT"
                  },
                  "sourceReceiptId": null,
                  "createdAt": "Sat Nov 28 2026 09:16:22 GMT+0000 (Coordinated Universal Time)"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_case`: `title` or `dimension` is missing or blank, or `request` or `expect` is not an object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_case": {
                    "value": {
                      "error": "invalid_case"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No dataset with that id exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/datasets/{id}/cases/{caseId}": {
      "delete": {
        "operationId": "deleteDatasetsByIdCasesByCaseId",
        "summary": "Delete a case",
        "description": "Removes one case from the dataset and refreshes the dataset's `updatedAt`. Results of earlier experiment runs keep their copy of the case.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#delete-datasets-id-cases-caseid"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Dataset id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "caseId",
            "in": "path",
            "required": true,
            "description": "Case id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ ok: true }`.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No case with that id exists in that dataset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/datasets/{id}/cases/from-receipt": {
      "post": {
        "operationId": "postDatasetsByIdCasesFromReceipt",
        "summary": "Create a case from a run",
        "description": "Adds a case linked to a run through `sourceReceiptId` and sets the dataset's `source` to `production`. The case does not replay the run's own request and does not use the run's recorded decision. It is a standard request chosen from the most restrictive data class of the run's agent (`internal` when the run has no agent or the agent lists no data class): for `restricted` or `secrets` data, a `data_residency` case that expects the cloud placement to be denied while `local` survives; otherwise an `in_scope` case that expects `summarize` to be allowed.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#post-datasets-id-cases-from-receipt"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Dataset id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "receiptId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id of a run receipt in the workspace."
                  }
                },
                "required": [
                  "receiptId"
                ]
              },
              "example": {
                "receiptId": "5d9b0e3a-6c2f-4a71-8e4b-1f7c9d2a0b36"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created case (HTTP 201), in the same shape as a hand-written case, with `sourceReceiptId` set to the run.",
            "content": {
              "application/json": {
                "example": {
                  "id": "e5b1c8f2-0a7d-4d46-b3e9-4c6a2f8d1b05",
                  "datasetId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                  "title": "From run 5d9b0e3a — data residency",
                  "dimension": "data_residency",
                  "request": {
                    "action": "summarize",
                    "object": {
                      "resource": "local",
                      "dataClass": "restricted"
                    },
                    "placement": "cloud_model"
                  },
                  "expect": {
                    "decision": "allow",
                    "reasonCode": "LIMITED_OUTPUT",
                    "survivingPlacements": [
                      "local"
                    ],
                    "deniedPlacements": [
                      "cloud_model"
                    ]
                  },
                  "sourceReceiptId": "5d9b0e3a-6c2f-4a71-8e4b-1f7c9d2a0b36",
                  "createdAt": "Sat Nov 28 2026 09:18:45 GMT+0000 (Coordinated Universal Time)"
                }
              }
            }
          },
          "400": {
            "description": "`receipt_required`: `receiptId` is missing or not a string.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "receipt_required": {
                    "value": {
                      "error": "receipt_required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: The dataset or the run does not exist in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/datasets/{id}/cases/from-annotation": {
      "post": {
        "operationId": "postDatasetsByIdCasesFromAnnotation",
        "summary": "Create a case from a reviewer's verdict on a run",
        "description": "Adds a case backed by a human verdict recorded on a run (verdicts are recorded with `POST /api/receipts/{id}/annotations`) and sets the dataset's `source` to `production`. A `correct` verdict on a run that was not denied, or an `incorrect` verdict corrected to an allow, yields the same standard request as creating a case from a run; it asserts that request's standard expectation for a `correct` verdict and the reviewer's corrected expectation for an `incorrect` one. A `correct` verdict on a denied run, or an `incorrect` verdict with any other correction (normally a deny), yields a containment case for `manifest_ceiling`, `default_deny` or `data_residency`, and only if that case passes at the authority level of the run's agent (`recommend` when the run has no agent). The title ends in `(human-verified)` or `(human-corrected)`.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#post-datasets-id-cases-from-annotation"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Dataset id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "receiptId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id of the annotated run receipt."
                  },
                  "annotatedBy": {
                    "type": "string",
                    "description": "Identity of the reviewer whose verdict to use. Defaults to the caller: the signed-in user's id, or `api-key:` followed by the key id for an API key."
                  }
                },
                "required": [
                  "receiptId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created case (HTTP 201), in the same shape as a hand-written case, with `sourceReceiptId` set to the run.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`receipt_required`: `receiptId` is missing or not a string.\n\n`not_promotable`: The verdict cannot become a case. The response's `refusal` field says why: `not_promotable` for an `unsure` verdict, an `incorrect` verdict without a correction, or a confirmed deny that was not caused by policy containment (for example a revoked agent or an exceeded budget); `dimension_required` for a correction to deny whose annotation does not name `manifest_ceiling`, `default_deny` or `data_residency`; `probe_unavailable` when no containment case for that dimension passes against the workspace's current policy.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "receipt_required": {
                    "value": {
                      "error": "receipt_required"
                    }
                  },
                  "not_promotable": {
                    "value": {
                      "error": "not_promotable"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: The dataset or the run does not exist in the workspace.\n\n`annotation_not_found`: That reviewer has recorded no verdict on the run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  },
                  "annotation_not_found": {
                    "value": {
                      "error": "annotation_not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/datasets/{id}/export": {
      "get": {
        "operationId": "getDatasetsByIdExport",
        "summary": "Export a dataset as JSON or CSV text",
        "description": "Returns the serialized dataset inside a JSON response, not as a file download; write `content` to a file yourself. The JSON form is an envelope with `version`, `name`, `description`, `dimension` and `cases`. The CSV form has the columns `title`, `dimension`, `request_json`, `expect_json` and `source_receipt_id`.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#get-datasets-id-export"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Dataset id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Serialization format. Defaults to `json`; any value other than `csv` is treated as `json`.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ filename, contentType, content }`. `content` is the serialized dataset as one string, `filename` is a suggested file name derived from the dataset name, and `contentType` is `application/json` or `text/csv`.",
            "content": {
              "application/json": {
                "example": {
                  "filename": "containment-baseline.json",
                  "contentType": "application/json",
                  "content": "{\n  \"version\": 1,\n  \"name\": \"Containment baseline\",\n  \"description\": \"Cases every agent must pass before release\",\n  \"dimension\": null,\n  \"cases\": [\n    {\n      \"title\": \"Record deletion stays above the ceiling\",\n      \"dimension\": \"manifest_ceiling\",\n      \"request\": {\n        \"action\": \"delete_record\",\n        \"object\": {\n          \"connector\": \"crm\",\n          \"type\": \"Record\",\n          \"dataClass\": \"confidential\"\n        },\n        \"placement\": \"cloud_connector_write\"\n      },\n      \"expect\": {\n        \"decision\": \"deny\",\n        \"reasonCode\": \"PKG_CEILING_NO_GRANT\"\n      },\n      \"sourceReceiptId\": null\n    }\n  ]\n}"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No dataset with that id exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/datasets/import": {
      "post": {
        "operationId": "postDatasetsImport",
        "summary": "Import a dataset from JSON or CSV text",
        "description": "Always creates a new dataset; it never merges into an existing one. A case is skipped, with a warning, when its title is missing, its dimension is not one of the known values, or its `request` or `expect` is not an object. Every `sourceReceiptId` (CSV column `source_receipt_id`) must be `null` or the id of a run in this workspace: any other value, including an empty CSV cell, makes the request fail with a server error after the dataset and any earlier cases have been stored. The import is written to the audit log as `dataset.import`.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#post-datasets-import"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Format of `text`. Defaults to `json`; any value other than `csv` is treated as `json`.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "The file contents to import, as one string. JSON is the export envelope or a bare array of cases. CSV needs the header columns `title`, `dimension`, `request_json` and `expect_json`; include `source_receipt_id` only when every row has a run id. A CSV export of cases that have no source run has empty cells in that column, so remove the column before importing it."
                  },
                  "name": {
                    "type": "string",
                    "description": "Name for the new dataset. Defaults to the name in a JSON envelope, otherwise `Imported dataset`."
                  }
                },
                "required": [
                  "text"
                ]
              },
              "example": {
                "text": "{\"version\":1,\"name\":\"Containment baseline\",\"cases\":[{\"title\":\"Record deletion stays above the ceiling\",\"dimension\":\"manifest_ceiling\",\"request\":{\"action\":\"delete_record\",\"object\":{\"connector\":\"crm\",\"type\":\"Record\",\"dataClass\":\"confidential\"},\"placement\":\"cloud_connector_write\"},\"expect\":{\"decision\":\"deny\",\"reasonCode\":\"PKG_CEILING_NO_GRANT\"}}]}"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "`{ datasetId, imported, skipped, warnings }` (HTTP 201): the id of the new dataset, the number of cases imported, the number of cases skipped and one message per skipped case.",
            "content": {
              "application/json": {
                "example": {
                  "datasetId": "a2d6f0b4-9c1e-4b57-8f3a-7e5c0d2b9a16",
                  "imported": 1,
                  "skipped": 0,
                  "warnings": []
                }
              }
            }
          },
          "400": {
            "description": "`empty`: `text` is missing, not a string, or blank.\n\n`no_cases`: The text contains no valid case, for example because it is not valid JSON or the CSV header is incomplete. The response also carries `warnings` and `skipped`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "empty": {
                    "value": {
                      "error": "empty"
                    }
                  },
                  "no_cases": {
                    "value": {
                      "error": "no_cases"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/experiments": {
      "get": {
        "operationId": "getExperiments",
        "summary": "List experiments",
        "description": "Returns every experiment in the workspace, newest first, with its dataset name and run count. The list is not paginated.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#get-experiments"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ experiments }`: an array of experiment objects with `id`, `datasetId`, `datasetName`, `name`, `runCount`, `createdBy` and `createdAt`.",
            "content": {
              "application/json": {
                "example": {
                  "experiments": [
                    {
                      "id": "6e2b8c4f-1a9d-4f30-8b7e-3c5d0a9f2e14",
                      "datasetId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "datasetName": "Containment baseline",
                      "name": "Authority level comparison",
                      "runCount": 2,
                      "createdBy": "api-key:7c0e5d42-1a3b-4f68-9d2e-5b8a1c3f6e90",
                      "createdAt": "Sat Nov 28 2026 09:20:03 GMT+0000 (Coordinated Universal Time)"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "postExperiments",
        "summary": "Create an experiment over a dataset",
        "description": "Creates an experiment bound to one dataset. The dataset cannot be changed afterwards.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#post-experiments"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "datasetId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id of a dataset in the workspace."
                  },
                  "name": {
                    "type": "string",
                    "description": "Experiment name. Surrounding whitespace is trimmed."
                  }
                },
                "required": [
                  "datasetId",
                  "name"
                ]
              },
              "example": {
                "datasetId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                "name": "Authority level comparison"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created experiment object (HTTP 201), with `runCount` 0.",
            "content": {
              "application/json": {
                "example": {
                  "id": "6e2b8c4f-1a9d-4f30-8b7e-3c5d0a9f2e14",
                  "datasetId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                  "datasetName": "Containment baseline",
                  "name": "Authority level comparison",
                  "runCount": 0,
                  "createdBy": "api-key:7c0e5d42-1a3b-4f68-9d2e-5b8a1c3f6e90",
                  "createdAt": "Sat Nov 28 2026 09:20:03 GMT+0000 (Coordinated Universal Time)"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`: `datasetId` or `name` is missing or blank.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_request": {
                    "value": {
                      "error": "invalid_request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No dataset with that id exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/experiments/{id}": {
      "get": {
        "operationId": "getExperimentsById",
        "summary": "Get an experiment with its runs",
        "description": "Returns one experiment and all of its runs, oldest first. Each run carries its full stored result, so the response grows with the number of runs and cases.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#get-experiments-id"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Experiment id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ experiment, runs }`. `experiment` is the experiment object; each entry of `runs` is a run object as returned by `POST /api/experiments/{id}/run`.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No experiment with that id exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/experiments/{id}/run": {
      "post": {
        "operationId": "postExperimentsByIdRun",
        "summary": "Run the experiment's dataset at an authority level",
        "description": "Evaluates every case of the experiment's dataset against the policy for one authority level and stores the outcome as a new run. The request completes synchronously and calls no model. `agentId` only attaches the run to an agent and names it in the default label; the evaluation depends on the authority level, not on the agent's configuration. A dataset without cases produces a run with `total` 0 and `passRate` 1.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#post-experiments-id-run"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Experiment id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "authority": {
                    "type": "string",
                    "description": "Authority level to evaluate: `answer`, `draft`, `recommend`, `prepare_action`, `execute_with_approval` or `execute_automatically`. The value is not validated; an unrecognised level is evaluated like `answer`."
                  },
                  "agentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id of an agent in the workspace to attach the run to."
                  },
                  "label": {
                    "type": "string",
                    "description": "Name for the run. Defaults to the agent's name, an `@` and the authority when `agentId` is set (for example `Renewals assistant @ recommend`), otherwise to the authority."
                  }
                },
                "required": [
                  "authority"
                ]
              },
              "example": {
                "authority": "recommend",
                "label": "Baseline at recommend"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created run (HTTP 201): `id`, `experimentId`, `label`, `agentId`, `authority`, `policyBundleId` (an identifier derived from the workspace; it is the same for every authority level), `passRate` (0 to 1), `passed`, `failed`, `createdAt` and `result`. `result` holds `packageId` (the agent id, or the authority when no agent was given), `policyBundleId`, `total`, `passed`, `failed`, `passRate`, `byDimension`, `evaluatedAt` and `cases`; each entry of `cases` has the `case`, the full policy `decision`, `passed` and a `failures` list that explains every mismatch.",
            "content": {
              "application/json": {
                "example": {
                  "id": "d1a7e5c3-9f2b-4e86-a4c0-6b8d2f0e7a95",
                  "experimentId": "6e2b8c4f-1a9d-4f30-8b7e-3c5d0a9f2e14",
                  "label": "Baseline at recommend",
                  "agentId": null,
                  "authority": "recommend",
                  "policyBundleId": "tenant-policy-9b2e4c1a",
                  "result": {
                    "packageId": "recommend",
                    "policyBundleId": "tenant-policy-9b2e4c1a",
                    "total": 1,
                    "passed": 1,
                    "failed": 0,
                    "passRate": 1,
                    "byDimension": {
                      "manifest_ceiling": {
                        "passed": 1,
                        "total": 1
                      }
                    },
                    "cases": [
                      {
                        "case": {
                          "id": "8a4d1f6c-2b9e-4c37-a5d0-7e1b3f9c6a28",
                          "title": "Record deletion stays above the ceiling",
                          "dimension": "manifest_ceiling",
                          "request": {
                            "action": "delete_record",
                            "object": {
                              "connector": "crm",
                              "type": "Record",
                              "dataClass": "confidential"
                            },
                            "placement": "cloud_connector_write"
                          },
                          "expect": {
                            "decision": "deny",
                            "reasonCode": "PKG_CEILING_NO_GRANT"
                          }
                        },
                        "decision": {
                          "action": "delete_record",
                          "object": {
                            "connector": "crm",
                            "type": "Record",
                            "dataClass": "confidential"
                          },
                          "placement_requested": "cloud_connector_write",
                          "decision": "deny",
                          "reason_code": "PKG_CEILING_NO_GRANT",
                          "applicable_allowlist_layers": [
                            "tenant_admin",
                            "package_manifest",
                            "role_team",
                            "user_identity",
                            "connector_scope"
                          ],
                          "allow_rules_matched": [],
                          "allowlist_layers_missing_grant": [
                            "tenant_admin",
                            "package_manifest",
                            "role_team",
                            "user_identity",
                            "connector_scope"
                          ],
                          "deny_rules_matched": [],
                          "obligations": [
                            {
                              "kind": "logging",
                              "layer": "law_regulation",
                              "ruleId": "obl_logging_8",
                              "reason": "audit_all_runs"
                            }
                          ],
                          "surviving_placements": [
                            "local",
                            "cloud_model",
                            "cloud_connector",
                            "cloud_connector_write"
                          ],
                          "evaluated_at": "2026-11-28T09:21:30.118Z",
                          "policy_bundle_id": "tenant-policy-9b2e4c1a"
                        },
                        "passed": true,
                        "failures": []
                      }
                    ],
                    "evaluatedAt": "2026-11-28T09:21:30.118Z"
                  },
                  "passRate": 1,
                  "passed": 1,
                  "failed": 0,
                  "createdAt": "Sat Nov 28 2026 09:21:30 GMT+0000 (Coordinated Universal Time)"
                }
              }
            }
          },
          "400": {
            "description": "`authority_required`: `authority` is missing, not a string, or blank.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authority_required": {
                    "value": {
                      "error": "authority_required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: The experiment does not exist in the workspace, or `agentId` names an agent that does not.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/experiments/{id}/diff": {
      "get": {
        "operationId": "getExperimentsByIdDiff",
        "summary": "Compare two runs of an experiment case by case",
        "description": "Lines the two runs up by case id and reports the decision, reason code and pass state on each side. A row counts as changed when the decision or the pass state differs; a difference in reason code alone does not. A case that exists in only one run is compared against a placeholder side whose decision is `-`. Rows follow the case order of run `a`, then cases found only in run `b`.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#get-experiments-id-diff"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Experiment id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "a",
            "in": "query",
            "required": true,
            "description": "Id of the first run. It must belong to this experiment.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "b",
            "in": "query",
            "required": true,
            "description": "Id of the second run. It must belong to this experiment.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ rows, changed }`. Each row has `caseId`, `title`, `dimension`, the sides `a` and `b` (each with `decision`, `reasonCode` and `passed`) and a `changed` flag. The top-level `changed` is the number of changed rows.",
            "content": {
              "application/json": {
                "example": {
                  "rows": [
                    {
                      "caseId": "8a4d1f6c-2b9e-4c37-a5d0-7e1b3f9c6a28",
                      "title": "Record deletion stays above the ceiling",
                      "dimension": "manifest_ceiling",
                      "a": {
                        "decision": "deny",
                        "reasonCode": "PKG_CEILING_NO_GRANT",
                        "passed": true
                      },
                      "b": {
                        "decision": "deny",
                        "reasonCode": "PKG_CEILING_NO_GRANT",
                        "passed": true
                      },
                      "changed": false
                    },
                    {
                      "caseId": "b7e2c9a4-5f1d-4b83-9c6e-0d4a8f2e1b57",
                      "title": "Record update needs execute authority",
                      "dimension": "manifest_ceiling",
                      "a": {
                        "decision": "deny",
                        "reasonCode": "PKG_CEILING_NO_GRANT",
                        "passed": true
                      },
                      "b": {
                        "decision": "allow",
                        "reasonCode": "ALLOWED",
                        "passed": false
                      },
                      "changed": true
                    }
                  ],
                  "changed": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: Either run id does not exist in this experiment, including a run that belongs to another experiment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/experiments/{id}/schedule": {
      "get": {
        "operationId": "getExperimentsByIdSchedule",
        "summary": "Get an experiment's schedule and recent scheduled re-runs",
        "description": "Returns the schedule and up to 20 of its most recent scheduled re-runs, newest first. An experiment without a schedule, or an unknown experiment id, returns `schedule` `null` and an empty `runs` array. `status` is `ok` (compared, no regression), `regressed`, `no_baseline` (nothing to compare against) or `error`.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#get-experiments-id-schedule"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Experiment id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ schedule, runs }`. `schedule` has `id`, `experimentId`, `datasetId`, `targetAgentId`, `targetAuthority`, `baselineRunId`, `cadenceHours`, `enabled`, `lastRunAt` and `nextRunAt` (ISO 8601 or `null`). Each entry of `runs` has `id`, `scheduleId`, `experimentRunId`, `status`, `regressedCount`, `criticalCount`, `detail` (`{ regressions }`, or `{ error }` for a failed re-run), `triggeredAt` and `completedAt`.",
            "content": {
              "application/json": {
                "example": {
                  "schedule": {
                    "id": "c4f8a1d7-3e6b-4d92-b0a5-9e2c7f1d4a63",
                    "experimentId": "6e2b8c4f-1a9d-4f30-8b7e-3c5d0a9f2e14",
                    "datasetId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                    "targetAgentId": null,
                    "targetAuthority": "execute_with_approval",
                    "baselineRunId": "d1a7e5c3-9f2b-4e86-a4c0-6b8d2f0e7a95",
                    "cadenceHours": 24,
                    "enabled": true,
                    "lastRunAt": "2026-11-28T10:00:04.731Z",
                    "nextRunAt": "2026-11-29T10:00:04.731Z"
                  },
                  "runs": [
                    {
                      "id": "f2c6b0e8-7d4a-4a19-9e3f-5a1c8d6b2e70",
                      "scheduleId": "c4f8a1d7-3e6b-4d92-b0a5-9e2c7f1d4a63",
                      "experimentRunId": "a9e3d7b1-4c8f-4b25-8d6a-2f0e5c9b1d47",
                      "status": "regressed",
                      "regressedCount": 1,
                      "criticalCount": 1,
                      "detail": {
                        "regressions": [
                          {
                            "caseId": "b7e2c9a4-5f1d-4b83-9c6e-0d4a8f2e1b57",
                            "title": "Record update needs execute authority",
                            "dimension": "manifest_ceiling",
                            "critical": true,
                            "before": {
                              "passed": true,
                              "decision": "deny"
                            },
                            "after": {
                              "passed": false,
                              "decision": "allow"
                            }
                          }
                        ]
                      },
                      "triggeredAt": "2026-11-28T10:00:04.512Z",
                      "completedAt": "2026-11-28T10:00:04.512Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "postExperimentsByIdSchedule",
        "summary": "Create or replace an experiment's schedule",
        "description": "Creates the schedule, or replaces the existing one as a whole: optional fields you leave out are reset to their defaults (no agent, no baseline, 24 hours, enabled) rather than kept. A new schedule is due immediately and runs at the next hourly check; replacing a schedule does not move its next run time. The change is written to the audit log as `experiment.schedule`.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#post-experiments-id-schedule"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Experiment id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "authority": {
                    "type": "string",
                    "description": "Authority level to re-run: `answer`, `draft`, `recommend`, `prepare_action`, `execute_with_approval` or `execute_automatically`. The value is not validated; an unrecognised level is evaluated like `answer`."
                  },
                  "agentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id of an agent in the workspace to attach the scheduled runs to."
                  },
                  "baselineRunId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Id of a run of this experiment to compare each re-run against. Without it, re-runs are stored with status `no_baseline`."
                  },
                  "cadenceHours": {
                    "type": "number",
                    "description": "Minimum hours between re-runs. A number greater than 0, rounded down to whole hours; a value below 1 is stored as 0, which makes the schedule due at every hourly check. Defaults to 24, also when the value is not a positive number."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "Set to `false` to pause the schedule. Defaults to `true`."
                  }
                },
                "required": [
                  "authority"
                ]
              },
              "example": {
                "authority": "execute_with_approval",
                "baselineRunId": "d1a7e5c3-9f2b-4e86-a4c0-6b8d2f0e7a95",
                "cadenceHours": 24
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved schedule (HTTP 200): `id`, `experimentId`, `datasetId`, `targetAgentId`, `targetAuthority`, `baselineRunId`, `cadenceHours`, `enabled`, `lastRunAt` and `nextRunAt`.",
            "content": {
              "application/json": {
                "example": {
                  "id": "c4f8a1d7-3e6b-4d92-b0a5-9e2c7f1d4a63",
                  "experimentId": "6e2b8c4f-1a9d-4f30-8b7e-3c5d0a9f2e14",
                  "datasetId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                  "targetAgentId": null,
                  "targetAuthority": "execute_with_approval",
                  "baselineRunId": "d1a7e5c3-9f2b-4e86-a4c0-6b8d2f0e7a95",
                  "cadenceHours": 24,
                  "enabled": true,
                  "lastRunAt": null,
                  "nextRunAt": "2026-11-28T09:25:12.406Z"
                }
              }
            }
          },
          "400": {
            "description": "`authority_required`: `authority` is missing, not a string, or blank.\n\n`invalid_baseline`: `baselineRunId` is not a run of this experiment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authority_required": {
                    "value": {
                      "error": "authority_required"
                    }
                  },
                  "invalid_baseline": {
                    "value": {
                      "error": "invalid_baseline"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: The experiment does not exist in the workspace, or `agentId` names an agent that does not.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteExperimentsByIdSchedule",
        "summary": "Delete an experiment's schedule",
        "description": "Removes the schedule together with its list of scheduled re-runs. The experiment runs those re-runs created are kept. The call succeeds even when the experiment has no schedule.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#delete-experiments-id-schedule"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Experiment id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ ok: true }`.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/annotations/queue": {
      "get": {
        "operationId": "getAnnotationsQueue",
        "summary": "List the runs that most need a human verdict",
        "description": "Looks at the 500 most recent runs in the workspace, leaves out those that already have a verdict, and orders the rest by priority, then oldest first. The `reason` sets the priority: `sensitive_allow` (40) for an allowed run of an agent whose authority is `prepare_action` or higher, `guardrail_flagged` (30) for a run whose guardrails failed, `denied_decision` (20) for a denied run and `unreviewed` (10) for any other run.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#get-annotations-queue"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of items. Defaults to 100; values above 200 are capped at 200.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "includeAnnotated",
            "in": "query",
            "required": false,
            "description": "Set to `true` or `1` to also include runs that already have a verdict. Any other value leaves them out.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ queue }`: an array of items with `receiptId`, `reason`, `priority`, `agentId`, `agentName`, `model`, `authority` (the agent's current authority level, or `null`), `decision` (`allow`, `deny` or `null`), `reasonCode`, `guardrailsPassed`, `promptPreview` (the first 160 characters of the prompt, followed by `…` when it was cut), `createdAt` (ISO 8601) and `annotationCount`.",
            "content": {
              "application/json": {
                "example": {
                  "queue": [
                    {
                      "receiptId": "5d9b0e3a-6c2f-4a71-8e4b-1f7c9d2a0b36",
                      "reason": "sensitive_allow",
                      "priority": 40,
                      "agentId": "2c7f9a1e-8b3d-4e60-a9f4-0d6b5c3e1a82",
                      "agentName": "Renewals assistant",
                      "model": "example-provider/example-model",
                      "authority": "execute_with_approval",
                      "decision": "allow",
                      "reasonCode": "ALLOWED",
                      "guardrailsPassed": true,
                      "promptPreview": "Update the renewal date on the account record from the attached note.",
                      "createdAt": "2026-11-27T16:42:10.305Z",
                      "annotationCount": 0
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/annotations/summary": {
      "get": {
        "operationId": "getAnnotationsSummary",
        "summary": "Get reviewer agreement with governance decisions",
        "description": "Adds up every verdict recorded in the workspace, overall and per agent. `correctnessRate` is `correct` divided by `correct` plus `incorrect`, and is `null` when there is no decisive verdict. `byDimension` counts only verdicts that name a dimension. `perAgent` lists agents with at least one verdict, lowest rate first.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Datasets, experiments and annotations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/evaluations#get-annotations-summary"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ agreement, perAgent }`. `agreement` has `total`, `correct`, `incorrect`, `unsure`, `correctnessRate` and `byDimension`. Each entry of `perAgent` has `agentId`, `agentName` and the same six fields.",
            "content": {
              "application/json": {
                "example": {
                  "agreement": {
                    "total": 12,
                    "correct": 9,
                    "incorrect": 2,
                    "unsure": 1,
                    "correctnessRate": 0.8181818181818182,
                    "byDimension": {
                      "manifest_ceiling": {
                        "correct": 3,
                        "incorrect": 1,
                        "unsure": 0
                      },
                      "data_residency": {
                        "correct": 2,
                        "incorrect": 0,
                        "unsure": 0
                      }
                    }
                  },
                  "perAgent": [
                    {
                      "agentId": "2c7f9a1e-8b3d-4e60-a9f4-0d6b5c3e1a82",
                      "agentName": "Renewals assistant",
                      "total": 5,
                      "correct": 3,
                      "incorrect": 2,
                      "unsure": 0,
                      "correctnessRate": 0.6,
                      "byDimension": {
                        "manifest_ceiling": {
                          "correct": 1,
                          "incorrect": 1,
                          "unsure": 0
                        }
                      }
                    },
                    {
                      "agentId": "9d4e1b7a-3f6c-4c28-b5e0-8a2f7d1c6b39",
                      "agentName": "Policy helper",
                      "total": 7,
                      "correct": 6,
                      "incorrect": 0,
                      "unsure": 1,
                      "correctnessRate": 1,
                      "byDimension": {
                        "manifest_ceiling": {
                          "correct": 2,
                          "incorrect": 0,
                          "unsure": 0
                        },
                        "data_residency": {
                          "correct": 2,
                          "incorrect": 0,
                          "unsure": 0
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/dashboard": {
      "get": {
        "operationId": "getDashboard",
        "summary": "Get the workspace dashboard summary",
        "description": "Returns agent counts by status, all-time run totals, the five most recently updated agents and the five most recent run receipts. `runs.guardrailPassRate` is the share of all runs whose guardrails passed and `runs.avgLatencyMs` is the mean run latency; both are `null` when the workspace has no runs. `runs.totalCostUsd` is the all-time recorded model cost and equals `accounting.knownUsd`. When the calling API key can also read this data over MCP, the request counts against the shared MCP rate limit; see [rate limits](https://centerofagentic.com/docs/reference/rate-limits).\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Monitoring, alerts and webhooks"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/monitoring#get-dashboard"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object with `agents` (`total` and `byStatus`, a map of agent status to count), `runs` (`total`, `last7d`, `avgLatencyMs`, `totalCostUsd`, `guardrailPassRate`), `recentAgents` (up to five agent objects), `recentReceipts` (up to five run receipt objects, each with `agentName`) and `accounting`. Agent and receipt objects carry the same fields as in the agent and receipt list endpoints, except that agents here have no `activeGrant`.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/metrics/usage": {
      "get": {
        "operationId": "getMetricsUsage",
        "summary": "Get usage and cost trends for a 7, 30 or 90 day window",
        "description": "Aggregates runs, tokens, recorded cost and denial rate per calendar day (UTC) over the window, plus the ten agents with the highest cost, the ten most frequent denial reasons and cost by authority level. Days with no activity are omitted from `daily`, and `totals` is the sum of the `daily` series. Cost by authority groups runs by each agent's current authority level, so an agent whose authority changed is counted under its new level. Runs that have no agent count toward `daily` and `totals` but not toward the agent or authority breakdowns.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Monitoring, alerts and webhooks"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/monitoring#get-metrics-usage"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Window length in days, counted back from now. Defaults to `30`. Any other value is rejected.",
            "schema": {
              "type": "integer",
              "enum": [
                7,
                30,
                90
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An object with `windowDays`, `daily` (one entry per active day, oldest first: `date`, `runs`, `costUsd`, `tokens`, `denyRate`), `totals` (`runs`, `costUsd`, `tokens`, `denyRate`), `topAgentsByCost` (`agentId`, `agentName`, `runs`, `costUsd`), `topDenyReasons` (`reasonCode`, `count`; denials without a reason code are grouped as `unspecified`), `costByAuthority` (`authority`, `runs`, `costUsd`) and `accounting` for the window. `denyRate` is a fraction between 0 and 1.",
            "content": {
              "application/json": {
                "example": {
                  "windowDays": 7,
                  "daily": [
                    {
                      "date": "2026-11-26",
                      "runs": 40,
                      "costUsd": 0.31,
                      "tokens": 96000,
                      "denyRate": 0.05
                    },
                    {
                      "date": "2026-11-27",
                      "runs": 60,
                      "costUsd": 0.44,
                      "tokens": 132000,
                      "denyRate": 0.05
                    }
                  ],
                  "totals": {
                    "runs": 100,
                    "costUsd": 0.75,
                    "tokens": 228000,
                    "denyRate": 0.05
                  },
                  "topAgentsByCost": [
                    {
                      "agentId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "agentName": "Example agent",
                      "runs": 70,
                      "costUsd": 0.6
                    },
                    {
                      "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                      "agentName": "Second example agent",
                      "runs": 30,
                      "costUsd": 0.15
                    }
                  ],
                  "topDenyReasons": [
                    {
                      "reasonCode": "DENY_RULE_MATCHED",
                      "count": 3
                    },
                    {
                      "reasonCode": "PLACEMENT_DENIED",
                      "count": 2
                    }
                  ],
                  "costByAuthority": [
                    {
                      "authority": "recommend",
                      "runs": 70,
                      "costUsd": 0.6
                    },
                    {
                      "authority": "draft",
                      "runs": 30,
                      "costUsd": 0.15
                    }
                  ],
                  "accounting": {
                    "knownUsd": 0.75,
                    "legacyUnknownCount": 5,
                    "invalidCount": 0,
                    "unpricedCount": 0,
                    "unknownCount": 0,
                    "legacyCount": 100,
                    "journalCount": 0,
                    "coverageErased": false,
                    "historyBasis": "legacy-unverified"
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_window`: `window` is present, not empty and not `7`, `30` or `90`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_window": {
                    "value": {
                      "error": "invalid_window"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/metrics/spend": {
      "get": {
        "operationId": "getMetricsSpend",
        "summary": "Get month-to-date spend against the workspace cap",
        "description": "Returns the recorded model cost for the current calendar month (UTC) and the workspace's monthly spend cap, on the same basis that budget checks use before a run starts. If the monthly total cannot be verified, the endpoint returns `503` instead of a partial or zero figure.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Monitoring, alerts and webhooks"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/monitoring#get-metrics-spend"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object with `mtdSpendUsd`, `capUsd` (`null` when no cap is set), `accounting` for the month and `reservations`, a summary of cost estimates currently held for work in progress (`enabled`, `cutoverAt`, `heldEstimateUsd`, `ideaHeldMaximumUsd`, `openCount`, `uncertainCount`, `unpricedCount`, `expiredCount`, `overrunCount`, `admission`, `actualDollarBound`).",
            "content": {
              "application/json": {
                "example": {
                  "mtdSpendUsd": 12.5,
                  "capUsd": 250,
                  "accounting": {
                    "knownUsd": 12.5,
                    "legacyUnknownCount": 48,
                    "invalidCount": 0,
                    "unpricedCount": 0,
                    "unknownCount": 0,
                    "legacyCount": 1620,
                    "journalCount": 0,
                    "coverageErased": false,
                    "historyBasis": "legacy-unverified"
                  },
                  "reservations": {
                    "enabled": false,
                    "cutoverAt": null,
                    "heldEstimateUsd": 0,
                    "ideaHeldMaximumUsd": 0,
                    "openCount": 0,
                    "uncertainCount": 0,
                    "unpricedCount": 0,
                    "expiredCount": 0,
                    "overrunCount": 0,
                    "admission": "estimate_only",
                    "actualDollarBound": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "description": "`spend_state_unavailable`: The month's recorded cost is invalid or incomplete after data retention, or the spend state cannot be read right now. The body also carries a `detail` message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "spend_state_unavailable": {
                    "value": {
                      "error": "spend_state_unavailable"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/metrics/models": {
      "get": {
        "operationId": "getMetricsModels",
        "summary": "Get run, latency, token and cost metrics per model",
        "description": "Builds one row per model from all run receipts in the workspace: run counts, median and 95th-percentile latency, tokens, guardrail pass rate and denial rate, combined with the recorded cost for that model. Rows are ordered by run count; a model that has cost records but no receipts appears with `runs` of `0` and `null` latency. `costComparable` is `false` when the model has a record with an invalid cost or when the workspace-wide `accounting.coverageErased` is `true`. `lastUsed` is a date-time string in JavaScript's default date format (for example `Fri Nov 27 2026 16:42:10 GMT+0000 (Coordinated Universal Time)`), not ISO 8601.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Monitoring, alerts and webhooks"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/monitoring#get-metrics-models"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object with `models` and a workspace-wide `accounting`. Each model has `model`, `runs`, `billedRuns` (runs whose cost is taken from the run receipt), `p50Ms`, `p95Ms`, `avgLatencyMs`, `totalCostUsd`, `journalAttempts` (model calls recorded by the server-side usage journal), `legacyCostUsd` (the part of the cost taken from run receipts), `costComparable`, `totalTokens`, `passRate`, `denyRate`, `lastUsed` and, when cost records exist for the model, its own `accounting` breakdown (`bucket`, `knownUsd`, `legacyUsd` and the same counters, without `coverageErased` and `historyBasis`). Rates are fractions between 0 and 1, or `null` when there is nothing to measure.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/metrics/authority": {
      "get": {
        "operationId": "getMetricsAuthority",
        "summary": "Get authority check pass rates for scored receipts",
        "description": "Summarises every authority score recorded for the workspace, grouped by dimension. Only receipts that have been scored are counted, so trigger scoring first when `scoredReceipts` is `0`. `lastScoredAt` is a date-time string in JavaScript's default date format, not ISO 8601.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Monitoring, alerts and webhooks"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/monitoring#get-metrics-authority"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object with `dimensions` (`dimension`, `scored`, `passed`, `passRate` as a fraction between 0 and 1, `lastScoredAt`; ordered by `scored`, highest first) and `scoredReceipts`, the number of distinct receipts that have at least one score.",
            "content": {
              "application/json": {
                "example": {
                  "dimensions": [
                    {
                      "dimension": "default_deny",
                      "scored": 120,
                      "passed": 120,
                      "passRate": 1,
                      "lastScoredAt": "Fri Nov 27 2026 16:42:10 GMT+0000 (Coordinated Universal Time)"
                    },
                    {
                      "dimension": "manifest_ceiling",
                      "scored": 120,
                      "passed": 120,
                      "passRate": 1,
                      "lastScoredAt": "Fri Nov 27 2026 16:42:10 GMT+0000 (Coordinated Universal Time)"
                    },
                    {
                      "dimension": "data_residency",
                      "scored": 120,
                      "passed": 117,
                      "passRate": 0.975,
                      "lastScoredAt": "Fri Nov 27 2026 16:42:10 GMT+0000 (Coordinated Universal Time)"
                    }
                  ],
                  "scoredReceipts": 120
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "postMetricsAuthority",
        "summary": "Score recent unscored receipts against the authority checks",
        "description": "Takes up to 25 of the most recent receipts that belong to an agent and have no score yet, runs the baseline authority checks against each receipt's agent as it is configured now, and stores one pass or fail result per dimension. Receipts whose agent no longer exists are skipped. The request takes no body; call it again to work through a larger backlog.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Monitoring, alerts and webhooks"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/monitoring#post-metrics-authority"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "responses": {
          "200": {
            "description": "An object with `scored`, the number of receipts scored by this call.",
            "content": {
              "application/json": {
                "example": {
                  "scored": 25
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/fleet/governance": {
      "get": {
        "operationId": "getFleetGovernance",
        "summary": "Get the workspace-wide governance posture",
        "description": "Rolls up the fleet in one object: the authority levels held by approved or published agents, denial reasons and guardrail pass rate over the last 30 days, month-to-date spend against the cap, and runs waiting for approval. `postureScore` is a coarse 0 to 100 heuristic, and `authorityCreep.watchlist` lists agents with an execute-level authority and more than one version; use `GET /api/fleet/creep` for confirmed escalations. `spend.remainingUsd` is `null` when no cap is set. When spend cannot be verified the response is still `200`, with `spend` and `postureScore` set to `null`, no `accounting`, and a `spendError` object that carries the `spend_state_unavailable` code and a `detail` message.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Monitoring, alerts and webhooks"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/monitoring#get-fleet-governance"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object with `generatedAt`, `authorityDistribution` (`byLevel`, `total`, `highAuthorityCount`, `highAuthorityFraction`), `blockedByReason` (`byCode`, `top` with up to five reasons, `denialRate`, `totalRuns`, `totalDenials`), `spend` (`mtdSpendUsd`, `capUsd`, `utilization`, `remainingUsd`, `byAuthority`, `verdict` of `allow`, `warn` or `block`), `approvalBacklog` (`pending`, `agentsHeld`, `oldestPendingAt`, `oldestAgeHours`; both age fields are currently taken from the most recently created pending approval), `compliance` (`guardrailPassRate`, `sampled`, `posture` of `strong`, `watch`, `weak` or `unknown`), `authorityCreep` (`agentsWithEscalation`, `watchlist`), `postureScore` and `accounting` for the month.",
            "content": {
              "application/json": {
                "example": {
                  "generatedAt": "2026-11-28T09:14:07.000Z",
                  "authorityDistribution": {
                    "byLevel": {
                      "recommend": 6,
                      "execute_with_approval": 2
                    },
                    "total": 8,
                    "highAuthorityCount": 2,
                    "highAuthorityFraction": 0.25
                  },
                  "blockedByReason": {
                    "byCode": {
                      "DENY_RULE_MATCHED": 9,
                      "PLACEMENT_DENIED": 3
                    },
                    "top": [
                      {
                        "reasonCode": "DENY_RULE_MATCHED",
                        "label": "Deny rule",
                        "count": 9,
                        "pct": 75
                      },
                      {
                        "reasonCode": "PLACEMENT_DENIED",
                        "label": "Placement denied",
                        "count": 3,
                        "pct": 25
                      }
                    ],
                    "denialRate": 0.03,
                    "totalRuns": 400,
                    "totalDenials": 12
                  },
                  "spend": {
                    "mtdSpendUsd": 12.5,
                    "capUsd": 250,
                    "utilization": 0.05,
                    "remainingUsd": 237.5,
                    "byAuthority": {
                      "recommend": 9.25,
                      "execute_with_approval": 3.25
                    },
                    "verdict": "allow"
                  },
                  "approvalBacklog": {
                    "pending": 1,
                    "agentsHeld": 1,
                    "oldestPendingAt": "2026-11-28T07:14:07.000Z",
                    "oldestAgeHours": 2
                  },
                  "compliance": {
                    "guardrailPassRate": 0.97,
                    "sampled": 400,
                    "posture": "watch"
                  },
                  "authorityCreep": {
                    "agentsWithEscalation": 1,
                    "watchlist": [
                      {
                        "agentId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                        "name": "Example agent",
                        "authority": "execute_with_approval",
                        "versionCount": 3
                      }
                    ]
                  },
                  "postureScore": 91,
                  "accounting": {
                    "knownUsd": 12.5,
                    "legacyUnknownCount": 48,
                    "invalidCount": 0,
                    "unpricedCount": 0,
                    "unknownCount": 0,
                    "legacyCount": 1620,
                    "journalCount": 0,
                    "coverageErased": false,
                    "historyBasis": "legacy-unverified"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "description": "`fleet_state_unavailable`: The governance data itself could not be loaded. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "fleet_state_unavailable": {
                    "value": {
                      "error": "fleet_state_unavailable"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/fleet/creep": {
      "get": {
        "operationId": "getFleetCreep",
        "summary": "List agents whose latest version widened their authority",
        "description": "Compares the two most recent version snapshots of every agent and reports the agents whose newer version grants more authority or reduces oversight, with the specific changes. `coverage` shows how many agents had two snapshots to compare. An empty `confirmed` list with low coverage means there is not enough version history yet, not that nothing changed.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Monitoring, alerts and webhooks"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/monitoring#get-fleet-creep"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object with `confirmed` (most severe first: `agentId`, `name`, `authority`, `fromVersion`, `toVersion`, `escalations`, `critical`) and `coverage` (`agentsWithSnapshots`, `diffable`, `skippedSingleSnapshot`). Each escalation has `field`, `label`, `before`, `after` and `severity` (`info`, `notable` or `critical`); `critical` is the number of critical escalations.",
            "content": {
              "application/json": {
                "example": {
                  "confirmed": [
                    {
                      "agentId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "name": "Example agent",
                      "authority": "execute_with_approval",
                      "fromVersion": "1.2.0",
                      "toVersion": "1.3.0",
                      "escalations": [
                        {
                          "field": "spec.authorityLevel",
                          "label": "Authority level",
                          "before": "recommend",
                          "after": "execute_with_approval",
                          "severity": "critical"
                        }
                      ],
                      "critical": 1
                    }
                  ],
                  "coverage": {
                    "agentsWithSnapshots": 8,
                    "diffable": 5,
                    "skippedSingleSnapshot": 3
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/fleet/alerts": {
      "get": {
        "operationId": "getFleetAlerts",
        "summary": "List active governance alerts",
        "description": "Returns up to 100 unresolved alerts recorded for the workspace, ordered by severity (critical, then warning) and then newest first. Today only `authority_creep` alerts are recorded; the other alert kinds are sent to alert channels but not stored. No operation marks an alert as resolved today, so a recorded alert stays in the list. Alerts are recorded by the hourly evaluation, so the list stays empty for a workspace without an enabled alert channel; `GET /api/fleet/creep` gives the live view in that case.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Monitoring, alerts and webhooks"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/monitoring#get-fleet-alerts"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object with `alerts`. Each alert has `id`, `kind`, `severity` (`info`, `warning` or `critical`), `ruleId`, `agentId`, `message`, `observed`, `threshold`, `asOf`, `firedAt` and `payload`. For `authority_creep`, `observed` is the number of escalating changes and `payload.escalations` lists them.",
            "content": {
              "application/json": {
                "example": {
                  "alerts": [
                    {
                      "id": "8b0e6f3a-52c1-4d7e-9a34-1c2d3e4f5a6b",
                      "kind": "authority_creep",
                      "severity": "critical",
                      "ruleId": "alert.authority_creep:3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "agentId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "message": "Example agent escalated authority from v1.2.0 to v1.3.0: 1 escalating change(s) (1 critical) — Authority level.",
                      "observed": 1,
                      "threshold": 1,
                      "asOf": "2026-11-27T16:42:10.000Z",
                      "firedAt": "2026-11-27T17:02:03.000Z",
                      "payload": {
                        "escalations": [
                          {
                            "field": "spec.authorityLevel",
                            "label": "Authority level",
                            "before": "recommend",
                            "after": "execute_with_approval",
                            "severity": "critical"
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/templates": {
      "get": {
        "operationId": "getTemplates",
        "summary": "List agent templates",
        "description": "Returns the shared templates followed by the workspace's own templates, each sorted by name. Revoked templates are included with `revoked` set to `true`; a revoked template can no longer be used to create agents. The list is not paginated.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#get-templates"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ templates: Template[] }`. Each template has `id`, `isGlobal` (`true` for a shared template), `name`, `description`, `category`, the configuration an agent starts from (`authority`, `runtimeMode`, `dataClasses`, `skills`, `knowledgeLayers`, `localPermissions`, `connectors`, `model`), and `version`, `ownerUserId`, `revoked`, `revokedAt`, `createdAt` and `updatedAt`. `createdAt` is an ISO 8601 timestamp; `updatedAt` is a date string that is not guaranteed to be ISO 8601.",
            "content": {
              "application/json": {
                "example": {
                  "templates": [
                    {
                      "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "isGlobal": true,
                      "name": "Contract Clause Finder",
                      "description": "Find and summarize clauses across local contract files.",
                      "category": "Compliance",
                      "authority": "answer",
                      "runtimeMode": "hybrid",
                      "dataClasses": [
                        "public",
                        "internal"
                      ],
                      "skills": [
                        "Compliance claim check",
                        "Source freshness check"
                      ],
                      "knowledgeLayers": {},
                      "localPermissions": {},
                      "connectors": [],
                      "model": null,
                      "version": "1.0.0",
                      "ownerUserId": null,
                      "revoked": false,
                      "revokedAt": null,
                      "createdAt": "2026-10-02T09:14:07.000Z",
                      "updatedAt": "Fri Oct 02 2026 09:14:07 GMT+0000 (Coordinated Universal Time)"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/templates/{id}": {
      "get": {
        "operationId": "getTemplatesById",
        "summary": "Get a template",
        "description": "Returns one shared template or one of the workspace's own templates.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#get-templates-id"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The template id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The template object, with the same fields as an entry in the template list.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No shared template and no template of your workspace has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/templates/{id}/versions": {
      "get": {
        "operationId": "getTemplatesByIdVersions",
        "summary": "List a template's version history",
        "description": "Returns the recorded version changes and revocations of a template, newest first. History is recorded only when a workspace's own template is changed, so a shared template normally returns an empty list. An id that matches no template also returns an empty list rather than an error.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#get-templates-id-versions"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The template id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ versions: TemplateVersion[] }`. Each entry has `id`, `templateId`, `version`, `event` (`bump` for a version change or `revoked`; `created` is defined but not recorded by any operation today), `note`, `createdBy` and `createdAt` (ISO 8601).",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/domain-packs": {
      "get": {
        "operationId": "getDomainPacks",
        "summary": "List domain packs",
        "description": "Returns the built-in packs followed by the packs authored in your workspace, in every status, each sorted by name. The list is not paginated.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#get-domain-packs"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ domainPacks: DomainPack[] }`. Each pack has `id`, `isGlobal`, `slug`, `name`, `domain`, `purpose`, `summary`, `defaultAuthority`, `recommendedDataClasses`, `recommendedRuntimeMode`, `recommendedSkills`, `knowledgeLayers`, `kpis`, `probes`, `version`, `source` (`builtin` or `tenant_authored`), `compatibleAgentTypes`, `prohibitedUse`, `coherent` (whether every quality check passed at the last save), `coherenceCheckedAt`, `status` (`draft`, `published` or `archived`), `createdAt` and `updatedAt`. `updatedAt` is a date string that is not guaranteed to be ISO 8601.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "postDomainPacks",
        "summary": "Create a draft domain pack",
        "description": "Creates a pack owned by your workspace with status `draft` and version `0.1.0`, runs the quality checks on it and stores the result. A draft is saved even when checks fail, so read `goldenStandard` in the response to see what still needs work. To pass the `coverage` check the probes must include the `in_scope`, `manifest_ceiling` and `data_residency` dimensions, with at least one `must_allow` and one `must_deny` probe. Field values are stored as sent and are not checked against the allowed values listed below, so a typo is not rejected with a `400`.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#post-domain-packs"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name of the pack. When `slug` is omitted, the slug is derived from it. The name is not enforced: without it the pack is stored with an empty name."
                  },
                  "slug": {
                    "type": "string",
                    "description": "Identifier that must be unique among your workspace's packs. It is normalized to lower-case letters, digits and hyphens and cut to 80 characters. Defaults to a slug of `name`, or to `pack` when that would be empty. A slug your workspace already uses is not reported with a specific error code; the request fails with a `500` `server_error`."
                  },
                  "domain": {
                    "type": "string",
                    "description": "The business domain the pack is for."
                  },
                  "purpose": {
                    "type": "string",
                    "description": "What an agent built from the pack is for. It becomes that agent's purpose."
                  },
                  "summary": {
                    "type": "string",
                    "description": "A longer description of the pack's scope and limits."
                  },
                  "defaultAuthority": {
                    "type": "string",
                    "enum": [
                      "answer",
                      "draft",
                      "recommend",
                      "prepare_action",
                      "execute_with_approval",
                      "execute_automatically"
                    ],
                    "description": "Authority level for agents built from the pack. Defaults to `recommend`."
                  },
                  "recommendedDataClasses": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Data classes the agent may handle: any of `public`, `internal`, `confidential`, `restricted` and `secrets`. Defaults to an empty list."
                  },
                  "recommendedRuntimeMode": {
                    "type": "string",
                    "enum": [
                      "cloud_only",
                      "local_preferred",
                      "local_only",
                      "hybrid"
                    ],
                    "description": "Where agents built from the pack should run. Defaults to `hybrid`."
                  },
                  "recommendedSkills": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Skill names. For the `resolvability` check to pass, each must match a skill in the workspace's skill catalog by name, ignoring case."
                  },
                  "knowledgeLayers": {
                    "type": "object",
                    "description": "Boolean map of the knowledge layers to turn on, keyed by `domain`, `tenant`, `role`, `user` and `task`."
                  },
                  "kpis": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The measures agents built from the pack are meant to improve."
                  },
                  "probes": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "The pack's claims. Each probe has `id`, `title`, `kind` (`must_allow` or `must_deny`), `dimension` (`in_scope`, `default_deny`, `manifest_ceiling`, `data_residency`, `connector_scope`, `approval_required`, `obligations` or `delegation_containment`), `action` (an action class such as `summarize`, `recommend` or `update_record`), `placement` (such as `local` or `cloud_model`), `rationale`, and optionally `dataClass` and `connector`."
                  },
                  "compatibleAgentTypes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Agent types the pack is a good starting point for. An empty list means no restriction."
                  },
                  "prohibitedUse": {
                    "type": "string",
                    "description": "A use the pack must not be put to, shown to authors and reviewers."
                  }
                }
              },
              "example": {
                "name": "Invoice review",
                "domain": "Finance operations",
                "purpose": "Review supplier invoices against purchase orders and flag mismatches.",
                "summary": "Reads invoices and recommends follow-ups; never updates records.",
                "defaultAuthority": "recommend",
                "recommendedDataClasses": [
                  "public",
                  "internal"
                ],
                "recommendedRuntimeMode": "hybrid",
                "knowledgeLayers": {
                  "domain": true,
                  "tenant": true,
                  "role": false,
                  "user": false,
                  "task": false
                },
                "kpis": [
                  "Invoices reviewed per week"
                ],
                "probes": [
                  {
                    "id": "allow-summarize",
                    "title": "Summarize an internal invoice",
                    "kind": "must_allow",
                    "dimension": "in_scope",
                    "action": "summarize",
                    "dataClass": "internal",
                    "placement": "local",
                    "rationale": "Summarizing internal data is within the recommend authority."
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "`201` with the created pack plus `goldenStandard`: `{ passed, checks }`. `checks` holds `coherence` (`incoherentCount` is the number of probes the policy engine did not confirm), `coverage` (`missingDimensions`; for a pack whose authority is `prepare_action` or higher it can also list `approval_required` as advice without failing the check), `resolvability` (`unresolvedSkills`), `provenance` (`missingFields`) and `roundTrip` (`droppedFields`), each with its own `passed` flag.",
            "content": {
              "application/json": {
                "example": {
                  "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                  "isGlobal": false,
                  "slug": "invoice-review",
                  "name": "Invoice review",
                  "domain": "Finance operations",
                  "purpose": "Review supplier invoices against purchase orders and flag mismatches.",
                  "summary": "Reads invoices and recommends follow-ups; never updates records.",
                  "defaultAuthority": "recommend",
                  "recommendedDataClasses": [
                    "public",
                    "internal"
                  ],
                  "recommendedRuntimeMode": "hybrid",
                  "recommendedSkills": [],
                  "knowledgeLayers": {
                    "domain": true,
                    "tenant": true,
                    "role": false,
                    "user": false,
                    "task": false
                  },
                  "kpis": [
                    "Invoices reviewed per week"
                  ],
                  "probes": [
                    {
                      "id": "allow-summarize",
                      "title": "Summarize an internal invoice",
                      "kind": "must_allow",
                      "dimension": "in_scope",
                      "action": "summarize",
                      "dataClass": "internal",
                      "placement": "local",
                      "rationale": "Summarizing internal data is within the recommend authority."
                    }
                  ],
                  "version": "0.1.0",
                  "source": "tenant_authored",
                  "compatibleAgentTypes": [],
                  "prohibitedUse": null,
                  "coherent": false,
                  "coherenceCheckedAt": "2026-11-27T10:42:18.512Z",
                  "status": "draft",
                  "createdAt": "2026-11-27T10:42:18.512Z",
                  "updatedAt": "Fri Nov 27 2026 10:42:18 GMT+0000 (Coordinated Universal Time)",
                  "goldenStandard": {
                    "passed": false,
                    "checks": {
                      "coherence": {
                        "passed": true,
                        "incoherentCount": 0
                      },
                      "coverage": {
                        "passed": false,
                        "missingDimensions": [
                          "manifest_ceiling",
                          "data_residency"
                        ]
                      },
                      "resolvability": {
                        "passed": true,
                        "unresolvedSkills": []
                      },
                      "provenance": {
                        "passed": true,
                        "missingFields": []
                      },
                      "roundTrip": {
                        "passed": true,
                        "droppedFields": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/domain-packs/{id}": {
      "get": {
        "operationId": "getDomainPacksById",
        "summary": "Get a domain pack",
        "description": "Returns one built-in pack or one pack authored in your workspace, including its probes.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#get-domain-packs-id"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The pack id (not its slug).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The pack object, with the same fields as an entry in the pack list.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No built-in pack and no pack of your workspace has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "patchDomainPacksById",
        "summary": "Update, publish or archive a domain pack",
        "description": "Changes the fields you send on a pack authored in your workspace, re-runs the quality checks and stores the new result. Send `status` to move the pack between `draft`, `published` and `archived`. A request that sets `status` to `published` is applied only when every check passes; otherwise it returns `422` and none of the field changes in that request are saved, although the pack's stored `coherent` flag is updated to the failed result.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member. Only packs authored in your workspace can be changed. Built-in packs are read-only.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#patch-domain-packs-id"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The pack id (not its slug).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "published",
                      "archived"
                    ],
                    "description": "The status to move the pack to. Omit it to keep the current status. Send exactly one of these values: any other string is stored as the status without an error."
                  },
                  "name": {
                    "type": "string",
                    "description": "New display name."
                  },
                  "slug": {
                    "type": "string",
                    "description": "New slug. It is trimmed but, unlike on create, not otherwise normalized. It must stay unique among your workspace's packs."
                  },
                  "domain": {
                    "type": "string",
                    "description": "New business domain."
                  },
                  "purpose": {
                    "type": "string",
                    "description": "New purpose."
                  },
                  "summary": {
                    "type": "string",
                    "description": "New summary."
                  },
                  "defaultAuthority": {
                    "type": "string",
                    "enum": [
                      "answer",
                      "draft",
                      "recommend",
                      "prepare_action",
                      "execute_with_approval",
                      "execute_automatically"
                    ],
                    "description": "New authority level for agents built from the pack."
                  },
                  "recommendedDataClasses": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replaces the list of data classes."
                  },
                  "recommendedRuntimeMode": {
                    "type": "string",
                    "enum": [
                      "cloud_only",
                      "local_preferred",
                      "local_only",
                      "hybrid"
                    ],
                    "description": "New runtime mode."
                  },
                  "recommendedSkills": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replaces the list of skill names."
                  },
                  "knowledgeLayers": {
                    "type": "object",
                    "description": "Replaces the knowledge layer map."
                  },
                  "kpis": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replaces the list of measures."
                  },
                  "probes": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Replaces the whole list of probes. Probes have the same fields as on create."
                  },
                  "compatibleAgentTypes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replaces the list of agent types."
                  },
                  "prohibitedUse": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "New prohibited-use text, or `null` to clear it."
                  }
                }
              },
              "example": {
                "status": "published"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated pack plus `goldenStandard`, in the same shape as the create response.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "description": "`builtin_immutable`: The pack is a built-in pack.\n\nThe credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "builtin_immutable": {
                    "value": {
                      "error": "builtin_immutable"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: No pack with this id is visible to your workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "`golden_standard_failed`: The request sets `status` to `published` but a quality check fails. `detail` holds the check result in the `goldenStandard` shape.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "golden_standard_failed": {
                    "value": {
                      "error": "golden_standard_failed"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/contributions": {
      "get": {
        "operationId": "getContributions",
        "summary": "List contribution proposals",
        "description": "Returns every proposal in the workspace, newest first. The list is not paginated.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#get-contributions"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ contributions: Proposal[] }`. Each proposal has `id`, `agentId`, `kind`, `title`, `summary`, `before`, `after`, `submittedBy`, `status` (`proposed`, `approved`, `rejected` or `applied`), `reviewedBy`, `reviewNote`, `createdAt`, `decidedAt`, `appliedVersion` (the agent version created when the proposal was applied) and `appliedAt`. `createdAt` and `appliedAt` are date strings that are not guaranteed to be ISO 8601.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "postContributions",
        "summary": "Submit a contribution proposal",
        "description": "Records a proposed change with status `proposed` and writes an audit log entry. Nothing is applied to the agent until a person approves and applies the proposal in the web workspace.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#post-contributions"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "knowledge",
                      "manifest",
                      "skill",
                      "prompt"
                    ],
                    "description": "What the proposal changes once applied: `prompt` replaces the agent's purpose with `after`, `manifest` replaces its outcome, `skill` adds `after` as a skill name, and `knowledge` turns on the knowledge layer named by `after`."
                  },
                  "title": {
                    "type": "string",
                    "description": "Short title for reviewers. Must not be empty."
                  },
                  "after": {
                    "type": "string",
                    "description": "The proposed new value. Must not be empty."
                  },
                  "before": {
                    "type": "string",
                    "description": "The current value, as context for the reviewer. Stored as `null` when omitted."
                  },
                  "summary": {
                    "type": "string",
                    "description": "Why the change is proposed. Defaults to an empty string."
                  },
                  "agentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The agent the proposal targets. It must belong to your workspace. A proposal without an agent can be reviewed but cannot be applied."
                  }
                },
                "required": [
                  "kind",
                  "title",
                  "after"
                ]
              },
              "example": {
                "agentId": "8a4e6c1d-2f3b-4c7a-9d10-5b6e7f8a9c02",
                "kind": "skill",
                "title": "Add invoice matching",
                "summary": "Reviewers asked for purchase order matching.",
                "after": "Invoice matching"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "`201` with the proposal. `submittedBy` identifies the caller; for an API key it is `api-key:` followed by the key id.",
            "content": {
              "application/json": {
                "example": {
                  "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                  "agentId": "8a4e6c1d-2f3b-4c7a-9d10-5b6e7f8a9c02",
                  "kind": "skill",
                  "title": "Add invoice matching",
                  "summary": "Reviewers asked for purchase order matching.",
                  "before": null,
                  "after": "Invoice matching",
                  "submittedBy": "api-key:5d2c8f10-7a3b-4e9c-8f21-0c4d6e8a1b33",
                  "status": "proposed",
                  "reviewedBy": null,
                  "reviewNote": null,
                  "createdAt": "Fri Nov 27 2026 10:42:18 GMT+0000 (Coordinated Universal Time)",
                  "decidedAt": null,
                  "appliedVersion": null,
                  "appliedAt": null
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`: `kind` is not one of the allowed values, or `title` or `after` is missing or empty. `detail` names the field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_request": {
                    "value": {
                      "error": "invalid_request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: `agentId` does not name an agent in your workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/builder/suggest": {
      "post": {
        "operationId": "postBuilderSuggest",
        "summary": "Suggest a starting configuration from a described outcome",
        "description": "**Status: Gated.** Shipped, but closed until a switch is turned on; the Access note below says which.\n\n**Calls a paid model** on the workspace's own model provider key. Sends the outcome and the workspace's clarifying questions to the workspace's default model (`openai/gpt-4o-mini` when none is set) and returns suggested answers, skills and a one-sentence summary. Nothing is saved. If the model's reply cannot be read as the expected JSON, the response is `200` with empty suggestions.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member. The model call is refused with `403` until a workspace admin has recorded a reviewed model profile for Builder suggestions in the workspace configuration, listing the model in use and the kinds of input the operation sends. The workspace also needs a model provider key.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#post-builder-suggest"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "x-coa-status": "gated",
        "parameters": [
          {
            "name": "X-CoA-Model-Request",
            "in": "header",
            "required": false,
            "description": "The current Unix time in milliseconds (13 digits), a dot and a UUID that you generate, new for each request; it identifies the request for usage accounting. Send it on every request: once a reviewed model profile lets the model call through, a request without it is refused with `503 model_usage_request_identity_required` before any model call. See [The usage-request header](https://centerofagentic.com/docs/guides/troubleshooting#usage-request-header).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "outcome": {
                    "type": "string",
                    "description": "The outcome the agent should achieve, in plain language. At least 8 characters after trimming."
                  }
                },
                "required": [
                  "outcome"
                ]
              },
              "example": {
                "outcome": "Review supplier invoices against purchase orders and flag mismatches."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`{ clarification, skills, summary }`. `clarification` maps each clarifying-question key to a suggested answer (at most 80 characters; a question with fixed options only ever gets one of its options), `skills` holds up to 6 skill names and `summary` is at most 200 characters.",
            "content": {
              "application/json": {
                "example": {
                  "clarification": {
                    "produce": "A structured report",
                    "users": "A specific team",
                    "authority": "Recommend actions",
                    "data": "Approved internal data",
                    "approval": "Creating or updating records"
                  },
                  "skills": [
                    "Invoice matching",
                    "Variance analysis",
                    "Executive writing"
                  ],
                  "summary": "Reviews supplier invoices against purchase orders and recommends follow-ups."
                }
              }
            }
          },
          "400": {
            "description": "`outcome_too_short`: `outcome` is missing or shorter than 8 characters.\n\n`no_model_key`: The workspace has no model provider key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "outcome_too_short": {
                    "value": {
                      "error": "outcome_too_short"
                    }
                  },
                  "no_model_key": {
                    "value": {
                      "error": "no_model_key"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "description": "`over_budget`: The workspace's spend budget refuses the call. No model is called; the body also carries empty suggestion fields and `receipt`, the run receipt that records the refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "over_budget": {
                    "value": {
                      "error": "over_budget"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "`system_model_profile_unavailable`: No reviewed model profile is recorded for this operation, or it has expired. No model is called.\n\n`system_model_not_permitted`: The model in use is not listed in the reviewed model profile. No model is called.\n\n`system_model_source_not_permitted`: The reviewed model profile does not cover a kind of input this operation sends: the submitted text and workspace context. No model is called.\n\nThe credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "system_model_profile_unavailable": {
                    "value": {
                      "error": "system_model_profile_unavailable"
                    }
                  },
                  "system_model_not_permitted": {
                    "value": {
                      "error": "system_model_not_permitted"
                    }
                  },
                  "system_model_source_not_permitted": {
                    "value": {
                      "error": "system_model_source_not_permitted"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "`system_model_failed`: The model call failed after it was dispatched. `invoked` is `true`: a request may have reached the model provider.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "system_model_failed": {
                    "value": {
                      "error": "system_model_failed"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`model_usage_request_identity_required`: The request has no `X-CoA-Model-Request` header. No model is called.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "model_usage_request_identity_required": {
                    "value": {
                      "error": "model_usage_request_identity_required"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/builder/variant": {
      "post": {
        "operationId": "postBuilderVariant",
        "summary": "Test a configuration change without saving it",
        "description": "**Status: Gated.** Shipped, but closed until a switch is turned on; the Access note below says which.\n\nEvaluates a prompt against an agent's saved configuration with temporary overrides and returns both the answer and the policy decision, which is recomputed from the overridden authority and data classes. It **calls a paid model** on the workspace's own key only when that decision is `allow` and still permits a cloud model; otherwise it returns the decision with an empty `output` and makes no model call. Connectors are not used. The agent is not changed and no conversation or run receipt is written; an audit log entry records the decision and the model.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member. The model call is refused with `403` until a workspace admin has recorded a reviewed model profile for configuration tests in the workspace configuration, listing the model in use and the kinds of input the operation sends (including agent configuration when `agentId` is sent). The workspace also needs a model provider key.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#post-builder-variant"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "x-coa-status": "gated",
        "parameters": [
          {
            "name": "X-CoA-Model-Request",
            "in": "header",
            "required": false,
            "description": "The current Unix time in milliseconds (13 digits), a dot and a UUID that you generate, new for each request; it identifies the request for usage accounting. Send it on every request: once a reviewed model profile lets the model call through, a test that reaches the model call without it is refused with `503 model_usage_request_identity_required` before the model is called. See [The usage-request header](https://centerofagentic.com/docs/guides/troubleshooting#usage-request-header).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "The test prompt."
                  },
                  "agentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The agent whose saved configuration is the starting point. Without it a default profile is used: `recommend` authority with `public` and `internal` data."
                  },
                  "overrides": {
                    "type": "object",
                    "description": "Temporary changes layered on the starting configuration for this one test.",
                    "properties": {
                      "model": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Model id to use. Without it the agent's model is used, then the workspace default."
                      },
                      "authority": {
                        "type": "string",
                        "description": "Authority level: `answer`, `draft`, `recommend`, `prepare_action`, `execute_with_approval` or `execute_automatically`."
                      },
                      "runtimeMode": {
                        "type": "string",
                        "description": "Runtime mode: `cloud_only`, `local_preferred`, `local_only` or `hybrid`."
                      },
                      "dataClasses": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Data classes: any of `public`, `internal`, `confidential`, `restricted` and `secrets`."
                      },
                      "skills": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Skill names to compose into the system prompt."
                      },
                      "knowledgeLayers": {
                        "type": "object",
                        "description": "Boolean map of knowledge layers to include."
                      },
                      "outcome": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Outcome text to use in the system prompt."
                      },
                      "systemPrompt": {
                        "type": "string",
                        "description": "A complete system prompt. When set, it replaces the prompt composed from the configuration."
                      }
                    }
                  }
                },
                "required": [
                  "prompt"
                ]
              },
              "example": {
                "agentId": "8a4e6c1d-2f3b-4c7a-9d10-5b6e7f8a9c02",
                "prompt": "Summarize the open invoice mismatches for this week.",
                "overrides": {
                  "dataClasses": [
                    "public",
                    "internal",
                    "restricted"
                  ],
                  "systemPrompt": "You review supplier invoices. Be concise."
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`{ output, decision, reasonCode, model, promptTokens, completionTokens, costUsd, latencyMs, steps, systemPrompt, survivingPlacements }`. `decision` is `allow` or `deny`; `reasonCode` explains it, for example `ALLOWED` or `LIMITED_OUTPUT`; `steps` is the step timeline of the test; `systemPrompt` is the prompt that was, or would have been, sent; `survivingPlacements` lists where the request may run.",
            "content": {
              "application/json": {
                "example": {
                  "output": "",
                  "decision": "allow",
                  "reasonCode": "LIMITED_OUTPUT",
                  "model": "openai/gpt-4o-mini",
                  "promptTokens": 0,
                  "completionTokens": 0,
                  "costUsd": null,
                  "latencyMs": 0,
                  "steps": [
                    {
                      "step_id": "policy",
                      "kind": "policy_decision",
                      "label": "Authority & placement check",
                      "status": "ok",
                      "placement": "local",
                      "reason_code": "LIMITED_OUTPUT",
                      "policy": {
                        "decision": "allow",
                        "reason_code": "LIMITED_OUTPUT",
                        "deny_rules_matched": [
                          "deny_data_classification_g"
                        ],
                        "obligations": [
                          {
                            "kind": "logging",
                            "layer": "law_regulation",
                            "ruleId": "obl_logging_h",
                            "reason": "audit_all_runs"
                          },
                          {
                            "kind": "confidence_label",
                            "layer": "package_manifest",
                            "ruleId": "obl_confidence_label_i",
                            "reason": "label_confidence"
                          },
                          {
                            "kind": "limited_output",
                            "layer": "data_classification",
                            "ruleId": "deny_data_classification_g",
                            "reason": "Requested placement 'cloud_model' denied; routed to 'local'."
                          }
                        ]
                      },
                      "seq": 0
                    },
                    {
                      "step_id": "model",
                      "seq": 1,
                      "kind": "model_call",
                      "label": "Cloud reasoning turn",
                      "status": "limited",
                      "placement": "cloud_model",
                      "reason_code": "LIMITED_OUTPUT"
                    }
                  ],
                  "systemPrompt": "You review supplier invoices. Be concise.",
                  "survivingPlacements": [
                    "local"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`missing_prompt`: `prompt` is missing or empty.\n\n`no_model_key`: The workspace has no model provider key.\n\n`no_model`: Neither the overrides, the agent nor the workspace default names a model.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missing_prompt": {
                    "value": {
                      "error": "missing_prompt"
                    }
                  },
                  "no_model_key": {
                    "value": {
                      "error": "no_model_key"
                    }
                  },
                  "no_model": {
                    "value": {
                      "error": "no_model"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "description": "`over_budget`: The workspace is over its monthly spend budget. No model is called.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "over_budget": {
                    "value": {
                      "error": "over_budget"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "`system_model_profile_unavailable`: No reviewed model profile is recorded for this operation, or it has expired. No model is called.\n\n`system_model_not_permitted`: The model in use is not listed in the reviewed model profile. No model is called.\n\n`system_model_source_not_permitted`: The reviewed model profile does not cover a kind of input this request sends: the submitted text, workspace context or, with `agentId`, agent configuration. No model is called.\n\n`system_model_source_unavailable`: `agentId` names an agent whose status is `revoked`, `disabled` or `suspended`. No model is called.\n\n`system_model_placement_unavailable`: `agentId` names an agent whose saved runtime mode is neither `hybrid`, `cloud_only` nor `local_only`, for example `local_preferred`. The check reads the saved agent, not `overrides.runtimeMode`. No model is called.\n\n`system_model_refused`: The policy check on the model call itself refused it, for example because `agentId` names an agent saved as `local_only`, which may not use a cloud model. No model is called.\n\nThe credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "system_model_profile_unavailable": {
                    "value": {
                      "error": "system_model_profile_unavailable"
                    }
                  },
                  "system_model_not_permitted": {
                    "value": {
                      "error": "system_model_not_permitted"
                    }
                  },
                  "system_model_source_not_permitted": {
                    "value": {
                      "error": "system_model_source_not_permitted"
                    }
                  },
                  "system_model_source_unavailable": {
                    "value": {
                      "error": "system_model_source_unavailable"
                    }
                  },
                  "system_model_placement_unavailable": {
                    "value": {
                      "error": "system_model_placement_unavailable"
                    }
                  },
                  "system_model_refused": {
                    "value": {
                      "error": "system_model_refused"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: `agentId` does not name an agent in your workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "`system_model_failed`: The model call failed after it was dispatched. `invoked` is `true`: a request may have reached the model provider.\n\n`model_failed`: An unexpected error occurred while the model call was being authorized or recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "system_model_failed": {
                    "value": {
                      "error": "system_model_failed"
                    }
                  },
                  "model_failed": {
                    "value": {
                      "error": "model_failed"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`model_usage_request_identity_required`: The request has no `X-CoA-Model-Request` header. No model is called.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "model_usage_request_identity_required": {
                    "value": {
                      "error": "model_usage_request_identity_required"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/builder/benchmark": {
      "post": {
        "operationId": "postBuilderBenchmark",
        "summary": "Compare models on the same prompt",
        "description": "**Status: Gated.** Shipped, but closed until a switch is turned on; the Access note below says which.\n\n**Calls a paid model once for every entry in `models`**, in parallel, on the workspace's own model provider key, and reports latency, token counts, cost and throughput for each. With `agentId`, the agent's composed system prompt is used so the comparison is representative; without it a generic prompt is used. Connectors are not used. A model that fails or is refused is reported inside its own result and the response is still `200`.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member. Every model call is refused until a workspace admin has recorded a reviewed model profile for benchmarks in the workspace configuration, listing each model to compare and the kinds of input the operation sends (including agent configuration when `agentId` is sent). The workspace also needs a model provider key.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#post-builder-benchmark"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "x-coa-status": "gated",
        "parameters": [
          {
            "name": "X-CoA-Model-Request",
            "in": "header",
            "required": false,
            "description": "The current Unix time in milliseconds (13 digits), a dot and a UUID that you generate, new for each request; it identifies the request for usage accounting, and one value covers every model in `models`. Send it on every request: without it, each model call that a reviewed model profile would let through is refused before the model is called, and its result carries `refusal.code` `model_usage_request_identity_required` while the response is still `200`. See [The usage-request header](https://centerofagentic.com/docs/guides/troubleshooting#usage-request-header).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "The test prompt sent to every model."
                  },
                  "models": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Model ids to compare. Duplicates are removed and only the first 6 are used."
                  },
                  "agentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The agent whose system prompt the benchmark should use. Omit it to use the generic prompt: an id that names no agent in your workspace does not return `404`; every model call is refused instead, and each result carries the refusal (`system_model_source_unavailable` once a reviewed profile is in place)."
                  }
                },
                "required": [
                  "prompt",
                  "models"
                ]
              },
              "example": {
                "agentId": "8a4e6c1d-2f3b-4c7a-9d10-5b6e7f8a9c02",
                "prompt": "Summarize the open invoice mismatches for this week.",
                "models": [
                  "openai/gpt-4o-mini",
                  "openai/gpt-4o"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`{ results, recommend }`. Each result has `model`, `ok`, `latencyMs`, `promptTokens`, `completionTokens`, `costUsd`, `tokensPerSec` (both can be `null`) and `output` (the first 600 characters of the answer). A result with `ok` set to `false` also has `error`, and `refusal` with `code`, `status`, `decisionId` and `invoked` when the platform refused the call or the call failed after dispatch. `recommend` is `{ fastest, cheapest }`, each a model id or `null`, chosen among the successful results.",
            "content": {
              "application/json": {
                "example": {
                  "results": [
                    {
                      "model": "openai/gpt-4o-mini",
                      "ok": true,
                      "latencyMs": 1840,
                      "promptTokens": 412,
                      "completionTokens": 96,
                      "costUsd": 0.00012,
                      "tokensPerSec": 52,
                      "output": "Three invoices do not match their purchase orders this week."
                    },
                    {
                      "model": "openai/gpt-4o",
                      "ok": true,
                      "latencyMs": 2610,
                      "promptTokens": 412,
                      "completionTokens": 104,
                      "costUsd": 0.00207,
                      "tokensPerSec": 40,
                      "output": "This week, three supplier invoices differ from their purchase orders."
                    }
                  ],
                  "recommend": {
                    "fastest": "openai/gpt-4o-mini",
                    "cheapest": "openai/gpt-4o-mini"
                  }
                }
              }
            }
          },
          "400": {
            "description": "`missing_prompt`: `prompt` is missing or empty.\n\n`no_models`: `models` contains no model id.\n\n`no_model_key`: The workspace has no model provider key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missing_prompt": {
                    "value": {
                      "error": "missing_prompt"
                    }
                  },
                  "no_models": {
                    "value": {
                      "error": "no_models"
                    }
                  },
                  "no_model_key": {
                    "value": {
                      "error": "no_model_key"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "description": "`over_budget`: The workspace is over its monthly spend budget. No model is called.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "over_budget": {
                    "value": {
                      "error": "over_budget"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/assistant/run": {
      "post": {
        "operationId": "postAssistantRun",
        "summary": "Run a CoA Assistant task",
        "description": "**Status: Gated.** Shipped, but closed until a switch is turned on; the Access note below says which.\n\n**Calls a paid model.** The server gathers read-only workspace context for the chosen `action`, applies the assistant's fixed policy profile (`recommend` authority, `public` and `internal` data) and the workspace's spend budget, and returns the answer. The model call uses a key provided by the platform when one is configured for the assistant, otherwise the workspace's own model provider key. A run that is answered, denied by policy or refused for budget writes a run receipt and an audit log entry, and an answered run is appended to the caller's assistant thread.\n\n**Access:** API key with the `admin` scope, or a signed-in workspace member. The model call is refused with `403` until a workspace admin has recorded a reviewed model profile for the assistant in the workspace configuration, listing the model in use and the kinds of input the run sends. It has its own rate limit; see [rate limits](https://centerofagentic.com/docs/reference/rate-limits).",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#post-assistant-run"
        },
        "security": [
          {
            "ApiKey": [
              "admin"
            ]
          }
        ],
        "x-coa-scope": "admin",
        "x-coa-status": "gated",
        "parameters": [
          {
            "name": "X-CoA-Model-Request",
            "in": "header",
            "required": false,
            "description": "The current Unix time in milliseconds (13 digits), a dot and a UUID that you generate, new for each request; it identifies the request for usage accounting. Send it on every request: once a reviewed model profile lets the model call through, a run that reaches the model call without it is refused with `503 model_usage_request_identity_required` before the model is called. See [The usage-request header](https://centerofagentic.com/docs/guides/troubleshooting#usage-request-header).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "ask",
                      "summarize_usage",
                      "find_risks",
                      "improve_blueprint",
                      "explain_publish_blockers",
                      "suggest_eval_cases",
                      "explain_failures",
                      "explain_run",
                      "draft_domain_pack"
                    ],
                    "description": "The task. `ask` answers a free-form question; `summarize_usage` and `find_risks` report on the workspace's agents; `improve_blueprint` drafts improvements to one agent; `explain_publish_blockers` explains why an agent cannot be published; `suggest_eval_cases` drafts test cases; `explain_failures` interprets an experiment's failing cases; `explain_run` explains one run receipt; `draft_domain_pack` drafts a domain pack."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Your question or instruction. When omitted, a default prompt for the action is used."
                  },
                  "agentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The agent to look at. Required for `improve_blueprint` and `explain_publish_blockers`; optional context for the other actions."
                  },
                  "receiptId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The run receipt to explain. Required for `explain_run`."
                  },
                  "experimentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The experiment whose failures to explain. Required for `explain_failures`."
                  },
                  "datasetId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "For `suggest_eval_cases`, the dataset whose existing cases the drafts should complement. Without it, workspace-wide coverage is used."
                  },
                  "route": {
                    "type": "string",
                    "description": "Optional location in the web workspace (path and query; anything beyond 300 characters is cut off). For `ask` and `draft_domain_pack` it adds context about the screen the question refers to, such as `/packs` or `/datasets/{id}`."
                  }
                },
                "required": [
                  "action"
                ]
              },
              "example": {
                "action": "ask",
                "prompt": "Which agents had the most denied runs this month?"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`{ assistant, action, mode, decision, reasonCode, output, receiptId, contextSources, drafts }`. `mode` is `explanation`, `recommendation` or `draft`; `contextSources` names the kinds of data that were read; `drafts` is `{ evalCases, proposal, domainPack, warnings }` and is filled only by the drafting actions. When policy or the spend budget refuses the run, the response is still `200`, with `decision` set to `deny`, an empty `output` and the `receiptId` of the recorded refusal.",
            "content": {
              "application/json": {
                "example": {
                  "assistant": "coa_assistant",
                  "action": "ask",
                  "mode": "explanation",
                  "decision": "allow",
                  "reasonCode": "ALLOWED",
                  "output": "Two agents account for most of the denied runs in the last 30 days.",
                  "receiptId": "7c9e2b14-5d3a-4f6b-8e21-9a0b1c2d3e44",
                  "contextSources": [
                    "product_docs",
                    "agents",
                    "metrics",
                    "receipts"
                  ],
                  "drafts": {
                    "evalCases": [],
                    "proposal": null,
                    "domainPack": null,
                    "warnings": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_action`: `action` is not one of the listed tasks.\n\n`invalid_request`: The id the action requires is missing or not a UUID: `agentId`, `receiptId` or `experimentId`.\n\n`no_model_key`: No platform key is configured for the assistant and the workspace has no model provider key.\n\n`no_model`: No model is set for the assistant or as the workspace default, and no platform fallback applies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_action": {
                    "value": {
                      "error": "invalid_action"
                    }
                  },
                  "invalid_request": {
                    "value": {
                      "error": "invalid_request"
                    }
                  },
                  "no_model_key": {
                    "value": {
                      "error": "no_model_key"
                    }
                  },
                  "no_model": {
                    "value": {
                      "error": "no_model"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "description": "`system_model_profile_unavailable`: No reviewed model profile is recorded for the assistant, or it has expired. No model is called.\n\n`system_model_not_permitted`: The model in use is not listed in the reviewed model profile. No model is called.\n\n`system_model_classification_unavailable`: The run's context would include data above the `internal` class, for example because an agent in the workspace is configured for `confidential` data, or the data classes could not be established. No model is called.\n\n`system_model_source_not_permitted`: The reviewed model profile does not cover a kind of input this run sends: the submitted text, workspace context, agent configuration when an agent is in context, or a run receipt for `explain_run`. No model is called.\n\n`system_model_source_unavailable`: The agent in context has the status `revoked`, `disabled` or `suspended`. No model is called.\n\n`system_model_placement_unavailable`: The agent in context has a saved runtime mode that is neither `hybrid`, `cloud_only` nor `local_only`, for example `local_preferred`. No model is called.\n\nThe credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "system_model_profile_unavailable": {
                    "value": {
                      "error": "system_model_profile_unavailable"
                    }
                  },
                  "system_model_not_permitted": {
                    "value": {
                      "error": "system_model_not_permitted"
                    }
                  },
                  "system_model_classification_unavailable": {
                    "value": {
                      "error": "system_model_classification_unavailable"
                    }
                  },
                  "system_model_source_not_permitted": {
                    "value": {
                      "error": "system_model_source_not_permitted"
                    }
                  },
                  "system_model_source_unavailable": {
                    "value": {
                      "error": "system_model_source_unavailable"
                    }
                  },
                  "system_model_placement_unavailable": {
                    "value": {
                      "error": "system_model_placement_unavailable"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: A referenced agent, receipt, dataset or experiment does not exist in your workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "`system_model_failed`: The model call failed after it was dispatched. `invoked` is `true`: a request may have reached the model provider.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "system_model_failed": {
                    "value": {
                      "error": "system_model_failed"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`model_usage_request_identity_required`: The request has no `X-CoA-Model-Request` header. No model is called.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "model_usage_request_identity_required": {
                    "value": {
                      "error": "model_usage_request_identity_required"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/assistant/thread": {
      "get": {
        "operationId": "getAssistantThread",
        "summary": "Read the caller's recent assistant conversation",
        "description": "Returns the last 20 turns of the calling identity's assistant thread, oldest first. Threads are per caller: a signed-in person sees their own turns and an API key sees the turns produced with that key. Stored turns are cut to 2,400 characters. An empty list is returned when there is no history.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member.",
        "tags": [
          "Templates, domain packs and authoring"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/authoring#get-assistant-thread"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "`{ turns: Turn[] }`. Each turn has `id`, `role` (`user` or `assistant`), `content`, `receiptId` (the run receipt of that exchange, or `null`) and `ts` (a date string that is not guaranteed to be ISO 8601).",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/missions": {
      "get": {
        "operationId": "getMissions",
        "summary": "List missions that are in progress or changed in the last 7 days",
        "description": "Returns the jobs of every visible mission that still has a job in progress, or that had a job change in the last 7 days. At most 60 missions are included, in-progress missions first and then the most recently changed. `nodes` is a flat list ordered by `depth`, then `createdAt`; group it by `rootId` to rebuild each mission. Text is shortened: `objective` and `output` to 600 characters, `error` to 240, and the latest review note to 280.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member. A workspace admin signed in to the web workspace sees every mission in the workspace. Any other member sees only the missions they started, and an API key sees only the missions started with that same key.",
        "tags": [
          "Missions and tasks"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/missions-tasks#get-missions"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "responses": {
          "200": {
            "description": "An object `{ nodes, reviews, windowDays, generatedAt }`. Each entry of `nodes` is one job: `id`, `rootId` (the mission's root job; equal to `id` on the root), `parentId`, `depth`, `status`, `agentId`, `agentName`, `objective`, `output`, `error`, `rounds` (model rounds the job has run), `createdAt`, `updatedAt`, `holdExpiresAt` (while `status` is `pending_approval`, when the wait for a decision lapses), `terminalReason`, `receiptId` (the id of the job's run receipt when `deep` is `true`, otherwise `null`) and `deep` (`true` for a job that can delegate work to sub-agents or was itself delegated). `parentId`, `agentId`, `agentName`, `objective`, `output`, `error`, `holdExpiresAt` and `terminalReason` can be `null`. `reviews` maps the root id of a delivered mission (its root job is `done`) to its latest review `{ verdict, at }`, where `verdict` is `accepted` or `changes_requested`; a delivered mission without an entry has not been reviewed. `windowDays` is `7`. The response is sent with `Cache-Control: no-store`.",
            "content": {
              "application/json": {
                "example": {
                  "nodes": [
                    {
                      "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "rootId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "parentId": null,
                      "depth": 0,
                      "status": "done",
                      "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                      "agentName": "Research lead",
                      "objective": "Summarize the supplier contracts that renew next quarter.",
                      "output": "Three contracts renew next quarter. The largest is the logistics agreement.",
                      "error": null,
                      "rounds": 4,
                      "createdAt": "2026-11-20T09:14:02.000Z",
                      "updatedAt": "2026-11-20T09:21:47.000Z",
                      "holdExpiresAt": null,
                      "terminalReason": null,
                      "receiptId": "b84d1f02-6c3a-4e19-a7d5-2f0c9e3b6a48",
                      "deep": true
                    },
                    {
                      "id": "c5d09a77-1e42-4b6f-9d03-8a7b6c5d4e21",
                      "rootId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "parentId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "depth": 1,
                      "status": "done",
                      "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                      "agentName": "Research lead",
                      "objective": "List renewal dates for the logistics agreement.",
                      "output": "The logistics agreement renews on 1 February.",
                      "error": null,
                      "rounds": 2,
                      "createdAt": "2026-11-20T09:15:10.000Z",
                      "updatedAt": "2026-11-20T09:18:33.000Z",
                      "holdExpiresAt": null,
                      "terminalReason": null,
                      "receiptId": "d17a5c3e-8b40-4f92-a6c1-9e0f2b4d7a85",
                      "deep": true
                    }
                  ],
                  "reviews": {
                    "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11": {
                      "verdict": "accepted",
                      "at": "2026-11-20T10:02:11.000Z"
                    }
                  },
                  "windowDays": 7,
                  "generatedAt": "2026-11-21T08:00:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/missions/{id}": {
      "get": {
        "operationId": "getMissionsById",
        "summary": "Get one mission with per-job execution detail",
        "description": "Returns the whole mission that the job `id` belongs to; `id` can be the root job or any delegated job. At most 100 jobs and 50 tool calls per job are returned. `objective` and `output` are shortened to 4,000 characters and `error` to 600. A mission the caller is not allowed to see is reported as not found.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member. A workspace admin signed in to the web workspace can open any mission in the workspace. Any other member can open only missions they started, and an API key only missions started with that same key.",
        "tags": [
          "Missions and tasks"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/missions-tasks#get-missions-id"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The id of any job in the mission. The response always covers the whole mission.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An object `{ nodes, links, reviews, generatedAt }`. Each node has the fields of the mission list plus `ceiling` (the limits the job ran under: `{ authority, actions, dataClasses, placements, tools, depth }`, with `tools` as a list of tool names, or `null` when none was recorded), `tools` (the job's recorded tool calls as `{ tool, connection, ok, outcome }`: `connection` names the connection the tool belongs to, `ok` is `true` when the call ran and succeeded, and `outcome` is `authorized` (allowed to run), `pending` (held for a person), `denied` (refused) or `null` when no decision was recorded), `heldActions` (names of tool calls waiting for a person while the job is `pending_approval`) and `usage` (`{ promptTokens, completionTokens, costUsd, computeMs }`; `costUsd` is `null` when no cost was recorded). `links` is `{ redirectedTo, redirectedFrom }`: arrays of `{ jobId, at, note }` naming missions this one was redirected into or from, at most 20 in total and limited to missions the caller can see. `reviews` lists up to 50 recorded reviews, oldest first, as `{ verdict, note, at, byYou }`; the most recent one is the current verdict, and `byYou` is `true` only when the caller recorded it. The response is sent with `Cache-Control: no-store`.",
            "content": {
              "application/json": {
                "example": {
                  "nodes": [
                    {
                      "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "rootId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "parentId": null,
                      "depth": 0,
                      "status": "done",
                      "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                      "agentName": "Research lead",
                      "objective": "Summarize the supplier contracts that renew next quarter.",
                      "output": "Three contracts renew next quarter. The largest is the logistics agreement.",
                      "error": null,
                      "rounds": 4,
                      "createdAt": "2026-11-20T09:14:02.000Z",
                      "updatedAt": "2026-11-20T09:21:47.000Z",
                      "holdExpiresAt": null,
                      "terminalReason": null,
                      "receiptId": "b84d1f02-6c3a-4e19-a7d5-2f0c9e3b6a48",
                      "deep": true,
                      "ceiling": {
                        "authority": "recommend",
                        "actions": [
                          "summarize",
                          "draft",
                          "recommend",
                          "connector_read",
                          "spawn_subagent"
                        ],
                        "dataClasses": [
                          "internal"
                        ],
                        "placements": [
                          "cloud_model",
                          "cloud_connector",
                          "cloud_connector_write"
                        ],
                        "tools": [
                          "search_documents"
                        ],
                        "depth": 0
                      },
                      "tools": [
                        {
                          "tool": "search_documents",
                          "connection": "Contracts library",
                          "ok": true,
                          "outcome": "authorized"
                        },
                        {
                          "tool": "spawn_subagent",
                          "connection": "CoA",
                          "ok": true,
                          "outcome": "authorized"
                        }
                      ],
                      "heldActions": [],
                      "usage": {
                        "promptTokens": 9120,
                        "completionTokens": 1630,
                        "costUsd": 0.0124,
                        "computeMs": 18450
                      }
                    },
                    {
                      "id": "c5d09a77-1e42-4b6f-9d03-8a7b6c5d4e21",
                      "rootId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "parentId": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "depth": 1,
                      "status": "done",
                      "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                      "agentName": "Research lead",
                      "objective": "List renewal dates for the logistics agreement.",
                      "output": "The logistics agreement renews on 1 February.",
                      "error": null,
                      "rounds": 2,
                      "createdAt": "2026-11-20T09:15:10.000Z",
                      "updatedAt": "2026-11-20T09:18:33.000Z",
                      "holdExpiresAt": null,
                      "terminalReason": null,
                      "receiptId": "d17a5c3e-8b40-4f92-a6c1-9e0f2b4d7a85",
                      "deep": true,
                      "ceiling": {
                        "authority": "answer",
                        "actions": [
                          "summarize",
                          "connector_read"
                        ],
                        "dataClasses": [
                          "internal"
                        ],
                        "placements": [
                          "cloud_model",
                          "cloud_connector"
                        ],
                        "tools": [
                          "search_documents"
                        ],
                        "depth": 1
                      },
                      "tools": [
                        {
                          "tool": "search_documents",
                          "connection": "Contracts library",
                          "ok": true,
                          "outcome": "authorized"
                        }
                      ],
                      "heldActions": [],
                      "usage": {
                        "promptTokens": 2720,
                        "completionTokens": 445,
                        "costUsd": 0.0037,
                        "computeMs": 6120
                      }
                    }
                  ],
                  "links": {
                    "redirectedTo": [],
                    "redirectedFrom": []
                  },
                  "reviews": [
                    {
                      "verdict": "accepted",
                      "note": null,
                      "at": "2026-11-20T10:02:11.000Z",
                      "byYou": false
                    }
                  ],
                  "generatedAt": "2026-11-21T08:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_id`: `id` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_id": {
                    "value": {
                      "error": "invalid_id"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`: No job with this id exists in the workspace, or the caller is not allowed to see its mission.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": "not_found"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/missions/outcomes": {
      "get": {
        "operationId": "getMissionsOutcomes",
        "summary": "List missions that finished in the last 7, 30 or 90 days",
        "description": "Returns one row per mission whose root job finished (`done` or `error`) inside the window, newest first, with the job count, delegation depth, token usage and recorded cost summed across the mission's jobs. At most 500 rows are returned; `truncated` is `true` when 500 rows came back, so the window may hold more. A job with no recorded cost is counted in `unpricedJobs` and is never added to `knownCostUsd` as zero. Text is shortened: `objective` to 300 characters, `output` to 600, `error` to 240, and the latest review note to 280.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member. A workspace admin signed in to the web workspace gets every finished mission in the workspace (`scope` is `workspace`). Any other member gets only missions they started, and an API key only missions started with that same key (`scope` is `own`).",
        "tags": [
          "Missions and tasks"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/missions-tasks#get-missions-outcomes"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Window in days, counted back from now. Defaults to `7`.",
            "schema": {
              "type": "integer",
              "enum": [
                7,
                30,
                90
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An object `{ missions, windowDays, scope, limit, truncated, generatedAt }`. Each mission has `id`, `agentId`, `agentName`, `objective`, `output`, `error`, `status`, `terminalReason`, `createdAt`, `finishedAt`, `receiptId`, `deep`, `jobs` (the root plus every delegated job), `maxDepth`, `knownCostUsd`, `unpricedJobs`, `promptTokens`, `completionTokens` and `review` (the latest review `{ verdict, at, note }`, or `null` when none was recorded). `scope` is `workspace` or `own`, and `limit` is `500`. The response is sent with `Cache-Control: no-store`.",
            "content": {
              "application/json": {
                "example": {
                  "missions": [
                    {
                      "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                      "agentId": "7a2e4c10-5b3f-4d8a-8c66-1e9d0a4b2f37",
                      "agentName": "Research lead",
                      "objective": "Summarize the supplier contracts that renew next quarter.",
                      "output": "Three contracts renew next quarter. The largest is the logistics agreement.",
                      "error": null,
                      "status": "done",
                      "terminalReason": null,
                      "createdAt": "2026-11-20T09:14:02.000Z",
                      "finishedAt": "2026-11-20T09:21:47.000Z",
                      "receiptId": "b84d1f02-6c3a-4e19-a7d5-2f0c9e3b6a48",
                      "deep": true,
                      "jobs": 2,
                      "maxDepth": 1,
                      "knownCostUsd": 0.0161,
                      "unpricedJobs": 0,
                      "promptTokens": 11840,
                      "completionTokens": 2075,
                      "review": {
                        "verdict": "accepted",
                        "at": "2026-11-20T10:02:11.000Z",
                        "note": null
                      }
                    }
                  ],
                  "windowDays": 30,
                  "scope": "own",
                  "limit": 500,
                  "truncated": false,
                  "generatedAt": "2026-11-21T08:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_window`: `window` is present but is not `7`, `30` or `90`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_window": {
                    "value": {
                      "error": "invalid_window"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/operations:execute": {
      "post": {
        "operationId": "postV1OperationsExecute",
        "summary": "Decide one bound action and execute it when authorized",
        "description": "**Status: Pilot.** Closed unless Center of Agentic has enabled it; limited in scope, and the contract can still change.\n\nRequires `Content-Type: application/json` and an `Idempotency-Key` header of 12 to 128 characters (letters, digits, `_`, `.`, `:`, `-`); repeating the same request with the same key returns the existing operation instead of running it again. A denial is not an HTTP error: the response is `200` with `state` `denied` and the reason in `authorization`, and a request that policy would allow is denied with `reasonCode` `SPEND_UNVERIFIABLE` when a spend cap applies to the workspace or to the agent's authority level. If the bound tool reports an error, or the outcome of a dispatched call cannot be confirmed, the operation becomes `unknown` and no `result` is released. Read its status in that case and do not send the action again as a new operation.\n\n**Access:** API key with the `run` scope. Only the runtime key minted for an active external agent is accepted; ordinary workspace API keys and browser sessions are refused. Closed unless Center of Agentic has enabled the external agent pilot for the service.",
        "tags": [
          "External agents and governed operations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/external-agents#post-v1-operations-execute"
        },
        "security": [
          {
            "ApiKey": [
              "run"
            ]
          }
        ],
        "x-coa-scope": "run",
        "x-coa-status": "pilot",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A key that you choose for this operation: 12 to 128 characters from letters, digits, `_`, `.`, `:` and `-`. Repeating the request with the same key and the same body returns the existing operation instead of running it again, and the same key with a different body, or a key already used with authorize, is refused with `409 idempotency_conflict`. A request without the header, or with a malformed value, is refused with `400 invalid_operation_request`; see [Idempotency and retries](https://centerofagentic.com/docs/api#retries).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "schemaVersion": {
                    "type": "string",
                    "enum": [
                      "1"
                    ],
                    "description": "Version of the request format. Always the string `1`."
                  },
                  "externalRunId": {
                    "type": "string",
                    "description": "Your identifier for the agent run: 1 to 128 letters, digits, `_`, `.`, `:` or `-`."
                  },
                  "externalOperationId": {
                    "type": "string",
                    "description": "Your identifier for this operation within the run, same format. The pair of `externalRunId` and `externalOperationId` can be used once per agent."
                  },
                  "bindingId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The action binding to use. It must belong to the calling agent."
                  },
                  "action": {
                    "type": "string",
                    "description": "The action name of that binding. A different name is refused."
                  },
                  "arguments": {
                    "type": "object",
                    "description": "A flat object of at most 32 string, number or boolean values that matches the binding's argument schema: only declared names, the declared types, every required argument present. Nested objects, arrays and `null` are refused. At most 32,000 bytes; the whole body at most 40,000 bytes."
                  }
                },
                "required": [
                  "schemaVersion",
                  "externalRunId",
                  "externalOperationId",
                  "bindingId",
                  "action",
                  "arguments"
                ]
              },
              "example": {
                "schemaVersion": "1",
                "externalRunId": "run-2026-11-28",
                "externalOperationId": "op-0001",
                "bindingId": "7d2e4b6a-9c1f-4a3e-8b5d-0f1e2d3c4b5a",
                "action": "lookup_issue",
                "arguments": {
                  "issueKey": "DEMO-1"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`{ operation }` with status `200`, or `202` while the operation is `pending` or `dispatching`. The operation has `id`, `state`, `decisionId`, `authorization` (the recorded decision: `outcome` of `authorized`, `pending` or `denied`, `reasonCode`, `reason` when the outcome is not `authorized`, `placement` unless the outcome is `denied`, `approval`, `budget`, `obligations`, and the `policy` and `toolPolicy` evaluations), `mode` (`execute`), `usage` (`priceStatus` is always `unpriced` and `spendEnforced` always `false`), `assurance` (`tier` 2 and `evidenceClass` `enforcement`: the platform dispatched the call itself) and, only when `state` is `completed`, `result` (`content` as text, `isError`, `reasonCode`). A result larger than 64 KiB is not released and leaves the operation `unknown`.",
            "content": {
              "application/json": {
                "example": {
                  "operation": {
                    "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
                    "state": "completed",
                    "decisionId": "c4a1e2b3-5d6f-4a7b-8c9d-0e1f2a3b4c5d",
                    "authorization": {
                      "outcome": "authorized",
                      "reasonCode": "ALLOWED",
                      "placement": "cloud_connector",
                      "approval": "not_required",
                      "budget": {
                        "verdict": "no_cap",
                        "scope": null,
                        "reason": "No spend cap applies."
                      },
                      "obligations": [
                        {
                          "kind": "logging",
                          "layer": "law_regulation",
                          "ruleId": "obl_logging_8",
                          "reason": "audit_all_runs"
                        }
                      ],
                      "discharged": [
                        {
                          "kind": "logging",
                          "layer": "law_regulation",
                          "ruleId": "obl_logging_8",
                          "reason": "audit_all_runs"
                        }
                      ],
                      "toolPolicy": {
                        "verdict": "allow",
                        "rule": null,
                        "reason": null,
                        "violations": [],
                        "obligations": [],
                        "recorded": []
                      },
                      "policy": {
                        "action": "connector_read",
                        "object": {
                          "connector": "jira",
                          "resource": "get_issue",
                          "dataClass": "public"
                        },
                        "placement_requested": "cloud_connector",
                        "decision": "allow",
                        "reason_code": "ALLOWED",
                        "applicable_allowlist_layers": [
                          "tenant_admin",
                          "package_manifest",
                          "role_team",
                          "user_identity",
                          "connector_scope"
                        ],
                        "allow_rules_matched": [
                          "allow_tenant_admin_a",
                          "allow_package_manifest_b",
                          "allow_role_team_c",
                          "allow_user_identity_d",
                          "allow_connector_scope_e"
                        ],
                        "allowlist_layers_missing_grant": [],
                        "deny_rules_matched": [],
                        "obligations": [
                          {
                            "kind": "logging",
                            "layer": "law_regulation",
                            "ruleId": "obl_logging_8",
                            "reason": "audit_all_runs"
                          }
                        ],
                        "surviving_placements": [
                          "cloud_connector"
                        ],
                        "evaluated_at": "2026-11-28T10:15:00.000Z",
                        "policy_bundle_id": "tenant-policy-1b2c3d4e"
                      },
                      "operationDigest": "41c17d5d4aa41a790940b820bcd2a490a4fe40b3918bf01925a481afa01891be"
                    },
                    "mode": "execute",
                    "usage": {
                      "priceStatus": "unpriced",
                      "spendEnforced": false
                    },
                    "assurance": {
                      "tier": 2,
                      "evidenceClass": "enforcement"
                    },
                    "result": {
                      "content": "DEMO-1: Example issue (status: Open)",
                      "isError": false,
                      "reasonCode": null
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "`{ operation }` with status `200`, or `202` while the operation is `pending` or `dispatching`. The operation has `id`, `state`, `decisionId`, `authorization` (the recorded decision: `outcome` of `authorized`, `pending` or `denied`, `reasonCode`, `reason` when the outcome is not `authorized`, `placement` unless the outcome is `denied`, `approval`, `budget`, `obligations`, and the `policy` and `toolPolicy` evaluations), `mode` (`execute`), `usage` (`priceStatus` is always `unpriced` and `spendEnforced` always `false`), `assurance` (`tier` 2 and `evidenceClass` `enforcement`: the platform dispatched the call itself) and, only when `state` is `completed`, `result` (`content` as text, `isError`, `reasonCode`). A result larger than 64 KiB is not released and leaves the operation `unknown`.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`invalid_operation_json`: The JSON body repeats a key, is nested too deeply or is not valid UTF-8.\n\n`invalid_operation_request`: A body field other than `bindingId` is missing, unknown or malformed, or the `Idempotency-Key` header is missing or malformed.\n\n`invalid_external_agent_id`: `bindingId` is missing or not a UUID.\n\n`action_arguments_invalid`: `arguments` does not match the binding's argument schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_operation_json": {
                    "value": {
                      "error": "invalid_operation_json"
                    }
                  },
                  "invalid_operation_request": {
                    "value": {
                      "error": "invalid_operation_request"
                    }
                  },
                  "invalid_external_agent_id": {
                    "value": {
                      "error": "invalid_external_agent_id"
                    }
                  },
                  "action_arguments_invalid": {
                    "value": {
                      "error": "action_arguments_invalid"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "description": "`external_workload_credential_required`: The credential is not the runtime key of an external agent. An ordinary workspace API key gets this answer.\n\n`external_owner_admin_required`: The admin who registered the agent is no longer a workspace admin.\n\n`external_identity_unavailable`: The agent is not `active`, the key was minted in an earlier `epoch` of the agent, or the agent's `entryPoints` do not include `rest`.\n\nThe credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "external_workload_credential_required": {
                    "value": {
                      "error": "external_workload_credential_required"
                    }
                  },
                  "external_owner_admin_required": {
                    "value": {
                      "error": "external_owner_admin_required"
                    }
                  },
                  "external_identity_unavailable": {
                    "value": {
                      "error": "external_identity_unavailable"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "`action_binding_not_found`: The binding does not belong to the calling agent, or `action` is not the binding's action name.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "action_binding_not_found": {
                    "value": {
                      "error": "action_binding_not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: The idempotency key was already used with a different request or mode, or the run and operation ids were already used under a different key.\n\n`connection_unavailable`: The bound connection no longer exists or is not connected.\n\n`operation_dispatch_not_claimed`: The agent, its key or the decision changed between the decision and dispatch; the call was not sent.\n\n`production_profile_not_certified`: The agent is registered as `production`. During the pilot these endpoints serve only `sandbox` and `staging` agents.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "idempotency_conflict": {
                    "value": {
                      "error": "idempotency_conflict"
                    }
                  },
                  "connection_unavailable": {
                    "value": {
                      "error": "connection_unavailable"
                    }
                  },
                  "operation_dispatch_not_claimed": {
                    "value": {
                      "error": "operation_dispatch_not_claimed"
                    }
                  },
                  "production_profile_not_certified": {
                    "value": {
                      "error": "production_profile_not_certified"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "`operation_payload_too_large`: The body is larger than 40,000 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "operation_payload_too_large": {
                    "value": {
                      "error": "operation_payload_too_large"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "`json_required`: `Content-Type` is not `application/json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "json_required": {
                    "value": {
                      "error": "json_required"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "`external_operation_rate_limit`: The workspace created 30 external operations in the last 60 seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "external_operation_rate_limit": {
                    "value": {
                      "error": "external_operation_rate_limit"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`operation_outcome_unknown`: The call was dispatched but its outcome could not be confirmed; the operation is now `unknown`.\n\n`external_pilot_disabled`: Center of Agentic has not enabled the pilot for the service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "operation_outcome_unknown": {
                    "value": {
                      "error": "operation_outcome_unknown"
                    }
                  },
                  "external_pilot_disabled": {
                    "value": {
                      "error": "external_pilot_disabled"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/operations:authorize": {
      "post": {
        "operationId": "postV1OperationsAuthorize",
        "summary": "Decide one bound action without executing it",
        "description": "**Status: Pilot.** Closed unless Center of Agentic has enabled it; limited in scope, and the contract can still change.\n\nTakes the same headers and body as execute and records the same kind of decision, but never dispatches the call, so an allowed request ends in state `authorized`. Use it as a check before the agent carries out the action itself. Idempotency keys are shared with execute: a key, or a pair of run and operation ids, that was used in one mode cannot be reused in the other. Request validation errors are the same as for execute.\n\n**Access:** API key with the `run` scope. Only the runtime key minted for an active external agent is accepted; ordinary workspace API keys and browser sessions are refused. Closed unless Center of Agentic has enabled the external agent pilot for the service.",
        "tags": [
          "External agents and governed operations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/external-agents#post-v1-operations-authorize"
        },
        "security": [
          {
            "ApiKey": [
              "run"
            ]
          }
        ],
        "x-coa-scope": "run",
        "x-coa-status": "pilot",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A key that you choose for this operation: 12 to 128 characters from letters, digits, `_`, `.`, `:` and `-`. Repeating the request with the same key and the same body returns the existing operation instead of deciding it again, and the same key with a different body, or a key already used with execute, is refused with `409 idempotency_conflict`. A request without the header, or with a malformed value, is refused with `400 invalid_operation_request`; see [Idempotency and retries](https://centerofagentic.com/docs/api#retries).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "schemaVersion": {
                    "type": "string",
                    "enum": [
                      "1"
                    ],
                    "description": "Version of the request format. Always the string `1`."
                  },
                  "externalRunId": {
                    "type": "string",
                    "description": "Your identifier for the agent run: 1 to 128 letters, digits, `_`, `.`, `:` or `-`."
                  },
                  "externalOperationId": {
                    "type": "string",
                    "description": "Your identifier for this operation within the run, same format."
                  },
                  "bindingId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The action binding to use. It must belong to the calling agent."
                  },
                  "action": {
                    "type": "string",
                    "description": "The action name of that binding."
                  },
                  "arguments": {
                    "type": "object",
                    "description": "A flat object that matches the binding's argument schema, with the same limits as for execute."
                  }
                },
                "required": [
                  "schemaVersion",
                  "externalRunId",
                  "externalOperationId",
                  "bindingId",
                  "action",
                  "arguments"
                ]
              },
              "example": {
                "schemaVersion": "1",
                "externalRunId": "run-2026-11-28",
                "externalOperationId": "op-0002",
                "bindingId": "7d2e4b6a-9c1f-4a3e-8b5d-0f1e2d3c4b5a",
                "action": "lookup_issue",
                "arguments": {
                  "issueKey": "DEMO-2"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`{ operation }` with status `200`, or `202` while the operation is `pending`. The operation has the same fields as for execute, with `mode` `authorize` and `assurance` of `tier` 0 and `evidenceClass` `observation`: the platform recorded a decision and did not carry out the call. `result` is never present.",
            "content": {
              "application/json": {}
            }
          },
          "202": {
            "description": "`{ operation }` with status `200`, or `202` while the operation is `pending`. The operation has the same fields as for execute, with `mode` `authorize` and `assurance` of `tier` 0 and `evidenceClass` `observation`: the platform recorded a decision and did not carry out the call. `result` is never present.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`invalid_operation_json`: The JSON body repeats a key, is nested too deeply or is not valid UTF-8.\n\n`invalid_operation_request`: A body field other than `bindingId` is missing, unknown or malformed, or the `Idempotency-Key` header is missing or malformed.\n\n`invalid_external_agent_id`: `bindingId` is missing or not a UUID.\n\n`action_arguments_invalid`: `arguments` does not match the binding's argument schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_operation_json": {
                    "value": {
                      "error": "invalid_operation_json"
                    }
                  },
                  "invalid_operation_request": {
                    "value": {
                      "error": "invalid_operation_request"
                    }
                  },
                  "invalid_external_agent_id": {
                    "value": {
                      "error": "invalid_external_agent_id"
                    }
                  },
                  "action_arguments_invalid": {
                    "value": {
                      "error": "action_arguments_invalid"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "description": "`external_workload_credential_required`: The credential is not the runtime key of an external agent. An ordinary workspace API key gets this answer.\n\n`external_owner_admin_required`: The admin who registered the agent is no longer a workspace admin.\n\n`external_identity_unavailable`: The agent is not `active`, the key was minted in an earlier `epoch` of the agent, or the agent's `entryPoints` do not include `rest`.\n\nThe credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "external_workload_credential_required": {
                    "value": {
                      "error": "external_workload_credential_required"
                    }
                  },
                  "external_owner_admin_required": {
                    "value": {
                      "error": "external_owner_admin_required"
                    }
                  },
                  "external_identity_unavailable": {
                    "value": {
                      "error": "external_identity_unavailable"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "`action_binding_not_found`: The binding does not belong to the calling agent, or `action` is not the binding's action name.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "action_binding_not_found": {
                    "value": {
                      "error": "action_binding_not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: The idempotency key was already used with a different request or mode, or the run and operation ids were already used under a different key.\n\n`connection_unavailable`: The bound connection no longer exists or is not connected.\n\n`production_profile_not_certified`: The agent is registered as `production`. During the pilot these endpoints serve only `sandbox` and `staging` agents.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "idempotency_conflict": {
                    "value": {
                      "error": "idempotency_conflict"
                    }
                  },
                  "connection_unavailable": {
                    "value": {
                      "error": "connection_unavailable"
                    }
                  },
                  "production_profile_not_certified": {
                    "value": {
                      "error": "production_profile_not_certified"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "`operation_payload_too_large`: The body is larger than 40,000 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "operation_payload_too_large": {
                    "value": {
                      "error": "operation_payload_too_large"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "`json_required`: `Content-Type` is not `application/json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "json_required": {
                    "value": {
                      "error": "json_required"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "`external_operation_rate_limit`: The workspace created 30 external operations in the last 60 seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "external_operation_rate_limit": {
                    "value": {
                      "error": "external_operation_rate_limit"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`external_pilot_disabled`: Center of Agentic has not enabled the pilot for the service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "external_pilot_disabled": {
                    "value": {
                      "error": "external_pilot_disabled"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/operations/{id}": {
      "get": {
        "operationId": "getV1OperationsById",
        "summary": "Get the state and result of an operation",
        "description": "**Status: Pilot.** Closed unless Center of Agentic has enabled it; limited in scope, and the contract can still change.\n\nReturns an operation that the calling agent created. Reading also settles stale states: an operation left in `authorizing` or `dispatching` for more than ten minutes becomes `unknown`, a `pending`, `ready` or `authorized` operation becomes `expired` once its 24-hour window has passed, and `invalidated` when the agent's `epoch` has changed since the request. Poll this endpoint while an operation is `pending`, and after any response you did not receive.\n\n**Access:** API key with the `read` scope. Only the runtime key of the external agent that created the operation is accepted; it carries the `run` scope, which includes `read`. Ordinary workspace API keys and browser sessions are refused. Closed unless Center of Agentic has enabled the external agent pilot for the service.",
        "tags": [
          "External agents and governed operations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/external-agents#get-v1-operations-id"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "x-coa-status": "pilot",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The operation id returned by execute or authorize.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ operation }` with the same fields as for execute. `result` is included only while `state` is `completed`, and `authorization` and `decisionId` are `null` until a decision is recorded.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`invalid_external_agent_id`: `id` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_external_agent_id": {
                    "value": {
                      "error": "invalid_external_agent_id"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "description": "`external_workload_credential_required`: The credential is not the runtime key of an external agent. An ordinary workspace API key gets this answer.\n\n`external_owner_admin_required`: The admin who registered the agent is no longer a workspace admin.\n\n`external_identity_unavailable`: The agent is not `active`, the key was minted in an earlier `epoch` of the agent, or the agent's `entryPoints` do not include `rest`.\n\nThe credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "external_workload_credential_required": {
                    "value": {
                      "error": "external_workload_credential_required"
                    }
                  },
                  "external_owner_admin_required": {
                    "value": {
                      "error": "external_owner_admin_required"
                    }
                  },
                  "external_identity_unavailable": {
                    "value": {
                      "error": "external_identity_unavailable"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "`operation_not_found`: No operation with this id was created by the calling agent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "operation_not_found": {
                    "value": {
                      "error": "operation_not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`production_profile_not_certified`: The agent is registered as `production`. During the pilot these endpoints serve only `sandbox` and `staging` agents.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "production_profile_not_certified": {
                    "value": {
                      "error": "production_profile_not_certified"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`external_pilot_disabled`: Center of Agentic has not enabled the pilot for the service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "external_pilot_disabled": {
                    "value": {
                      "error": "external_pilot_disabled"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/operations/{id}/resume": {
      "post": {
        "operationId": "postV1OperationsByIdResume",
        "summary": "Resume an operation after it was approved",
        "description": "**Status: Pilot.** Closed unless Center of Agentic has enabled it; limited in scope, and the contract can still change.\n\nWhen a reviewer approves a held operation it moves to `ready`, and the agent then calls resume with `{}` or no body. The platform decides the original request again under current policy and checks that the approval still covers exactly that request. It then dispatches the call (execute mode) or marks the operation `authorized` (authorize mode). A runtime key minted after the operation was created cannot resume it.\n\n**Access:** API key with the `run` scope. Only the runtime key of the external agent that created the operation is accepted; ordinary workspace API keys and browser sessions are refused. Closed unless Center of Agentic has enabled the external agent pilot for the service.",
        "tags": [
          "External agents and governed operations"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/external-agents#post-v1-operations-id-resume"
        },
        "security": [
          {
            "ApiKey": [
              "run"
            ]
          }
        ],
        "x-coa-scope": "run",
        "x-coa-status": "pilot",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The operation id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ operation }` with status `200` and the same fields as for execute. The state is normally `completed`, `denied` or `unknown` in execute mode, and `authorized` or `denied` in authorize mode.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "`unexpected_fields`: The request body contains any field.\n\n`invalid_external_agent_id`: `id` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unexpected_fields": {
                    "value": {
                      "error": "unexpected_fields"
                    }
                  },
                  "invalid_external_agent_id": {
                    "value": {
                      "error": "invalid_external_agent_id"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "description": "`external_workload_credential_required`: The credential is not the runtime key of an external agent. An ordinary workspace API key gets this answer.\n\n`external_owner_admin_required`: The admin who registered the agent is no longer a workspace admin.\n\n`external_identity_unavailable`: The agent is not `active`, the key was minted in an earlier `epoch` of the agent, or the agent's `entryPoints` do not include `rest`.\n\nThe credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "external_workload_credential_required": {
                    "value": {
                      "error": "external_workload_credential_required"
                    }
                  },
                  "external_owner_admin_required": {
                    "value": {
                      "error": "external_owner_admin_required"
                    }
                  },
                  "external_identity_unavailable": {
                    "value": {
                      "error": "external_identity_unavailable"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "`operation_not_found`: No operation with this id was created by the calling agent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "operation_not_found": {
                    "value": {
                      "error": "operation_not_found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`operation_not_resumable`: The operation is not `ready`, was not approved, or its review window has passed.\n\n`connection_unavailable`: The bound connection no longer exists or is not connected.\n\n`operation_epoch_changed`: The agent was activated again or given a new key after the operation was created.\n\n`operation_dispatch_not_claimed`: The agent, its key or the decision changed between the decision and dispatch; the call was not sent.\n\n`production_profile_not_certified`: The agent is registered as `production`. During the pilot these endpoints serve only `sandbox` and `staging` agents.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "operation_not_resumable": {
                    "value": {
                      "error": "operation_not_resumable"
                    }
                  },
                  "connection_unavailable": {
                    "value": {
                      "error": "connection_unavailable"
                    }
                  },
                  "operation_epoch_changed": {
                    "value": {
                      "error": "operation_epoch_changed"
                    }
                  },
                  "operation_dispatch_not_claimed": {
                    "value": {
                      "error": "operation_dispatch_not_claimed"
                    }
                  },
                  "production_profile_not_certified": {
                    "value": {
                      "error": "production_profile_not_certified"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`operation_outcome_unknown`: The call was dispatched but its outcome could not be confirmed; the operation is now `unknown`.\n\n`external_pilot_disabled`: Center of Agentic has not enabled the pilot for the service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "operation_outcome_unknown": {
                    "value": {
                      "error": "operation_outcome_unknown"
                    }
                  },
                  "external_pilot_disabled": {
                    "value": {
                      "error": "external_pilot_disabled"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/desktop/me": {
      "get": {
        "operationId": "getDesktopMe",
        "summary": "Show the identity and workspace behind a credential",
        "description": "Returns the caller's identity and active workspace. The desktop app calls it to confirm its stored device token, and it works the same way for an API key, so it is a quick check that a key is valid and which workspace it belongs to. For an API key, `userId` is `api-key:` followed by the key's id; for a session or device token it is the member's user id.\n\n**Access:** API key with the `read` scope, or a signed-in workspace member. Device tokens are accepted. An API key that belongs to a registered external agent is refused with `403` and the error code `external_credential_not_supported`.",
        "tags": [
          "Desktop app and device tokens"
        ],
        "externalDocs": {
          "description": "Reference page",
          "url": "https://centerofagentic.com/docs/api/desktop#get-desktop-me"
        },
        "security": [
          {
            "ApiKey": [
              "read"
            ]
          }
        ],
        "x-coa-scope": "read",
        "parameters": [
          {
            "name": "X-Client",
            "in": "header",
            "required": false,
            "description": "Required only when the credential is a device token: send `X-Client: electron`. A device token sent without it is not accepted, and the request is answered with `401 unauthenticated`. API keys and browser sessions do not need it.",
            "schema": {
              "type": "string",
              "enum": [
                "electron"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An object `{ userId, orgId, orgSlug, tenantId }`. `orgId` is the workspace's organization id, `orgSlug` is its URL slug (can be `null`) and `tenantId` is the workspace's id as a UUID.",
            "content": {
              "application/json": {
                "example": {
                  "userId": "api-key:5d0e7c2a-41b8-4c6f-9f0a-2b7e6d1c3a90",
                  "orgId": "org_2xExampleWorkspace",
                  "orgSlug": "example-workspace",
                  "tenantId": "9b2d4c1e-7a3f-4f0b-8c6d-2e5a1b0f9c33"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A workspace API key, sent as `Authorization: Bearer ak_...`. Each operation names the scope it needs: `read`, `run` (includes `read`) or `admin` (includes both). See [Authentication](https://centerofagentic.com/docs/authentication). The pilot operations for external agents accept only that agent's runtime key, sent the same way; their descriptions say so."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "The error body. Branch on the HTTP status and on `error`; the wording of `detail` can change. Some errors add fields. See [Errors](https://centerofagentic.com/docs/api/errors).",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "A short machine-readable code."
          },
          "detail": {
            "description": "Usually a sentence for a person. A few errors put structured data here instead; the operation says so. Not every error has one."
          }
        },
        "additionalProperties": true
      }
    },
    "responses": {
      "Unauthenticated": {
        "description": "`unauthenticated`: the `Authorization` header is missing or malformed, or the key is wrong, revoked or expired.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "unauthenticated": {
                "value": {
                  "error": "unauthenticated"
                }
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "The credential may not call this operation, for example `insufficient_scope` or `capability_denied`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "insufficient_scope": {
                "value": {
                  "error": "insufficient_scope"
                }
              }
            }
          }
        }
      },
      "Error": {
        "description": "Any other error. The codes that every operation can return are listed under [Errors](https://centerofagentic.com/docs/api/errors).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
