{"openapi": "3.1.0", "info": {"title": "NotiNam API", "version": "0.0.1", "description": "\nSend SMS and WhatsApp reminders, manage contacts and groups, schedule campaigns, and push whole\ncontact/reminder lists from your own system. Try every call safely with a sandbox key first: nothing is\nsent and no credits are used (`/settings/developer/sandbox/`).\n\n## Getting started\n1. Create an API key at `/settings/api-keys/` and tick the permission scopes you need (each endpoint\n   lists its **Permission**). A business-scoped key always acts on that business.\n2. Send `Authorization: Bearer <api_key>` on every request.\n3. `GET /api/v1/blueprints/` - pick a `blueprint_id` and note its `variables`.\n4. `POST /api/v1/reminders/` - send now or at `scheduled_time`.\n\n## Writes are asynchronous\nEvery `POST`, `PATCH` and `DELETE` validates the request, then returns **`202 Accepted`**:\n`{\"command_id\", \"status\", \"resource_url\"}` with a `Location: /api/v1/commands/{command_id}/` header.\nPoll `GET /api/v1/commands/{command_id}/` until `status` is `completed` (see `result`) or `failed`\n(see `error`). Business-rule failures (insufficient credits, unknown blueprint, contact not found) arrive\nas a failed command, not as an HTTP error.\n\n**Idempotency:** send an `Idempotency-Key` header (any unique string, e.g. a UUID) on writes. A retry\nwith the same key returns the original command instead of repeating the action.\n\n## Errors\nError bodies are `{\"detail\": \"<reason>\"}`.\n| Status | Meaning |\n| --- | --- |\n| 401 | Missing or invalid API key |\n| 402 | Monthly API budget/quota exhausted, insufficient credits, or the feature is not in your plan |\n| 403 | Key lacks the endpoint's permission scope |\n| 404 | Resource not found for this key's account |\n| 413 | Workbook import over your plan's row limit |\n| 422 | Request body/fields invalid |\n| 429 | Rate limit exceeded - back off and retry |\n| 503 | API temporarily disabled |\n\n## Pagination and limits\nList endpoints take `limit` and `offset` and return `{\"items\": [...], \"count\": N}`. Requests are\nrate-limited per key (per minute and per day, from your plan); monthly quota and overage follow your plan\nand API budget (`/billing/api-budget/`).\n\n## Channels\nMessages are sent by **SMS** or **WhatsApp** only. A reminder's `channel` must match its blueprint's\nchannel. WhatsApp blueprints are backed by Meta-approved templates.\n\n## Blueprint variables\nBlueprints use `{{variable}}` placeholders. Values are resolved in this order (highest wins):\n| Priority | Source | Example |\n| --- | --- | --- |\n| 1 | `variables_data` in the request (`var_<name>` in a workbook import) | `{\"amount\": \"N$1,450\"}` |\n| 2 | Data source linked to the blueprint | live fetch at dispatch |\n| 3 | Contact fields and metadata | `name`, `phone`, `alias`, `unit` |\n\n## Groups and campaigns\n`POST /groups/`, `POST /groups/{id}/members`, then `POST /campaigns/` sends one blueprint to every\nopted-in member at `scheduled_time`. `DELETE /campaigns/{id}` cancels what is not sent yet.\n\n## Bulk sync: workbook import\n`POST /imports/workbook` takes the same `contacts` and `reminders` rows as NotiNam's spreadsheet sync\n(standard: `/settings/integrations/workbook-standard/`). Contact phone / `reminder_key` make it\nidempotent: resend a row to update it. `full_snapshot: true` also cancels pending reminders you no longer\nsend. Results and per-row errors: `GET /data-sources/{data_source_id}/syncs`. Requires a subscription\nplan that includes workbook import.\n\n## Sandbox\nYour **Sandbox Key** always acts on a private sandbox workspace: nothing is sent, no credits or quota are\nused, and webhooks fire. The recipient number picks the outcome (`+264811000001` delivered,\n`...0002` failed, `...0003` never delivered, `...0004` slow, `...0005` opts out, `...0006` invalid).\nSeeded contacts, a group and two templates are ready. Guide, magic numbers, Postman collection and code\nsamples: `/settings/developer/sandbox/`.\n\n## Webhooks\nRegister an endpoint at `/settings/developer/` for `reminder.queued`, `reminder.sent`,\n`reminder.delivered`, `reminder.failed`. Each POST carries `X-NotiNam-Event` and\n`X-NotiNam-Signature` = hex HMAC-SHA256 of the raw body with your endpoint secret; verify it before\ntrusting the payload.\n"}, "paths": {"/api/v1/contacts/": {"get": {"operationId": "apps_api_views_list_contacts", "summary": "List contacts", "parameters": [{"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedContactOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Returns all contacts owned by this API key's account.\n\n**Permission:** `contacts:read`.", "tags": ["Contacts"], "security": [{"APIKeyAuth": []}]}, "post": {"operationId": "apps_api_views_create_contact", "summary": "Create a contact (async)", "parameters": [{"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Accepts a contact creation. Returns `202` with a `command_id` -\npoll `GET /commands/{command_id}/` (or check the `Location` header)\nfor the created contact's `resource_url`.\n\n**Permission:** `contacts:write`.", "tags": ["Contacts"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactIn"}}}, "required": true}, "security": [{"APIKeyAuth": []}]}}, "/api/v1/contacts/{contact_id}": {"get": {"operationId": "apps_api_views_get_contact", "summary": "Get a contact", "parameters": [{"in": "path", "name": "contact_id", "schema": {"title": "Contact Id", "type": "integer"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Returns one contact owned by this key's account (404 otherwise).\n\n**Permission:** `contacts:read`.", "tags": ["Contacts"], "security": [{"APIKeyAuth": []}]}, "patch": {"operationId": "apps_api_views_update_contact", "summary": "Update a contact (async)", "parameters": [{"in": "path", "name": "contact_id", "schema": {"title": "Contact Id", "type": "integer"}, "required": true}, {"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Updates only the fields you send. `preferred_channel` must be `sms` or `whatsapp`. Validation errors return\n`422`; the change is applied async - poll the command.\n\n**Permission:** `contacts:write`.", "tags": ["Contacts"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactUpdateIn"}}}, "required": true}, "security": [{"APIKeyAuth": []}]}, "delete": {"operationId": "apps_api_views_delete_contact", "summary": "Delete a contact (async)", "parameters": [{"in": "path", "name": "contact_id", "schema": {"title": "Contact Id", "type": "integer"}, "required": true}, {"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Existence is checked synchronously (404 if not found); the delete\nitself is applied async - poll `GET /commands/{command_id}/`.\n\n**Permission:** `contacts:write`.", "tags": ["Contacts"], "security": [{"APIKeyAuth": []}]}}, "/api/v1/blueprints/": {"get": {"operationId": "apps_api_views_list_blueprints", "summary": "List available blueprints", "parameters": [{"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedBlueprintOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Returns all **published and approved** blueprints accessible to this API key's owner,\nincluding system templates shared across all accounts.\nUse the `blueprint_id` from this response when creating reminders.\nEach blueprint lists its `variables`: the fields you may supply in `variables_data`\nwhen creating a reminder. Variables backed by a DataSource (`has_data_source: true`)\nare populated automatically at dispatch time; supply only the rest.\n\n**Permission:** `blueprints:read`.", "tags": ["Blueprints"], "security": [{"APIKeyAuth": []}]}}, "/api/v1/reminders/": {"get": {"operationId": "apps_api_views_list_reminders", "summary": "List reminders", "parameters": [{"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedReminderOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Returns reminders for this account, newest first (paginated).\n\n**Permission:** `reminders:read`.", "tags": ["Reminders"], "security": [{"APIKeyAuth": []}]}, "post": {"operationId": "apps_api_views_create_reminder", "summary": "Send or schedule a reminder (async)", "parameters": [{"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InsufficientCreditsOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Accepts a reminder for creation and dispatch (or scheduling) using an\napproved blueprint. Returns `202` immediately - blueprint existence\nand the presence of a contact identifier are checked synchronously\n(so a malformed request still fails fast with `404`/`400`); contact\nresolution, variable resolution, and the credit deduction happen\nasync. Poll `GET /commands/{command_id}/` for the outcome - a\ncompleted command's `result.reminder_id` and `result.status` mirror\nwhat the old synchronous `201` response used to return directly, and\na `FAILED` command's `error` covers what used to be a `400`/`402`.\n\n**Contact resolution:** provide one of:\n\n- `contact_id`: existing contact ID\n- `phone`: E.164 number (e.g. `\"+264811234567\"`); auto-creates contact if not found\n- `email`: email address; auto-creates contact if not found\n\n**Variable resolution order** (highest priority wins):\n\n1. `variables_data` in this request\n2. DataSource linked to the blueprint (live fetch at dispatch time)\n3. Contact fields: `name`, `email`, `phone`, `alias`, and metadata key-value pairs\n\n**Timing:** omit `scheduled_time` or set it to `null` to send immediately.\n\n**Sandbox:** use your **Sandbox Key** to test without sending real messages.\nSandbox reminders go through the full pipeline and transition to `delivered`\nwithin ~5 seconds. Outbound webhooks fire normally so you can verify your\nendpoint. Your sandbox workspace comes pre-seeded with one contact per magic number.\n\n**Delivery status:** subscribe to webhook events at `/settings/developer/`\nto receive `reminder.sent`, `reminder.delivered`, and `reminder.failed` notifications.\n\n**Permission:** `reminders:write`.", "tags": ["Reminders"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReminderIn"}}}, "required": true}, "security": [{"APIKeyAuth": []}]}}, "/api/v1/reminders/{reminder_id}": {"delete": {"operationId": "apps_api_views_cancel_reminder", "summary": "Cancel a reminder (async)", "parameters": [{"in": "path", "name": "reminder_id", "schema": {"title": "Reminder Id", "type": "string"}, "required": true}, {"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Cancel a PENDING or QUEUED reminder. Has no effect on already-sent\nreminders. Applied async - poll `GET /commands/{command_id}/`.\n\n**Permission:** `reminders:write`.", "tags": ["Reminders"], "security": [{"APIKeyAuth": []}]}}, "/api/v1/analytics/summary": {"get": {"operationId": "apps_api_views_analytics_summary", "summary": "Get analytics summary", "parameters": [{"in": "query", "name": "days", "schema": {"default": 30, "title": "Days", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnalyticsSummaryOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Returns aggregated send/delivery stats for the past N days (max 365).\n\n**Permission:** `analytics:read`.", "tags": ["Analytics"], "security": [{"APIKeyAuth": []}]}}, "/api/v1/data-sources/": {"get": {"operationId": "apps_api_views_list_data_sources", "summary": "List data sources", "parameters": [{"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedDataSourceOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Returns all data sources configured for this account.\nData sources auto-populate blueprint variables at dispatch time from external systems\n(REST APIs, Google Sheets, SharePoint, Excel Online). Link a data source to a blueprint\nin your NotiNam dashboard to enable dynamic variable resolution.\n\n**Permission:** `data_sources:read`.", "tags": ["Data Sources"], "security": [{"APIKeyAuth": []}]}, "post": {"operationId": "apps_api_views_create_data_source", "summary": "Create a data source (async)", "parameters": [{"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Accepts a data source creation, returns `202`. After it completes\n(poll `GET /commands/{command_id}/`), configure connection\ncredentials at `/settings/integrations/<id>/edit/` in the NotiNam\ndashboard (OAuth or API key).\n\n**Permission:** `data_sources:write`.", "tags": ["Data Sources"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/DataSourceIn"}}}, "required": true}, "security": [{"APIKeyAuth": []}]}}, "/api/v1/data-sources/{data_source_id}": {"delete": {"operationId": "apps_api_views_delete_data_source", "summary": "Delete a data source (async)", "parameters": [{"in": "path", "name": "data_source_id", "schema": {"title": "Data Source Id", "type": "string"}, "required": true}, {"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Deletes a data source. Contacts, reminders and campaigns it created are kept.\n\n**Permission:** `data_sources:write`.", "tags": ["Data Sources"], "security": [{"APIKeyAuth": []}]}}, "/api/v1/data-sources/{data_source_id}/sync": {"post": {"operationId": "apps_api_views_trigger_data_source_sync", "summary": "Trigger a manual bulk sync (async)", "parameters": [{"in": "path", "name": "data_source_id", "schema": {"title": "Data Source Id", "type": "string"}, "required": true}, {"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Enqueues a full sync of all rows from the data source into Contact\nmetadata. Existence is checked synchronously; the sync trigger and\nthe sync itself both run async - poll `GET /commands/{command_id}/`\nfor the `sync_id`, then the existing `sync_status` field to track\nthe sync's own progress.\n\n**Permission:** `data_sources:write`.", "tags": ["Data Sources"], "security": [{"APIKeyAuth": []}]}}, "/api/v1/data-sources/{data_source_id}/syncs": {"get": {"operationId": "apps_api_views_list_data_source_syncs", "summary": "Sync history and errors", "parameters": [{"in": "path", "name": "data_source_id", "schema": {"title": "Data Source Id", "type": "string"}, "required": true}, {"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedSyncOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Most recent first. `row_errors` lists every skipped row with tab, row, key, column and error code -\nthe codes are documented at /settings/integrations/workbook-standard/#error-codes.\n\n**Permission:** `data_sources:read`.", "tags": ["Data Sources"], "security": [{"APIKeyAuth": []}]}}, "/api/v1/commands/{command_id}": {"get": {"operationId": "apps_api_views_get_command", "summary": "Poll an async command", "parameters": [{"in": "path", "name": "command_id", "schema": {"title": "Command Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommandStatusOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Every write endpoint under /api/v1 returns 202 with a command_id -\npoll here for the outcome. `resource_url` and `result` are populated\nonce `status` is `completed`; `error` is populated on `failed`.\n\n**Permission:** none (any key; only its own commands).", "tags": ["Commands"], "security": [{"APIKeyAuth": []}]}}, "/api/v1/groups/": {"get": {"operationId": "apps_api_views_list_groups", "summary": "List contact groups", "parameters": [{"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedGroupOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Contact groups, alphabetical. Use `id` as `group_id` for campaigns and membership changes.\n\n**Permission:** `contacts:read`.", "tags": ["Groups"], "security": [{"APIKeyAuth": []}]}, "post": {"operationId": "apps_api_views_create_group", "summary": "Create a contact group (async, idempotent by name)", "parameters": [{"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Creates a group. Posting a name that already exists returns that group (no duplicate). The command result\ncarries the group `id`.\n\n**Permission:** `contacts:write`.", "tags": ["Groups"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/GroupIn"}}}, "required": true}, "security": [{"APIKeyAuth": []}]}}, "/api/v1/groups/{group_id}/members": {"post": {"operationId": "apps_api_views_add_group_members", "summary": "Add contacts to a group (async)", "parameters": [{"in": "path", "name": "group_id", "schema": {"title": "Group Id", "type": "integer"}, "required": true}, {"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Adds contacts to a group. Contacts already in it, or not owned by your account, are ignored; the command\nresult has the number `added`.\n\n**Permission:** `contacts:write`.", "tags": ["Groups"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/GroupMembersIn"}}}, "required": true}, "security": [{"APIKeyAuth": []}]}}, "/api/v1/campaigns/": {"get": {"operationId": "apps_api_views_list_campaigns", "summary": "List campaigns", "parameters": [{"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedCampaignOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Campaigns (one message to every opted-in member of a group), newest scheduled first.\n\n**Permission:** `reminders:read`.", "tags": ["Campaigns"], "security": [{"APIKeyAuth": []}]}, "post": {"operationId": "apps_api_views_create_campaign", "summary": "Schedule a campaign to a group (async)", "parameters": [{"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Sends `blueprint_id` to every opted-in contact in `group_id` at `scheduled_time`.\nChannel must be `sms` or `whatsapp` and match the blueprint.\n\n**Permission:** `reminders:write`.", "tags": ["Campaigns"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CampaignIn"}}}, "required": true}, "security": [{"APIKeyAuth": []}]}}, "/api/v1/campaigns/{campaign_id}": {"delete": {"operationId": "apps_api_views_cancel_campaign", "summary": "Cancel a campaign (async)", "parameters": [{"in": "path", "name": "campaign_id", "schema": {"title": "Campaign Id", "type": "string"}, "required": true}, {"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Cancels a scheduled or running campaign and every reminder of it not yet sent. Already-sent messages are\nunaffected. A finished campaign makes the command fail.\n\n**Permission:** `reminders:write`.", "tags": ["Campaigns"], "security": [{"APIKeyAuth": []}]}}, "/api/v1/imports/workbook": {"post": {"operationId": "apps_api_views_import_workbook", "summary": "Import contacts + reminders using the workbook standard (async)", "parameters": [{"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "413": {"description": "Content Too Large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Same rules as a synced spreadsheet (see /settings/integrations/workbook-standard/):\n`contacts` rows use `name, phone, email, preferred_channel, groups, opt_out, var_*`;\n`reminders` rows use `reminder_key, target_contact | target_group, blueprint, channel, send_at,\nrecurrence, status, var_*`. Phone keys contacts; reminder_key keys reminder rows, making calls idempotent.\n`full_snapshot: true` cancels pending reminders whose keys are absent from this call;\nthe default (false) only adds/updates. Poll the command for `sync_id`, then\n`GET /data-sources/{data_source_id}/syncs` for counts and per-row errors.\nRequires a plan that includes workbook import (HTTP 402 otherwise).\n\n**Permission:** `data_sources:write` and `reminders:write`.", "tags": ["Workbook Import"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WorkbookImportIn"}}}, "required": true}, "security": [{"APIKeyAuth": []}]}}, "/api/v1/sandbox/reset": {"post": {"operationId": "apps_api_views_sandbox_reset", "summary": "Reset sandbox data (sandbox keys only)", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"additionalProperties": true, "title": "Response", "type": "object"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Deletes every contact, group, template, reminder, campaign and workbook\nin your sandbox workspace and reseeds the magic-number contacts and the\ntwo sample templates. Your sandbox keys stay valid. Live keys get 403.", "tags": ["Sandbox"], "security": [{"APIKeyAuth": []}]}}, "/api/v1/messages/": {"post": {"operationId": "apps_api_views_send_message", "summary": "Send a free-text SMS (async)", "parameters": [{"in": "header", "name": "Idempotency-Key", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Any unique string (e.g. a UUID). Retrying with the same key returns the original command instead of doing the work twice. Strongly recommended for every write."}], "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageAcceptedOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "422": {"description": "Unprocessable Content", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Messages"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageSendIn"}}}, "required": true}, "security": [{"APIKeyAuth": []}]}}, "/api/v1/messages/{message_id}/": {"get": {"operationId": "apps_api_views_get_message", "summary": "Get a message", "parameters": [{"in": "path", "name": "message_id", "schema": {"title": "Message Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Messages"], "security": [{"APIKeyAuth": []}]}}}, "components": {"schemas": {"Input": {"properties": {"limit": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "offset": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}}, "title": "Input", "type": "object"}, "ContactOut": {"properties": {"id": {"title": "Id", "type": "integer"}, "name": {"title": "Name", "type": "string"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "phone_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "E.164, e.g. `+264811234567`.", "title": "Phone Number"}, "preferred_channel": {"description": "`sms`, `whatsapp`, or `email`.", "title": "Preferred Channel", "type": "string"}, "opt_out": {"description": "True when the contact opted out; no messages are sent to them.", "title": "Opt Out", "type": "boolean"}, "source": {"description": "`manual`, `import` or `api`.", "title": "Source", "type": "string"}}, "required": ["id", "name", "preferred_channel", "opt_out", "source"], "title": "ContactOut", "type": "object"}, "PagedContactOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/ContactOut"}, "title": "Items", "type": "array"}, "count": {"title": "Count", "type": "integer"}}, "required": ["items", "count"], "title": "PagedContactOut", "type": "object"}, "ErrorOut": {"description": "Error body for 4xx/5xx responses.", "properties": {"detail": {"description": "Human-readable reason.", "examples": ["Requires contacts:write permission."], "title": "Detail", "type": "string"}}, "required": ["detail"], "title": "ErrorOut", "type": "object"}, "AcceptedOut": {"description": "Returned by every write endpoint (HTTP 202). Poll `Location` / `GET /commands/{command_id}/`.", "properties": {"command_id": {"description": "Id to poll at `GET /api/v1/commands/{command_id}/`.", "title": "Command Id", "type": "string"}, "status": {"description": "`pending`, `completed` or `failed`.", "examples": ["pending"], "title": "Status", "type": "string"}, "resource_url": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "URL of the created/affected resource once known (already set on idempotent replays).", "title": "Resource Url"}}, "required": ["command_id", "status"], "title": "AcceptedOut", "type": "object"}, "ContactIn": {"properties": {"name": {"examples": ["Maria Shikongo"], "title": "Name", "type": "string"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Email address for delivery or reference.", "title": "Email"}, "phone_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "E.164 or national format.", "examples": ["+264812345678"], "title": "Phone Number"}, "preferred_channel": {"default": "sms", "description": "`sms`, `whatsapp`, or `email`.", "title": "Preferred Channel", "type": "string"}}, "required": ["name"], "title": "ContactIn", "type": "object"}, "ContactUpdateIn": {"description": "Send only the fields to change.", "properties": {"name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "phone_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "examples": ["+264812345678"], "title": "Phone Number"}, "preferred_channel": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "`sms`, `whatsapp`, or `email`.", "title": "Preferred Channel"}}, "title": "ContactUpdateIn", "type": "object"}, "BlueprintOut": {"properties": {"id": {"description": "Use as `blueprint_id` when creating reminders and campaigns.", "title": "Id", "type": "string"}, "name": {"title": "Name", "type": "string"}, "channel": {"description": "`sms`, `whatsapp`, or `email`.", "title": "Channel", "type": "string"}, "use_case": {"title": "Use Case", "type": "string"}, "body_text": {"description": "Message text with `{{variable}}` placeholders.", "title": "Body Text", "type": "string"}, "status": {"title": "Status", "type": "string"}, "is_approved": {"title": "Is Approved", "type": "boolean"}, "variables": {"description": "Variables the message needs: `[{\"name\",\"label\",\"type\",\"required\",\"default\",\"max_length\"}]`. Supply them in `variables_data` (or `var_<name>` in a workbook import).", "items": {}, "title": "Variables", "type": "array"}, "has_data_source": {"default": false, "description": "True when variables are fetched live from a data source.", "title": "Has Data Source", "type": "boolean"}}, "required": ["id", "name", "channel", "use_case", "body_text", "status", "is_approved", "variables"], "title": "BlueprintOut", "type": "object"}, "PagedBlueprintOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/BlueprintOut"}, "title": "Items", "type": "array"}, "count": {"title": "Count", "type": "integer"}}, "required": ["items", "count"], "title": "PagedBlueprintOut", "type": "object"}, "PagedReminderOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/ReminderOut"}, "title": "Items", "type": "array"}, "count": {"title": "Count", "type": "integer"}}, "required": ["items", "count"], "title": "PagedReminderOut", "type": "object"}, "ReminderOut": {"properties": {"reminder_id": {"title": "Reminder Id", "type": "string"}, "status": {"description": "`pending`, `queued`, `sent`, `delivered`, `failed` or `cancelled`.", "title": "Status", "type": "string"}, "channel": {"title": "Channel", "type": "string"}, "scheduled_time": {"format": "date-time", "title": "Scheduled Time", "type": "string"}, "contact_id": {"title": "Contact Id", "type": "integer"}, "sandbox": {"default": false, "title": "Sandbox", "type": "boolean"}}, "required": ["reminder_id", "status", "channel", "scheduled_time", "contact_id"], "title": "ReminderOut", "type": "object"}, "InsufficientCreditsDetail": {"properties": {"code": {"examples": ["insufficient_credits"], "title": "Code", "type": "string"}, "message": {"title": "Message", "type": "string"}, "balance": {"description": "Current credit balance.", "title": "Balance", "type": "integer"}, "required": {"description": "Credits the request needs.", "title": "Required", "type": "integer"}}, "required": ["code", "message", "balance", "required"], "title": "InsufficientCreditsDetail", "type": "object"}, "InsufficientCreditsOut": {"properties": {"error": {"$ref": "#/components/schemas/InsufficientCreditsDetail"}}, "required": ["error"], "title": "InsufficientCreditsOut", "type": "object"}, "ReminderIn": {"properties": {"blueprint_id": {"description": "From `GET /blueprints/`.", "title": "Blueprint Id", "type": "string"}, "channel": {"description": "`sms`, `whatsapp`, or `email`. Must match the blueprint's channel.", "examples": ["sms"], "title": "Channel", "type": "string"}, "contact_id": {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Existing contact. Give this, `phone` or `email`.", "title": "Contact Id"}, "phone": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "E.164; creates the contact if missing.", "examples": ["+264812345678"], "title": "Phone"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Finds or creates the contact by email (required for `email` channel if contact missing).", "title": "Email"}, "variables_data": {"additionalProperties": true, "default": {}, "description": "Template variables.", "examples": [{"amount": "N$4,500"}], "title": "Variables Data", "type": "object"}, "scheduled_time": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "ISO 8601 with offset. Omit to send now.", "examples": ["2026-12-01T09:00:00+02:00"], "title": "Scheduled Time"}}, "required": ["blueprint_id", "channel"], "title": "ReminderIn", "type": "object"}, "AnalyticsSummaryOut": {"properties": {"total": {"title": "Total", "type": "integer"}, "sent": {"title": "Sent", "type": "integer"}, "delivered": {"title": "Delivered", "type": "integer"}, "failed": {"title": "Failed", "type": "integer"}, "pending": {"title": "Pending", "type": "integer"}}, "required": ["total", "sent", "delivered", "failed", "pending"], "title": "AnalyticsSummaryOut", "type": "object"}, "DataSourceOut": {"properties": {"id": {"title": "Id", "type": "string"}, "name": {"title": "Name", "type": "string"}, "source_type": {"description": "`rest_api`, `google_sheets`, `sharepoint`, `excel_online` or `api_import`.", "title": "Source Type", "type": "string"}, "is_active": {"title": "Is Active", "type": "boolean"}, "sync_status": {"description": "`idle`, `running`, `ok` or `error`.", "title": "Sync Status", "type": "string"}, "last_synced_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "title": "Last Synced At"}}, "required": ["id", "name", "source_type", "is_active", "sync_status"], "title": "DataSourceOut", "type": "object"}, "PagedDataSourceOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/DataSourceOut"}, "title": "Items", "type": "array"}, "count": {"title": "Count", "type": "integer"}}, "required": ["items", "count"], "title": "PagedDataSourceOut", "type": "object"}, "DataSourceIn": {"properties": {"name": {"title": "Name", "type": "string"}, "source_type": {"description": "`rest_api`. Spreadsheet sources need the account sign-in done in the dashboard (Spreadsheet Sync); to push rows from your system use `POST /imports/workbook`.", "examples": ["rest_api"], "title": "Source Type", "type": "string"}, "variable_mappings": {"default": [], "examples": [[{"blueprint_variable": "balance", "source_field": "bal", "transform": "currency"}]], "items": {}, "title": "Variable Mappings", "type": "array"}, "contact_identifier_field": {"default": "phone", "description": "`phone` or `email`.", "title": "Contact Identifier Field", "type": "string"}}, "required": ["name", "source_type"], "title": "DataSourceIn", "type": "object"}, "PagedSyncOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/SyncOut"}, "title": "Items", "type": "array"}, "count": {"title": "Count", "type": "integer"}}, "required": ["items", "count"], "title": "PagedSyncOut", "type": "object"}, "RowErrorOut": {"properties": {"tab": {"examples": ["Reminders"], "title": "Tab", "type": "string"}, "row": {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Row number (sheet row, or 1-based index in an API import).", "title": "Row"}, "key": {"default": "", "description": "The row's phone / reminder_key.", "title": "Key", "type": "string"}, "column": {"default": "", "title": "Column", "type": "string"}, "code": {"description": "Stable error code - see the workbook standard.", "examples": ["past_date"], "title": "Code", "type": "string"}, "message": {"title": "Message", "type": "string"}}, "required": ["tab", "code", "message"], "title": "RowErrorOut", "type": "object"}, "SyncOut": {"properties": {"sync_id": {"title": "Sync Id", "type": "string"}, "status": {"description": "`pending`, `running`, `completed` or `failed`.", "title": "Status", "type": "string"}, "triggered_by": {"description": "`manual`, `cron` or `dispatch`.", "title": "Triggered By", "type": "string"}, "started_at": {"format": "date-time", "title": "Started At", "type": "string"}, "completed_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "title": "Completed At"}, "counts": {"additionalProperties": true, "default": {}, "description": "Per tab: created/updated/unchanged/cancelled/skipped.", "examples": [{"Reminders": {"created": 12, "skipped": 2, "unchanged": 340}}], "title": "Counts", "type": "object"}, "error_log": {"default": [], "description": "Whole-sync failures (access, structure, timeout).", "items": {"type": "string"}, "title": "Error Log", "type": "array"}, "row_errors": {"default": [], "description": "Rows that were skipped and why.", "items": {"$ref": "#/components/schemas/RowErrorOut"}, "title": "Row Errors", "type": "array"}}, "required": ["sync_id", "status", "triggered_by", "started_at"], "title": "SyncOut", "type": "object"}, "CommandStatusOut": {"properties": {"command_id": {"title": "Command Id", "type": "string"}, "status": {"description": "`pending`, `completed` or `failed`.", "title": "Status", "type": "string"}, "resource_url": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Resource Url"}, "result": {"additionalProperties": true, "default": {}, "description": "Command-specific outcome, e.g. `reminder_id`, `sync_id`.", "title": "Result", "type": "object"}, "error": {"default": "", "description": "Why the command failed (business rule, not found, insufficient credits).", "title": "Error", "type": "string"}}, "required": ["command_id", "status"], "title": "CommandStatusOut", "type": "object"}, "GroupOut": {"properties": {"id": {"title": "Id", "type": "integer"}, "name": {"title": "Name", "type": "string"}, "description": {"default": "", "title": "Description", "type": "string"}, "member_count": {"default": 0, "title": "Member Count", "type": "integer"}}, "required": ["id", "name"], "title": "GroupOut", "type": "object"}, "PagedGroupOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/GroupOut"}, "title": "Items", "type": "array"}, "count": {"title": "Count", "type": "integer"}}, "required": ["items", "count"], "title": "PagedGroupOut", "type": "object"}, "GroupIn": {"properties": {"name": {"description": "Unique per account; re-posting an existing name returns that group.", "title": "Name", "type": "string"}, "description": {"default": "", "title": "Description", "type": "string"}}, "required": ["name"], "title": "GroupIn", "type": "object"}, "GroupMembersIn": {"properties": {"contact_ids": {"description": "Contacts to add. Ids not owned by you are ignored.", "items": {"type": "integer"}, "title": "Contact Ids", "type": "array"}}, "required": ["contact_ids"], "title": "GroupMembersIn", "type": "object"}, "CampaignOut": {"properties": {"campaign_id": {"title": "Campaign Id", "type": "string"}, "name": {"title": "Name", "type": "string"}, "status": {"description": "`scheduled`, `running`, `completed`, `cancelled` or `paused`.", "title": "Status", "type": "string"}, "channel": {"title": "Channel", "type": "string"}, "scheduled_time": {"format": "date-time", "title": "Scheduled Time", "type": "string"}, "group_id": {"title": "Group Id", "type": "integer"}, "blueprint_id": {"title": "Blueprint Id", "type": "string"}, "total_recipients": {"default": 0, "title": "Total Recipients", "type": "integer"}}, "required": ["campaign_id", "name", "status", "channel", "scheduled_time", "group_id", "blueprint_id"], "title": "CampaignOut", "type": "object"}, "PagedCampaignOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/CampaignOut"}, "title": "Items", "type": "array"}, "count": {"title": "Count", "type": "integer"}}, "required": ["items", "count"], "title": "PagedCampaignOut", "type": "object"}, "CampaignIn": {"properties": {"group_id": {"description": "From `GET /groups/`.", "title": "Group Id", "type": "integer"}, "blueprint_id": {"description": "A published blueprint for the same channel.", "title": "Blueprint Id", "type": "string"}, "channel": {"description": "`sms`, `whatsapp`, or `email`. Must match the blueprint's channel.", "examples": ["whatsapp"], "title": "Channel", "type": "string"}, "scheduled_time": {"examples": ["2026-12-01T09:00:00+02:00"], "format": "date-time", "title": "Scheduled Time", "type": "string"}, "name": {"default": "", "description": "Defaults to `<blueprint> - Campaign`.", "title": "Name", "type": "string"}, "variables_data": {"additionalProperties": true, "default": {}, "description": "Shared variables; contact fields fill the rest per recipient.", "title": "Variables Data", "type": "object"}}, "required": ["group_id", "blueprint_id", "channel", "scheduled_time"], "title": "CampaignIn", "type": "object"}, "WorkbookImportIn": {"properties": {"name": {"default": "api", "description": "Import stream name. Keys are scoped to it: use one name per source system and keep it stable.", "examples": ["crm"], "title": "Name", "type": "string"}, "full_snapshot": {"default": false, "description": "`true`: this call is the complete list - pending reminders whose `reminder_key` is absent are cancelled. `false`: only add/update.", "title": "Full Snapshot", "type": "boolean"}, "contacts": {"default": [], "description": "Rows using the Contacts columns of the workbook standard.", "examples": [[{"groups": "Tenants", "name": "Maria", "phone": "+264812345678", "var_unit": "4B"}]], "items": {"additionalProperties": true, "type": "object"}, "title": "Contacts", "type": "array"}, "reminders": {"default": [], "description": "Rows using the Reminders columns. `send_at` is `YYYY-MM-DD HH:MM` in the account timezone.", "examples": [[{"blueprint": "Rent Due", "channel": "sms", "reminder_key": "R-1", "send_at": "2026-12-01 09:00", "target_contact": "+264812345678", "var_amount": "N$4,500"}]], "items": {"additionalProperties": true, "type": "object"}, "title": "Reminders", "type": "array"}}, "title": "WorkbookImportIn", "type": "object"}, "MessageAcceptedOut": {"properties": {"command_id": {"description": "Id to poll at `GET /api/v1/commands/{command_id}/`.", "title": "Command Id", "type": "string"}, "status": {"description": "`pending`, `completed` or `failed`.", "examples": ["pending"], "title": "Status", "type": "string"}, "resource_url": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "URL of the created/affected resource once known (already set on idempotent replays).", "title": "Resource Url"}, "id": {"description": "Message UUID (`GET /api/v1/messages/{id}/`).", "title": "Id", "type": "string"}}, "required": ["command_id", "status", "id"], "title": "MessageAcceptedOut", "type": "object"}, "MessageSendIn": {"properties": {"to": {"examples": ["+264811234567"], "title": "To", "type": "string"}, "message": {"examples": ["Your invoice #1042 is due tomorrow."], "title": "Message", "type": "string"}, "sender": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Approved sender identity for this business.", "title": "Sender"}, "client_ref": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Caller correlation reference.", "title": "Client Ref"}}, "required": ["to", "message"], "title": "MessageSendIn", "type": "object"}, "MessageOut": {"properties": {"id": {"title": "Id", "type": "string"}, "source": {"title": "Source", "type": "string"}, "status": {"title": "Status", "type": "string"}, "to": {"title": "To", "type": "string"}, "sender": {"title": "Sender", "type": "string"}, "client_ref": {"title": "Client Ref", "type": "string"}, "error_code": {"title": "Error Code", "type": "string"}, "error_message": {"title": "Error Message", "type": "string"}, "reminder_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reminder Id"}, "created_at": {"format": "date-time", "title": "Created At", "type": "string"}, "updated_at": {"format": "date-time", "title": "Updated At", "type": "string"}}, "required": ["id", "source", "status", "to", "sender", "client_ref", "error_code", "error_message", "created_at", "updated_at"], "title": "MessageOut", "type": "object"}}, "securitySchemes": {"APIKeyAuth": {"type": "http", "scheme": "bearer"}}}, "servers": []}