v1
latestOpenAPI 3.0.02026-08-04891301.4 MBCreate an agent
Creates a new agent. Supports two mutually exclusive provisioning modes.
Template mode — pass template with the ID or lookup_key of an existing AgentTemplate config. The agent's tools, routines, skills, and installations are provisioned from that template's config_ref entries.
Bundle mode — pass template_bundle with a self-contained install payload (AgentTemplate body plus every skill, script, and config it references). The entire bundle commits in a single transaction; any failure rolls back the whole install and the response includes installed_configs[] — one entry per persisted config.
Pass exactly one of template or template_bundle. If neither is supplied, name is required and a blank agent is created. Requires authentication; when called under a developer app scope (/developer/apps/:app/...), the caller must hold the app scope for the target app.
Request body
Example request
{
"acl": {
"add": [
{
"actions": [
"read",
"write"
],
"principal": "string",
"principal_type": "user"
}
],
"grants": [
{
"actions": [
"read",
"write"
],
"principal": "string",
"principal_type": "user"
}
],
"remove": [
{
"principal": "string",
"principal_type": "user"
}
]
},
"email": "user@example.com",
"identity": "string",
"lookup_key": "string",
"metadata": {
"key": "value"
},
"model": "string",
"name": "Example Name",
"org": "string",
"originator": "string",
"phone_number": "+15555550123",
"profile_picture": {
"data": "string",
"filename": "string",
"mime_type": "application/json"
},
"team": "string",
"template": "string",
"template_bundle": {
"configs": [
{
"content": "string",
"content_type": "application/json",
"relative_path": "tools/my-tool.yaml"
}
],
"lookup_key_suffix": "string",
"setup_actions": [
{
"depends_on": [
"string"
],
"description": "An example description.",
"kind": "env_var",
"params": {
"key": "value"
},
"required": true,
"sort_order": 1,
"title": "Example Title",
"verify_config": {
"key": "value"
}
}
],
"skills": [
{
"content": "string",
"content_type": "application/json",
"files": [
{
"content": "string",
"content_type": "application/json",
"relative_path": "skills/my-skill/helpers.md"
}
],
"relative_path": "skills/my-skill/SKILL.md"
}
],
"template": {
"content": "string",
"content_type": "application/json",
"relative_path": "agent.yaml"
}
},
"user": "string"
}Response
Successful response
Example response
{
"acl": {
"add": [
{
"actions": [
"read",
"write"
],
"principal": "string",
"principal_type": "user"
}
],
"grants": [
{
"actions": [
"read",
"write"
],
"principal": "string",
"principal_type": "user"
}
],
"remove": [
{
"principal": "string",
"principal_type": "user"
}
]
},
"app": "dap_0aBcDeFgHiJkLmNoPqRsTu",
"created_at": "2024-01-01T00:00:00Z",
"default_model": "claude-3-5-sonnet-20241022",
"email": "user@example.com",
"id": "agi_0aBcDeFgHiJkLmNoPqRsTu",
"identity": "You are a helpful assistant.",
"installed_configs": [
{
"id": "id_0aBcDeFgHiJkLmNoPqRsTu",
"key": "my-skill",
"kind": "Skill",
"lookup_key": "my-skill"
}
],
"lookup_key": "my-agent",
"metadata": {
"key": "value"
},
"name": "Example Name",
"org": "org_0aBcDeFgHiJkLmNoPqRsTu",
"originator": "my-service",
"phone_number": "+15555550123",
"sandbox": "dsb_0aBcDeFgHiJkLmNoPqRsTu",
"team": "tem_0aBcDeFgHiJkLmNoPqRsTu",
"updated_at": "2024-01-01T00:00:00Z",
"user": "usr_0aBcDeFgHiJkLmNoPqRsTu"
}