Patriy API Documentation

Build powerful automations with Patriy’s REST API

Authentication

All API requests must include your API key from API Keys:

Authorization: Bearer pat_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Base URL: https://shiny-spaniel-757.convex.site (or Cloudflare /api). Session JWT or pat_ API key.

API v2 (current)

Versioned, tenant-scoped. Authorization is checked server-side on every request. Send Idempotency-Key on financial and booking writes.

GET/POST /v2/customers · GET /v2/customers/360?customer_id=

GET /v2/conversations · GET /v2/leads · GET /v2/deals

GET/POST /v2/quotes · GET/POST /v2/bookings

GET /v2/invoices · GET /v2/payments

GET/POST /v2/campaigns · GET/POST /v2/products · GET/POST /v2/tasks

GET /v2/analytics · GET /v2/events

Legacy /v1/* remains. Workspace UI also uses /os/briefing, /os/inbox, /os/actions, /os/ledger, /os/knowledge.

Conversations

GET /v1/conversations

List conversations across connected channels with status, assignee, and last message metadata.

GET /v1/conversations/:id

Fetch a single conversation thread for CRM sync or custom UI.

Send Message

POST /v1/messages

{
  "channel": "whatsapp",
  "to": "+256XXXXXXXXX",
  "message": "Hello, how can I help you today?"
}

Leads & Scoring

GET /v1/leads

List CRM leads with AI scores, pipeline stage, and source channel.

PATCH /v1/leads/:id

Update stage, owner, or custom fields after your own scoring logic.

Webhooks

Receive real-time events when messages arrive, agents reply, leads score, or bookings are created.

POST /v1/webhooks

{
  "url": "https://yourapp.com/hooks/patriy",
  "events": ["message.received", "message.sent", "lead.scored", "booking.created"]
}

Verify signatures with your webhook secret. Respond with HTTP 2xx quickly; process async when needed.

SDKs

Official and community SDKs wrap the REST API for faster integration.

  • JavaScript / TypeScript — browser and Node (REST + webhooks helpers)
  • Python — server automations and CRM sync jobs
  • Mobile — use the same API from iOS/Android apps that embed Patriy webviews (Capacitor)

Request early SDK access via Contact Us or generate keys in API Keys.