Skip to main content

Agent CRUD

Manage agents inside the workspace bound to your API key.
You do not pass workspaceId or userId in the request. The API key scope is applied automatically.

Common Headers

GET /api/v1/agent/

Fetch one agent with full detail.

Response

POST /api/v1/agent

Create a new agent.

Request Body

Fields

Default behavior

  • The first agent in a workspace is automatically created as isDefault: true
  • Creating with isDefault: true clears the previous default agent in that workspace

PATCH /api/v1/agent/

Partially update an agent. Only provided fields are changed.

Request Body

Notes

  • Sending isDefault: true promotes that agent to the workspace default
  • You cannot directly send isDefault: false for the current default agent. Promote another agent instead

DELETE /api/v1/agent/

Delete an agent. Related AgentRun rows are deleted by cascade.

Default deletion behavior

  • If other agents remain, the most recently updated one becomes the new default
  • If no agents remain, the workspace ends up with no default agent

Response Fields

POST / GET / PATCH / DELETE all return the same agent object.

Examples

Error Responses