Agent endpoints

List, create, update and delete AI agents, rotate their API key and webhook secret, and send a test event through the REST API.

Updated

New in November 2026

Paths are relative to https://api.fishcamp.space/api/v1 and all need the X-Workspace-Id header and a person: requests with an API key get 403 forbidden on every agent route, reading included. Everyone in the workspace can list and read agents; creating, changing and deleting them are admin actions. What agents are and how they work is in AI agents, and the events they get are in Agent webhooks.

The agent object

{
  "id": "e5c4b3a2-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
  "name": "Scout",
  "role": "Lists what to track after a meeting",
  "instructions": "Suggest a task only when someone agrees on an owner and a date.",
  "autonomy": "PROPOSE",
  "events": ["message.created", "transcript.handoff"],
  "channelIds": ["0b6f3c55-2a51-4e0a-a3d6-6a3f1f2e9d10"],
  "webhookUrl": "https://scout.example.com/webhook",
  "status": "ACTIVE",
  "apiKeyPrefix": "cwk_8Hq2kL7x",
  "createdAt": "2026-11-05T14:00:00.000Z",
  "updatedAt": "2026-11-05T14:00:00.000Z",
  "lastDeliveryAt": "2026-11-05T15:26:03.000Z",
  "lastDeliveryStatus": 202,
  "lastError": null,
  "deliveriesOk": 18,
  "deliveriesFailed": 0
}
FieldDescription
roleWhat it does, up to 120 characters.
instructionsHow it should work, up to 4,000 characters. Sent with transcript handoffs.
autonomyOBSERVE, PROPOSE, ACT_LOW_RISK or AUTONOMOUS. See autonomy.
eventsThe events sent to its webhook. See Events.
channelIdsThe channels it works in. Its key only reaches these.
webhookUrlA public https address, or null.
statusACTIVE, or PAUSED when it gets no events.
apiKeyPrefixThe first characters of its active key, or null when the key was revoked.
lastDeliveryAt, lastDeliveryStatus, lastErrorThe last delivery, its HTTP status and its error, if any.
deliveriesOk, deliveriesFailedHow many deliveries worked and failed.

The API key and the webhook secret themselves are never in this object.

List agents

GET /agents
GET /agents/:agentId

People. The workspace's agents, sorted by name, or one agent. For members who aren't admins, webhookUrl is null, lastError only says Delivery failed, and channelIds lists only the channels they can see.

Create an agent

POST /agents

Admins.

FieldTypeRequiredDescription
namestringYes1 to 40 characters, unique in the workspace.
rolestringYesWhat it does, 1 to 120 characters.
instructionsstringNoHow it should work, up to 4,000 characters.
autonomystringYesOBSERVE, PROPOSE, ACT_LOW_RISK or AUTONOMOUS.
channelIdsarrayNoUp to 100 IDs of channels you can see: public channels, or private channels you're in. Not direct messages.
webhookUrlstring or nullNoA public https address without a user or password, up to 2,048 characters.
eventsarrayNoAny of message.created, audio.started, audio.ended, transcript.routed and transcript.handoff.
curl -X POST "https://api.fishcamp.space/api/v1/agents" \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Scout",
    "role": "Lists what to track after a meeting",
    "autonomy": "PROPOSE",
    "channelIds": ["0b6f3c55-2a51-4e0a-a3d6-6a3f1f2e9d10"],
    "webhookUrl": "https://scout.example.com/webhook",
    "events": ["message.created", "transcript.handoff"]
  }'

Returns 201 Created with agent (the agent object), apiKey (cwk_…) and, when you gave a webhook URL, webhookSecret (whsec_…). The key and the secret are in this response only.

ErrorWhen
409 conflictAnother agent already has that name.
422 validation_errorA field is invalid: for example, a webhook URL that isn't public https, a channel from another workspace, or a private channel you're not in.

Update an agent

PATCH /agents/:agentId

Admins. Send only the fields you want to change: the same ones as above, plus status (ACTIVE or PAUSED). Returns the agent.

  • A new autonomy or name applies to the agent's key at once.
  • "webhookUrl": null removes the webhook and its secret.
  • Adding a webhook URL to an agent that had none creates a secret, but this response doesn't include it. Call rotate-secret to get one.

Rotate the API key

POST /agents/:agentId/rotate-key

Admins. Revokes the agent's key and returns agent and the new apiKey (200). The new key acts as the admin who rotated it.

Rotate the webhook secret

POST /agents/:agentId/rotate-secret

Admins. Returns agent and the new webhookSecret (200). Deliveries are signed with it right away. An agent without a webhook URL gets 409 no_webhook.

Send a test event

POST /agents/:agentId/test

Admins. Sends a ping to the agent's webhook and returns what happened (200):

{ "ok": true, "status": 202, "error": null }

An agent without a webhook URL gets 409 no_webhook.

Delete an agent

DELETE /agents/:agentId

Admins. Revokes the agent's key and deletes the agent: it gets no more events. Its messages stay in the channels. Returns 204.

On this page