API Documentation
Build powerful integrations with the SweetPilot REST API.
Quick Start
1. Get API Key
Generate an API key from your dashboard settings.
2. Make Requests
Use our REST API with any language or HTTP client.
3. Automate
Start interacting with AI employees programmatically.
Base URL
All API requests should be made to:
https://sweetpilot.com/api/v1Authentication
All API requests require authentication using a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEYYou can generate an API key from your dashboard settings.
Keep your API key secure. Never expose it in client-side code or public repositories.
Endpoints
GET
/v1/healthCheck that the API is reachableGET
/v1/employeesList the AI employees with their id, name, role and descriptionPOST
/v1/employees/:id/chatSend a message to one AI employee and get its reply. Add ?stream=true to receive it as a streamPOST
/v1/employees/:id/chat-with-fileThe same, with a file attached (multipart form with "message" and "file")POST
/v1/brain/askAsk a question that is answered from your Brain AI knowledge baseGET
/v1/workflowsList your Canvas workflowsPOST
/v1/workflows/:id/runStart a Canvas workflow. A run costs 3 creditsGET
/v1/workflows/:id/runs/:runIdCheck the status of a runCode Example
example.ts
// Using the SweetPilot REST API
const API_KEY = process.env.SWEETPILOT_API_KEY;
// List the AI employees
const employees = await fetch('https://sweetpilot.com/api/v1/employees', {
headers: { 'Authorization': `Bearer ${API_KEY}` },
}).then((res) => res.json());
// Chat with an AI employee (Ink is the copywriter)
const response = await fetch('https://sweetpilot.com/api/v1/employees/ink/chat', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
// Optional: makes a retry safe. The same key replays the first reply.
'Idempotency-Key': crypto.randomUUID(),
},
body: JSON.stringify({
message: 'Write a two sentence description for a stainless steel water bottle',
}),
});
console.log(await response.json());
// Each request stands on its own. To continue a conversation, send the
// earlier turns as a "messages" array instead of a single "message".Rate Limits
| Limit | Requests/min | Applies to |
|---|---|---|
| Each API key | 120 | Every plan |
| One IP address to one endpoint | 100 | Every plan |
Get Started
Sign up for SweetPilot, generate your API key, and start building integrations today.
Get Started