API Documentation

Build custom integrations with the Barpel REST API. Programmatic access to calls, orders, analytics, and more.

Overview

The Barpel API is a RESTful interface that gives you full programmatic control over your AI voice support system. Use it to initiate outbound calls, query call history, retrieve analytics, look up orders, and manage webhook subscriptions.

Base URL
https://api.barpel.ai/v1
Format
JSON request and response bodies
Transport
HTTPS required, TLS 1.2+

Authentication

All API requests must include a valid API key in the Authorization header. You can generate and manage API keys from your Barpel dashboard under Settings > API Keys.

API Key Format
Authorization: Bearer barpel_sk_live_xxxxxxxxxxxx
Live Keys

Prefixed with barpel_sk_live_. Use in production to make real calls and access live data.

Test Keys

Prefixed with barpel_sk_test_. Use in development to simulate calls without charges.

Endpoints

Core API endpoints for managing calls, orders, analytics, and webhooks.

POST/api/calls

Start an AI-powered outbound call to a customer for cart recovery, follow-ups, or notifications.

Parameters
phone_numberrequired
stringCustomer phone number in E.164 format
purposerequired
stringCall purpose: "cart_recovery", "follow_up", "notification"
context
objectAdditional context (order_id, cart_items, message)
language
stringISO 639-1 language code (defaults to "en")
GET/api/calls/:id

Retrieve the current status, transcript, and metadata for a specific call.

Parameters
idrequired
stringUnique call identifier returned from POST /api/calls
GET/api/analytics

Retrieve aggregated analytics for calls, resolution rates, and customer satisfaction over a time range.

Parameters
start_daterequired
stringStart date in ISO 8601 format
end_daterequired
stringEnd date in ISO 8601 format
granularity
string"hourly", "daily", or "weekly" (defaults to "daily")
POST/api/orders/lookup

Search for an order by order number, email, or phone number. Returns order status and tracking info.

Parameters
queryrequired
stringOrder number, customer email, or phone number
type
stringSearch type: "order_number", "email", "phone" (auto-detected if omitted)
POST/api/webhooks

Subscribe to real-time event notifications for calls, escalations, and order updates.

Parameters
urlrequired
stringHTTPS endpoint URL to receive webhook payloads
eventsrequired
arrayEvent types: ["call.started", "call.ended", "call.escalated", "order.updated"]
secret
stringSigning secret for payload verification (auto-generated if omitted)

Code Examples

Quick-start examples for initiating an outbound cart recovery call.

bash
curl -X POST https://api.barpel.ai/v1/calls \
  -H "Authorization: Bearer barpel_sk_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+14155551234",
    "purpose": "cart_recovery",
    "context": {
      "cart_items": ["Blue Running Shoes", "White T-Shirt"],
      "cart_value": 89.99,
      "customer_name": "Sarah"
    }
  }'

Response

json
{
  "id": "call_a1b2c3d4e5f6",
  "status": "in_progress",
  "phone_number": "+14155551234",
  "purpose": "cart_recovery",
  "started_at": "2026-03-15T14:30:00Z",
  "duration": null,
  "transcript": null,
  "resolution": null,
  "metadata": {
    "cart_value": 89.99,
    "customer_name": "Sarah"
  }
}

Rate Limits

API rate limits vary by plan. When you exceed your limit, the API returns a 429 Too Many Requests response with a Retry-After header.

PlanRate LimitBurst Limit
Starter100 requests/min20 requests/sec
Growth500 requests/min50 requests/sec
Scale2,000 requests/min200 requests/sec
EnterpriseCustomCustom

SDKs Coming Soon

Official client libraries for Node.js, Python, Ruby, and PHP are in development. Sign up to be notified when they launch.

Node.jsPythonRubyPHPGo
Get your API key

Power up your customer support

Get started in seconds — for free. No credit card required.