API Reference

The OPSYNC REST API exposes every feature in the platform. All endpoints are prefixed with /v1/ and return standard JSON responses.

Authentication

The API uses JWT bearer tokens. Exchange your email and password for a token via POST /v1/auth/login, then include the access token on every request:

curl https://api.opsynchub.com/v1/records \
  -H "Authorization: Bearer <YOUR_JWT>" \
  -H "Content-Type: application/json"

Access tokens expire after 15 minutes. Use POST /v1/auth/refresh with your refresh token to get a new pair. Agency plan customers can create long-lived API keys under Settings → API Keys for server-to-server integrations.

Core Endpoints

Here are the most commonly used endpoints. A full OpenAPI spec is available at /docs on any non-production environment.

MethodPathDescription
POST/v1/auth/loginExchange email + password for a JWT pair.
GET/v1/recordsList records with filters, pagination, search.
POST/v1/recordsCreate a new record in the Universal Record Engine.
PATCH/v1/records/:idUpdate a record, including contact and custom fields.
PATCH/v1/records/:id/stageMove a record to a new pipeline stage.
GET/v1/campaignsList campaigns for the authenticated org.
POST/v1/campaignsCreate a new campaign with stages.
GET/v1/activitiesList call, email, and SMS activities.
POST/v1/activitiesLog a manual activity (call disposition, note, SMS).
GET/v1/reports/dashboardFetch dashboard KPIs for the current user.
POST/v1/dialer/startStart a power dialer session for a campaign.
POST/v1/workflows/:id/executeManually execute a workflow against a record.

Example: Create a record

curl -X POST https://api.opsynchub.com/v1/records \
  -H "Authorization: Bearer <YOUR_JWT>" \
  -H "Content-Type: application/json" \
  -d '{
    "process_type": "sales",
    "contact": {
      "name": "Jane Smith",
      "email": "jane@example.com",
      "phone": "+15551234567"
    },
    "stage": "new",
    "custom_fields": { "source": "website" }
  }'

Webhooks

Configure outbound webhooks under Settings → Webhooks to receive real-time events. Every webhook is signed with HMAC-SHA256 so you can verify authenticity.

EventDescription
record.createdFired when a record is created via API, import, or UI.
record.stage_changedFired when a record moves between pipeline stages.
call.completedFired after call wrap-up, includes disposition and recording URL.
qa.completedFired when an AI QA review completes with score + breakdown.
form.submittedFired when a public lead form receives a submission.

Sample payload for call.completed:

{
  "event": "call.completed",
  "org_id": "01HG...",
  "data": {
    "activity_id": "01HH...",
    "record_id": "01HG...",
    "agent_id": "01HG...",
    "duration_seconds": 187,
    "disposition": "interested",
    "recording_url": "https://storage.opsynchub.com/..."
  },
  "timestamp": "2026-04-11T12:34:56Z"
}

Rate Limits

The API enforces two rate-limit windows:

  • Short burst: 20 requests per second per API key.
  • Sustained: 300 requests per minute per API key.

Rate limits are returned in X-RateLimit-Remaining and X-RateLimit-Reset headers. Exceeding either window returns 429. Agency plan customers can request higher limits.