Agents

Create an agent (Preview)

Preview · Available to selected organizations. Creates an agent with a draft and returns it with status 201.

POST
/v1/agents

Creates an agent with a draft and returns it with status 201. The agent answers nothing until its draft is published. A new agent starts in supervised mode, so each reply waits for a person to approve it. The namespace is set at creation and cannot change.

x-api-key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

name*AgentName
Match^\S[\s\S]*\S$|^\S$|^$
Length1 <= length <= 120
namespaceId?|

The namespace the agent belongs to; it cannot move later. Omit for an organization-level agent. A namespace-scoped key always creates in its own namespace.

definition?|

The first draft. Defaults to an agent with no instructions, knowledge, or endpoints, in supervised mode on the standard model.

Default

{  "instructions": "",  "knowledge": "",  "endpointIds": [],  "integrationIds": [],  "mode": "supervised",  "model": "standard",  "approvalPolicy": "toolActions",  "workingHours": null,  "takeoverTimeoutMinutes": 30}

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/agents" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "id": "string",  "name": "string",  "namespaceId": "string",  "revision": "string",  "draft": {    "instructions": "string",    "knowledge": "string",    "endpointIds": [      "string"    ],    "integrationIds": [      "string"    ],    "mode": "live",    "model": "standard",    "approvalPolicy": "toolActions",    "workingHours": {      "timeZone": "string",      "ranges": [        {          "day": "monday",          "opens": "string",          "closes": "string"        }      ]    },    "takeoverTimeoutMinutes": 1  },  "publishedVersion": -9007199254740991,  "publishedAt": "string",  "createdAt": "string",  "updatedAt": "string"}

Related documentation