API Documentation
The AgentWorks API lets you work with your AI employees, their conversations and your records from your own code. Start in the Studio: no subscription, no credit card required. Connect your AI employee to your own systems the other way round, too: any HTTPS API or MCP server can be added as a tool.
Base URL
https://api.agentworksstudio.com/v1Auth
Bearer token (API key)
Format
JSON request/response
Authentication
All API requests require a Bearer token. Generate your API key from the Settings → API Keys section of your dashboard.
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.agentworksstudio.com/v1/agentsAPI Key Scopes
agents:readList and view agentsagents:writeCreate, update, and delete agentsconversations:readView conversation historyconversations:writeSend messages to conversationscontacts:readList and view contactscontacts:writeCreate and update contactswebhooks:manageConfigure webhook endpointsadminFull access to all resourcesAgents API
Manage your AI agents — list, create, update configuration, and monitor status.
Conversations API
Access conversation history and send messages to active conversations.
Webhooks
Receive real-time notifications when events happen in your AgentWorks workspace.
Available Events
conversation.startedNew conversation createdconversation.messageNew message in conversationconversation.endedConversation closedagent.escalationAgent escalated to humancontact.createdNew contact added to CRMcontact.updatedContact information updatedtask.completedAgent completed a taskagent.errorAgent encountered an error{
"event": "conversation.message",
"timestamp": "2026-02-18T16:30:00Z",
"data": {
"conversation_id": "conv_xyz789",
"agent_id": "agt_abc123",
"message": {
"id": "msg_456",
"content": "I'd be happy to schedule a showing for you!",
"sender": "agent",
"channel": "sms"
},
"contact": {
"id": "cnt_789",
"name": "John Smith",
"email": "john@example.com"
}
},
"signature": "sha256=..."
}X-AgentWorks-Signature header. Verify this signature using your webhook secret to ensure payload authenticity.X-Webhook-Id header — the delivery id, stable across retries, so you can dedupe on it. Answer 2xx to acknowledge. A 5xx, a timeout, 408 or 429 is retried with backoff (1 min, 5 min, 30 min, 2 h, 12 h; Retry-After is honoured on 429) for up to 6 attempts, then the delivery is marked dead. Any other 4xx is not retried, and redirects are not followed. Failed and dead deliveries can be re-sent from Setup ▸ Webhooks with Retry now.Code Examples
Quick-start examples in cURL, Node.js, and Python.
List Agents
curl -X GET "https://api.agentworksstudio.com/v1/agents" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"const response = await fetch(
'https://api.agentworksstudio.com/v1/agents',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
}
);
const { agents } = await response.json();
console.log(`Found ${agents.length} agents`);import requests
response = requests.get(
'https://api.agentworksstudio.com/v1/agents',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
}
)
agents = response.json()['agents']
print(f"Found {len(agents)} agents")Send a Message
const response = await fetch(
'https://api.agentworksstudio.com/v1/conversations/conv_xyz789/messages',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: 'Hi! I noticed you were looking at properties in Downtown.',
sender: 'human',
}),
}
);
const message = await response.json();
console.log('Message sent:', message.id);Webhook Handler
import express from 'express';
import crypto from 'crypto';
const app = express();
app.use(express.json());
app.post('/webhooks/agentworks', (req, res) => {
// Verify signature
const signature = req.headers['x-agentworks-signature'];
const expected = 'sha256=' + crypto
.createHmac('sha256', process.env.WEBHOOK_SECRET)
.update(JSON.stringify(req.body))
.digest('hex');
if (signature !== expected) {
return res.status(401).json({ error: 'Invalid signature' });
}
// Handle event
const { event, data } = req.body;
switch (event) {
case 'conversation.message':
console.log('New message:', data.message.content);
break;
case 'agent.escalation':
console.log('Escalation needed:', data.reason);
// Notify team via Slack, email, etc.
break;
}
res.status(200).json({ received: true });
});
app.listen(3000);Ready to integrate?
Start building in the Studio. No subscription, no credit card required. Building into your own systems with a team? Book a call.
