API Reference
Complete reference for the Fetchply REST API — manage agents, conversations, leads, knowledge sources, and webhooks programmatically.
Overview
The Fetchply API lets you programmatically manage agents, send messages, retrieve conversations and leads, manage knowledge sources, and subscribe to webhook events.
API access requires the Starter plan or above. Generate API keys from Dashboard → Account → API Keys.
Authentication
All API requests require a Bearer token in the Authorization header:
curl -X GET https://fetchply.com/api/v1/agents \
-H "Authorization: Bearer fp_your_api_key"const response = await fetch('https://fetchply.com/api/v1/agents', {
headers: {
'Authorization': 'Bearer fp_your_api_key',
},
});
const data = await response.json();import requests
response = requests.get(
'https://fetchply.com/api/v1/agents',
headers={'Authorization': 'Bearer fp_your_api_key'}
)
data = response.json()API keys use the fp_ prefix. Keep your keys secret — never expose them in client-side code.
Base URL
https://fetchply.com/api/v1Rate Limits
API requests are rate-limited to 60 requests per 60 seconds per API key.
When you exceed the limit, you'll receive a 429 Too Many Requests response with a Retry-After header indicating how many seconds to wait.
Response Format
All responses follow a consistent JSON format:
{
"success": true,
"data": { ... }
}{
"success": false,
"error": "Human-readable error message"
}Error Codes
| Status Code | Meaning |
|---|---|
200 | Success |
201 | Created |
400 | Bad request — check your request body |
401 | Unauthorized — invalid or missing API key |
403 | Forbidden — your plan doesn't include this feature |
404 | Not found — the resource doesn't exist |
409 | Conflict — action can't be performed (e.g., training already active) |
429 | Rate limited — wait and retry |
500 | Server error — contact support if persistent |
Endpoints
Agents
| Method | Endpoint | Description |
|---|---|---|
GET | /agents | List all agents |
GET | /agents/{id} | Get agent details |
Messages
| Method | Endpoint | Description |
|---|---|---|
POST | /agents/{id}/messages | Send a message |
Conversations
| Method | Endpoint | Description |
|---|---|---|
GET | /agents/{id}/conversations | List conversations |
Leads
| Method | Endpoint | Description |
|---|---|---|
GET | /agents/{id}/leads | List leads |
Knowledge
| Method | Endpoint | Description |
|---|---|---|
GET | /agents/{id}/knowledge-sources | List knowledge sources |
POST | /agents/{id}/qa-pairs | Create Q&A pair |
POST | /agents/{id}/train | Trigger training |
Webhooks
| Method | Endpoint | Description |
|---|---|---|
POST | /hooks/subscribe | Create webhook |
DELETE | /hooks/subscribe | Remove webhook |
Quick Start
Get an API Key
Go to Dashboard → Account → API Keys and generate a key.
List Your Agents
curl https://fetchply.com/api/v1/agents \
-H "Authorization: Bearer fp_your_api_key"Send a Message
curl -X POST https://fetchply.com/api/v1/agents/YOUR_AGENT_ID/messages \
-H "Authorization: Bearer fp_your_api_key" \
-H "Content-Type: application/json" \
-d '{"message": "What is your return policy?"}'