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/v1

Auth

Bearer token (API key)

Format

JSON request/response

Rate limits: requests are rate limited per account; a limited request returns HTTP 429. Responses are plain JSON (no streaming endpoint is offered).

Authentication

All API requests require a Bearer token. Generate your API key from the Settings → API Keys section of your dashboard.

Authentication Header
bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.agentworksstudio.com/v1/agents

API Key Scopes

agents:readList and view agents
agents:writeCreate, update, and delete agents
conversations:readView conversation history
conversations:writeSend messages to conversations
contacts:readList and view contacts
contacts:writeCreate and update contacts
webhooks:manageConfigure webhook endpoints
adminFull access to all resources

Agents 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 created
conversation.messageNew message in conversation
conversation.endedConversation closed
agent.escalationAgent escalated to human
contact.createdNew contact added to CRM
contact.updatedContact information updated
task.completedAgent completed a task
agent.errorAgent encountered an error
Webhook Payload Example
json
{
  "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=..."
}
Security: All webhook payloads include an HMAC-SHA256 signature in the X-AgentWorks-Signature header. Verify this signature using your webhook secret to ensure payload authenticity.
Delivery and retries: every delivery carries an 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
bash
curl -X GET "https://api.agentworksstudio.com/v1/agents" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
Node.js
javascript
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`);
Python
python
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

Node.js — Send message to conversation
javascript
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

Node.js — Express webhook handler
javascript
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.