Agents API
Create, list, run, and delete AI agents via the Embeddable Developer API.
AI Agents are autonomous functions that run on schedules, on demand, or in response to webhooks. Use this API to provision agents from your code.
POST /v1/agents
Create a new agent. If you provide a prompt, an AI build is kicked off asynchronously to scaffold the agent's code. The build conversation is saved to chat history so a user can continue refining the agent in the UI.
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Display name |
description | string | no | Short description of what the agent does |
prompt | string | no | If set, kicks off an AI build with this prompt |
Response — 202 Accepted
| Field | Description |
|---|---|
editorUrl | Direct link to open and continue editing the agent in your Embeddable workspace |
If you omit prompt, the agent is created in a draft state without a build job:
Token cost: 1
Agent builds may pause to ask clarifying questions (e.g. "Which email service?"). The conversation is persisted to chat history — open the agent in your Embeddable workspace UI to see the question and reply.
GET /v1/agents
List agents in your organization.
Query parameters
| Param | Type | Default |
|---|---|---|
page | number | 1 |
limit | number | 20 |
Response
GET /v1/agents/:agentId
Fetch a single agent.
POST /v1/agents/:agentId/run
Trigger a one-off run of an agent.
Body
| Field | Type | Description |
|---|---|---|
input | object | Optional input payload passed to the agent function |
Response
The exact response shape depends on the agent — see your agent's functions/main.ts for the input/output contract.
Token cost: 1
DELETE /v1/agents/:agentId
Permanently delete an agent.
Token cost: 0.