// PAZA ▸ DEVELOPERS · PAZA REST API

Paza REST API

01// PAZA ▸ DEVELOPERS · PAZA REST API

ⓘ

// Base address, keys, scopes, endpoints, webhooks and WhatsApp ingest.

Paza REST API

Base address and keys

Request
curl https://api.paza.social/api/platform/v1/workspace \
  -H "Authorization: Bearer pz_live_…"

Every answer is JSON. Errors look like {"error": {"code", "message", "request_id"}} with a plain-words message; 401 means the key is wrong or revoked, 403 insufficient_scope names the scope, 402 means the allowance is used up and says when it resets, 429 is rate limiting with Retry-After.

ScopeAllows
whatson:readWhat's on
audience:readAudiences
intel:read / intel:runRead analyses / start them (uses credits)
insights:readBrand insights and story
insights_data:readInsights from your own connected data (My Data)
ingest:writeSend your WhatsApp conversations to Paza
connections:manageCreate and remove conversation channels
companion:skillLet your bot answer through Paza Companion
webhooks:manage / exports:manage / embeds:manageWebhooks, scheduled exports, embeds

Intelligence

EndpointWhat it does
GET /workspaceThe key's workspace and plan
GET /usageCredits and calls used and left
GET /whatson?location=&when=What's on, with sources and freshness
GET /audiences?market=&query=Audience groups
POST /intelligence/runs {brief}Start an analysis (202, credits reserved then settled; refunded if it fails)
GET /intelligence/runs, GET /intelligence/runs/{id}Analyses and their results
GET /insights/brand, GET /insights/storyReleased brand insights and story
GET /insights/my-data?days=What your customers say, from connected conversations

WhatsApp conversations

ChatBreez: POST /ingest/channels {provider: "chatbreez", label} (connections:manage) returns a webhook address once; paste it in ChatBreez for messages.upsert. Any other provider or your own bot posts batches:

POST /ingest/conversations (ingest:write)
{
  "source": "whatsapp",
  "provider": "360dialog",
  "channel_id": "+254700000000",
  "messages": [
    {
      "external_id": "wamid.HBgM…",
      "direction": "inbound",
      "from": "+254711111111",
      "timestamp": "2026-11-29T08:00:00Z",
      "type": "text",
      "text": "Do you deliver to Mombasa?",
      "consent": { "basis": "customer_service" }
    }
  ]
}
  • Up to 500 messages and 1 MB per call; each refused message is named with its index and reason, the rest are kept.
  • Phone numbers are never stored: each customer becomes a one-way key. Text is encrypted at rest; messages are deleted 90 days after analysis.
  • Voice notes with an https media.url are transcribed, then the audio is deleted.
  • Conversations are read in windows (30 minutes of quiet, or 23:00 East Africa time); results appear in My Data and /insights/my-data.

Answer with Paza Companion

POST /companion/respond (companion:skill)
{
  "person": "+254711111111",
  "message": "What's on this weekend?",
  "message_id": "wamid.HBgM…",
  "context": { "business_name": "Acme", "market": "Nairobi" }
}

Answers {reply, replies, pending, turn_id}. When pending is true, GET /companion/turns/{turn_id} after a few seconds for the rest. Your bot sends the replies; Paza never contacts the customer.

Webhooks

POST /webhooks {url, events[]} (webhooks:manage). Events: intelligence.completed, credits.low, credits.exhausted, connection.status_changed, and webhook.test on request. Each delivery carries Standard Webhooks headers (webhook-id, webhook-timestamp, webhook-signature) and Paza-Signature; failed deliveries retry for about two days, and an address failing for 7 days is switched off with an email.

Verify a signature (Node)
import crypto from "crypto";
const secret = Buffer.from(whsec.replace(/^whsec_/, ""), "base64");
const signed = `${id}.${timestamp}.${rawBody}`;
const expected = crypto.createHmac("sha256", secret).update(signed).digest("base64");
const ok = header.split(" ").some((s) => s === `v1,${expected}`);

Exports and embeds

  • POST /exports {dataset, schedule, timezone} for a daily or weekly CSV of analyses, audiences, what's on or usage; files are downloadable for 7 days.
  • POST /embeds {view, allowed_origins} returns an iframe snippet for your own site (what's on list, audience card, what your customers say); it only loads on the sites you list.