Fetchply Docs

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

Rate 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 CodeMeaning
200Success
201Created
400Bad request — check your request body
401Unauthorized — invalid or missing API key
403Forbidden — your plan doesn't include this feature
404Not found — the resource doesn't exist
409Conflict — action can't be performed (e.g., training already active)
429Rate limited — wait and retry
500Server error — contact support if persistent

Endpoints

Agents

MethodEndpointDescription
GET/agentsList all agents
GET/agents/{id}Get agent details

Messages

MethodEndpointDescription
POST/agents/{id}/messagesSend a message

Conversations

MethodEndpointDescription
GET/agents/{id}/conversationsList conversations

Leads

MethodEndpointDescription
GET/agents/{id}/leadsList leads

Knowledge

MethodEndpointDescription
GET/agents/{id}/knowledge-sourcesList knowledge sources
POST/agents/{id}/qa-pairsCreate Q&A pair
POST/agents/{id}/trainTrigger training

Webhooks

MethodEndpointDescription
POST/hooks/subscribeCreate webhook
DELETE/hooks/subscribeRemove 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?"}'

On this page