---
title: "Create an agent"
method: POST
path: "/v1/canvases/agent"
---

# Create an agent

`POST /v1/canvases/agent`

Create an agent in an existing or new canvas. Once created, agents will continue their work autonomously.

## Request body

- object
  - `context` object, required — The context to create the agent in. This context determines which data sources the agent has access to. You must have an analyst role in this context.
    - `type` union, required — The type of context
      - 'canvas' — Create an agent in a canvas context
      - 'project' — Create an agent in a project context
    - `context_key` string, required — The unique identifier for the context.
  - `query` string, required — An initial instruction for the agent

## Response `200`

Successful response

- object — Base response envelope for all successful API responses.
  - `success` true, required
  - `request_id` string, required
  - `result` object, required
    - `url` string, required — The URL of the agent
    - `canvas_key` string, required — The unique identifier for the canvas
    - `agent_key` string, required — The unique identifier for an agent within a canvas

## Other responses

- `4XX` — Client error. Possible status codes include: 400 (invalid request), 401 (missing or invalid API key), 403 (insufficient permissions), 404 (resource not found), 429 (rate limit exceeded).
- `5XX` — Internal server error.

---

[API](https://skmtc.net/count/apis/count-public-api.md) · [All operations](https://skmtc.net/count/apis/count-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/count/count-public-api/versions/858ed44750ff/schema)
