> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canary.effectiveai.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage agents

> Change an agent's instructions and keep each version, share an agent in a project, choose its tools, and delete an agent you no longer need.

Each saved agent keeps every version of its configuration. A session runs the version it started with, so you can improve an agent without changing replies that are already under way.

This page uses the boatowners research agent from [Create and run an agent](https://docs.canary.effectiveai.app/guides/agents.md). Replace its `id` with your own agent's.

## Change the instructions

Saving a change creates a new version with the full configuration, not only the part you changed. Pass the version you edited as `expectedVersion`. This adds one line to the instructions so that each reply ends with the tracking numbers it cites:

```bash theme={"languages":{"custom":["languages/rsl.tmLanguage.json"]}}
cat >> instructions.md <<'EOF2'

End each reply with a one-line list of the tracking numbers cited.
EOF2

jq --null-input --rawfile instructions instructions.md '{
  name: "Boatowners rating plan researcher",
  description: "Researches how insurers rate boatowners coverage from their rate and rule filings.",
  model: "claude-sonnet-5-5",
  inheritWorkspaceTools: true,
  instructions: $instructions,
  expectedVersion: "1"
}' | curl --request POST \
  --url "https://api.canary.effectiveai.app/api/v2/agents/agent_a73193f8-de15-457e-8ee9-7c9086f3ef6c/versions" \
  --header "Authorization: Bearer $EFFECTIVE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data @-
```

The API returns `201 Created` with the new version, now the agent's latest. Start new sessions with `agentVersion` `"2"` to use it. Abbreviated response:

```json theme={"languages":{"custom":["languages/rsl.tmLanguage.json"]}}
{
  "id": "agent_a73193f8-de15-457e-8ee9-7c9086f3ef6c",
  "version": "2",
  "createdAt": "2026-12-03T01:23:43.724Z"
}
```

If someone saved a version after the one you edited, the API returns `409` with the code `agent_version_conflict` and saves nothing, so you never overwrite a change you have not seen:

```json theme={"languages":{"custom":["languages/rsl.tmLanguage.json"]}}
{
  "code": "agent_version_conflict",
  "error": "expectedVersion is not the agent’s latest version. Read the agent and save your changes on its latest version."
}
```

Read the latest version with `GET /api/v2/agents/{id}`, apply your change to it, and save again with its `version` as `expectedVersion`.

## See earlier versions

List an agent's versions, newest first, each with its full configuration:

```bash theme={"languages":{"custom":["languages/rsl.tmLanguage.json"]}}
curl --request GET \
  --url "https://api.canary.effectiveai.app/api/v2/agents/agent_a73193f8-de15-457e-8ee9-7c9086f3ef6c/versions" \
  --header "Authorization: Bearer $EFFECTIVE_API_KEY"
```

Abbreviated response:

```json theme={"languages":{"custom":["languages/rsl.tmLanguage.json"]}}
{
  "data": [
    {
      "id": "agent_a73193f8-de15-457e-8ee9-7c9086f3ef6c",
      "version": "2",
      "createdAt": "2026-12-03T01:23:43.724Z"
    },
    {
      "id": "agent_a73193f8-de15-457e-8ee9-7c9086f3ef6c",
      "version": "1",
      "createdAt": "2026-12-03T01:22:38.269Z"
    }
  ],
  "nextCursor": null
}
```

A page holds up to 20 versions; pass `nextCursor` as `cursor` for the next page, as described in [Pagination](https://docs.canary.effectiveai.app/getting-started/pagination.md). Read one version with `GET /api/v2/agents/{id}?version=1`. To go back to an earlier version, save its configuration as a new version.

## Share an agent in a project

An agent saved without `projectId` belongs to the workspace, and only the person who saved it can change it. To let a team use and change it, save it in a project instead: add `projectId`, an `id` from `GET /api/v2/projects`, to the request in [Save the agent](https://docs.canary.effectiveai.app/guides/agents.md#save-the-agent). You need edit access to the project.

```bash theme={"languages":{"custom":["languages/rsl.tmLanguage.json"]}}
jq --null-input --rawfile instructions instructions.md '{
  name: "Boatowners rating plan researcher",
  model: "claude-sonnet-5-5",
  inheritWorkspaceTools: true,
  instructions: $instructions,
  projectId: "build-effectively"
}' | curl --request POST \
  --url "https://api.canary.effectiveai.app/api/v2/agents" \
  --header "Authorization: Bearer $EFFECTIVE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data @-
```

Abbreviated response:

```json theme={"languages":{"custom":["languages/rsl.tmLanguage.json"]}}
{
  "id": "agent_d5fcdf4d-7381-4549-bd73-dce6ac333653",
  "projectId": "build-effectively",
  "version": "1"
}
```

Everyone who can view the project can run the agent, and everyone who can edit the project can save new versions of it or delete it. Project agents are listed with the workspace's agents when you pass the project: `GET /api/v2/agents?projectId=build-effectively`.

## Choose its tools

`inheritWorkspaceTools: true` gives the agent the same tools as Effective's own agent. To limit it, leave `inheritWorkspaceTools` out and list the tools it may use in `tools`: `filing_search`, `artifact_read`, `web_search` or `fetch_url`. An agent that only reads filings needs `filing_search` and `artifact_read`.

Either way, the agent acts with the access of the person who starts the session.

## Delete an agent

Deleting an agent removes it and all its versions:

```bash theme={"languages":{"custom":["languages/rsl.tmLanguage.json"]}}
curl --request DELETE \
  --url "https://api.canary.effectiveai.app/api/v2/agents/agent_d5fcdf4d-7381-4549-bd73-dce6ac333653" \
  --header "Authorization: Bearer $EFFECTIVE_API_KEY"
```

The API returns `204 No Content`. After that, reading the agent returns `404`, it no longer appears in `GET /api/v2/agents`, and new sessions cannot select it. Sessions already started with it keep running, and their messages and replies stay readable. A deletion cannot be undone.

You can delete an agent that you can change: one you saved in the workspace, or one in a project you can edit. Built-in agents, whose `id` does not start with `agent_`, cannot be deleted.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.