Skip to main content
POST
/
v1
/
agents
Create AI agent
curl --request POST \
  --url https://api.craftcx.com/v1/agents \
  --header 'Content-Type: application/json' \
  --data '
{
  "external_id": "agent_123",
  "name": "My OpenClaw Agent",
  "type": "custom"
}
'
import requests

url = "https://api.craftcx.com/v1/agents"

payload = {
"external_id": "agent_123",
"name": "My OpenClaw Agent",
"type": "custom"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({external_id: 'agent_123', name: 'My OpenClaw Agent', type: 'custom'})
};

fetch('https://api.craftcx.com/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "created_at": 1756692778077,
  "external_id": "agent_123",
  "id": "pfh0haxfpzowht3oi213cqos",
  "name": "My OpenClaw Agent",
  "type": "custom"
}
{
"status": 400,
"title": "<string>",
"detail": "<string>",
"type": "about:blank"
}
{
"status": 401,
"title": "<string>",
"detail": "<string>",
"type": "about:blank"
}
{
"status": 409,
"title": "<string>",
"detail": "<string>",
"type": "about:blank"
}
{
"status": 500,
"title": "<string>",
"detail": "<string>",
"type": "about:blank"
}

Body

application/json
external_id
string
required

Your stable external ID from the source system for this AI agent.

Minimum string length: 1
Example:

"agent_123"

name
string
required

Display name for the AI agent.

Minimum string length: 1
Example:

"My OpenClaw Agent"

type
enum<string>
required

Agent type. Only custom agents are supported for now.

Available options:
custom
Example:

"custom"

Response

Created AI agent

created_at
number
required

Created at as epoch timestamp (ms).

Example:

1756692778077

external_id
string
required

Your stable external ID from the source system for this AI agent.

Example:

"agent_123"

id
string
required

CraftCX AI Agent ID.

Example:

"pfh0haxfpzowht3oi213cqos"

name
string
required

Display name for the AI agent.

Example:

"My OpenClaw Agent"

type
enum<string>
required

Agent type.

Available options:
custom
Example:

"custom"