Create AI agent
POST
/api/v1/workspaces/{workspace_id}/ai_agents
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/ai_agents';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","instructions":"Always include a call-to-action. Avoid using jargon.","skill_ids":[12345]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/ai_agents \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "instructions": "Always include a call-to-action. Avoid using jargon.", "skill_ids": [ 12345 ] }'Creates a new AI agent.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspace_id
required
integer
Workspace ID
Request Body
Section titled “Request Body”Media typeapplication/json
object
name
required
string
instructions
Short custom instructions injected into the build agent’s system prompt.
string
Example
Always include a call-to-action. Avoid using jargon.skill_ids
IDs of the skills to assign to this agent. Replaces the existing set.
Array<integer>
Responses
Section titled “Responses”Successful
Media typeapplication/json
object
id
required
integer
name
required
string
instructions
required
Short custom instructions injected into the build agent’s system prompt.
string | null
skill_ids
required
IDs of the skills assigned to this agent.
Array<integer>
created_at
required
string format: date-time
updated_at
required
string format: date-time
Example
{ "id": 12345, "name": "My AI Agent", "instructions": "Always include a clear call-to-action and avoid jargon.", "skill_ids": [ 12345 ], "created_at": "2023-08-23T10:30:00.000Z", "updated_at": "2023-08-23T10:30:00.000Z"}Unauthorized
Media typeapplication/json
object
message
required
string
Example
{ "message": "Record not found"}Forbidden
Media typeapplication/json
object
message
required
string
Example
{ "message": "Record not found"}Unprocessable Entity
Media typeapplication/json
object
message
required
string
errors
required
object
key
additional properties
Array<string>
Example
{ "errors": { "username": [ "Username is required.", "Username must be unique." ], "email": [ "Invalid email format." ] }}