{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"f5f7f377-fcf4-4fd0-9d74-69f082c79f80","name":"Aiployee Public API Production","description":"# Aiployee WhatsApp Agent Platform — Public API (v1)\n\nProgrammatic access to the Aiployee platform. Mirrors the OpenAPI spec at `GET /api/v1/openapi.json` (rendered by Scalar at `/docs`). This collection is the sibling artefact of `app/api/v1/**` and is kept in lock-step with it.\n\n## Setup (do this first)\n\n1. **Select an environment** — *Aiployee — UAT* or *Aiployee — Production* (top-right). It supplies `baseUrl`, your `aip_api_key`, and the test variables below. Requests are `{{baseUrl}}/v1/...`, so `baseUrl` **ends in `/api`** (e.g. `https://app.aiployee.co.za/api`).\n2. **`aip_api_key`** — issue one on `/settings/api-keys` (format `aip_live_<32 hex>`, shown once). Set it as a **secret** environment variable. Collection auth is Bearer `{{aip_api_key}}`; every request inherits it (except the *Bad token* and *Spec* requests, which override on purpose).\n3. **`test_phone_e164`** — an E.164 number you control (e.g. `+27821234567`). Sends will actually message this person.\n4. **`from_phone_number_id`** — only needed when the tenant has more than one active WhatsApp number; pass the Meta `phone_number_id`, the `+E.164`, or the platform `whatsapp_numbers.id`.\n5. **`wa_number_id` / `template_id`** — a `whatsapp_numbers.id` and an approved `template_id` (UUIDs) used by *Create broadcast*.\n\n> ⚠️ **API keys are database-scoped.** A key issued on the self-hosted app authenticates only there; a key issued on the Cloud/mirror deployment authenticates only there. If you get `401` with a valid-looking key, you're pointing `baseUrl` at the wrong deployment for that key.\n\n## What's covered\n\nEvery live v1 operation (65 across 12 resource groups): **Messages** (text · template · media · interactive · location) · **Contacts** (+ bulk, attributes, tags, block/unblock) · **Conversations** · **Tags** · **Attributes** · **Knowledge bases** (+ documents, search) · **Broadcasts** (+ schedule, cancel, recipients) · **Analytics** (usage · cost · messages · stage-funnel) · **Webhooks** (+ deliveries, rotate-secret, replay) · **Tools** · **Team** · **Workflows** (+ publish, run, runs). Plus an **Errors & replays** folder (idempotency, unsupported channel, missing scope, bad token) and a **Spec** folder.\n\n## Conventions\n\n- **Auth:** `Authorization: Bearer {{aip_api_key}}` (collection-level; inherited).\n- **Request id:** every response carries `X-Request-Id`, echoed in `error.request_id`. Cross-reference it on `/settings/api-keys/logs` (payloads capped at 4 kB).\n- **Error envelope:** all 4xx/5xx return `{ \"error\": { \"code\", \"message\", \"request_id\", \"details?\" } }`. `code` is stable + machine-readable. A collection-level test asserts this shape on every 4xx.\n- **Idempotency:** writes accept an `Idempotency-Key` header — same key + same body within 24h replays the original response; same key + **different** body → `422 idempotency_mismatch`. Requests that support it send `{{$guid}}` by default.\n- **Rate limits:** `X-RateLimit-Limit / -Remaining / -Reset`; `429` carries `Retry-After`.\n- **Scopes:** each request's description lists the scope(s) it needs. A key only does what its scopes allow (default-deny). Note some reads are gated by the matching `:write` scope (e.g. `GET /tags` needs `tags:write`).\n- **Channel-neutral:** bodies carry a `channel` discriminator; only `\"whatsapp\"` is valid today. New channels add enum values, never new URL prefixes (there will never be `/v1/whatsapp/messages`).\n\n## Template variables — two shapes, don't conflate\n\n- **`POST /v1/messages` (template)** takes Meta's **`components` array** (`[{ type, parameters:[…] }]`).\n- **`POST /v1/broadcasts`** and the internal Copilot path take a **`template_variables` map** keyed by placeholder index → `{ text | attribute_key }`.\n\nUse the components array for a one-off template send; the map for a campaign. Both are documented on their respective requests.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"36216276","team":8911199,"collectionId":"f5f7f377-fcf4-4fd0-9d74-69f082c79f80","publishedId":"2sBY4MtLMg","public":true,"publicUrl":"https://documenter-api.postman.tech/view/36216276/2sBY4MtLMg","privateUrl":"https://go.postman.co/documentation/36216276-f5f7f377-fcf4-4fd0-9d74-69f082c79f80","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":"Public API collection for our platforms"},{"name":"title","value":"Aiployee Public API"}],"appearance":{"default":"light","themes":[{"name":"dark","logo":"https://content.pstmn.io/3fb6205a-eff0-496e-8072-bb883a61156c/YWlwbG95ZWUtbG9nby1DNGJCX3g5YSAoMikucG5n","colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":"https://content.pstmn.io/3fb6205a-eff0-496e-8072-bb883a61156c/YWlwbG95ZWUtbG9nby1DNGJCX3g5YSAoMikucG5n","colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.12.10","publishDate":"2026-07-14T06:30:34.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"Aiployee Public API","description":"Public API collection for our platforms"},"logos":{"logoLight":"https://content.pstmn.io/3fb6205a-eff0-496e-8072-bb883a61156c/YWlwbG95ZWUtbG9nby1DNGJCX3g5YSAoMikucG5n","logoDark":"https://content.pstmn.io/3fb6205a-eff0-496e-8072-bb883a61156c/YWlwbG95ZWUtbG9nby1DNGJCX3g5YSAoMikucG5n"}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/2f13040c9be03bdf94ca642ce3e911e5e43c4359a72de95d8cf720e1dcfe8869","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/2sBY4MtLMg"}