REST API

Developer Reference & API Documentation

Integrate your systems with TGCPilot using our RESTful Public API.

Authentication #

Base URL: https://tgcpilot.com/api/v1

All requests to the TGCPilot Public API must be authenticated using a workspace API key secret transmitted via the HTTP Authorization header as a Bearer token.

# Header format
Authorization: Bearer tgcp_live_EXAMPLE_do-not-use

Transport & TLS

All API communication requires HTTPS/TLS. Plaintext HTTP connections are refused with status 403 tls_required in all non-local environments.

Security Invariant: Server-Side Use Only

API keys grant full programmatic access to your workspace according to their configured scopes. Never embed API keys in browser client applications, mobile apps, or public source repositories. All API calls must originate from your secure backend servers.

Scopes & Permissions #

Every API key is granted a discrete set of granular permission scopes. TGCPilot enforces the principle of least privilege: new API credentials default to zero granted scopes. Each required capability must be explicitly assigned upon creation or editing.

Scope Description
messages:send Send WhatsApp messages on behalf of this workspace.
messages:read Read sent and received messages.
conversations:read Read conversations and their state.
conversations:assign Assign or release conversations.
conversations:close Close conversations.
notes:read Read internal notes attached to conversations.
contacts:read Read contacts and their attributes.
contacts:write Create and update contacts.
contacts:delete Delete contacts.
contacts:import Bulk import contacts.
templates:read Read approved message templates.
campaigns:trigger Trigger campaign launches.
webhooks:manage Manage webhook endpoints.
commerce:read Read connected stores and their orders.

Rate Limits #

API rate limits resolve in three tiers: (1) an individual API key override if configured; (2) the workspace subscription plan limit; or (3) the system default of 600 requests per minute.

Rate Limit Headers

Every response — including errors and rate-limited refusals — returns the following standard headers:

  • X-RateLimit-Limit — Total request capacity per 1-minute sliding window.
  • X-RateLimit-Remaining — Number of requests remaining in the current window.
  • X-RateLimit-Reset — Unix epoch timestamp when the current window resets.

Handling 429 Rate Limited

When a key exceeds its rate limit, the API responds with HTTP 429 rate_limited and includes a Retry-After: {seconds} header. Clients must pause and retry after the specified delay using exponential backoff with jitter.

Pagination #

List endpoints utilize deterministic, cursor-based pagination for high performance and stability.

Query Parameters

  • limit — Number of records to return (default: 25, max: 100).
  • cursor — Opaque string from the previous page's meta.next_cursor.

Response Envelope Metadata

  • meta.has_more — Boolean indicating if additional pages exist.
  • meta.next_cursor — String cursor or null on the final page.
  • meta.total — Total record count (contacts and templates only).

Note

Note: Passing a cursor past the end of the collection returns {"data": [], "meta": {"has_more": false, "next_cursor": null}} with status 200 OK (never an error).

Idempotency #

To safely retry state-mutating requests (POST, PATCH, DELETE) without creating accidental duplicates, supply a unique client-generated key in the Idempotency-Key header (up to 255 ASCII characters, such as a UUID v4).

Exact Replay

Sending the same idempotency key with an identical payload within 24 hours returns the original cached response with the header Idempotency-Replayed: true.

Fingerprint Conflict

Reusing an existing key with a different request payload returns 409 idempotency_key_reuse with the key name in details.idempotency_key.

Concurrent Execution

A second request using an in-progress key returns 409 idempotency_request_in_progress with header Retry-After: 1.

Scope Changes

Permission changes apply to new requests; accepted work completes under its original authorization grant.

Error Handling #

All API errors adhere to a uniform JSON envelope containing a machine-readable string code, a human-readable localized message, and optional contextual details.

JSON
{
  "error": {
    "code": "validation_failed",
    "message": "The request could not be validated.",
    "details": {
      "fields": {
        "to": ["The destination phone number is invalid."]
      }
    }
  }
}
Status Code Default Message
400 malformed_request The request body is not parseable JSON.
401 unauthenticated Authentication failed. Please provide a valid Bearer token.
403 tls_required TLS is required. Plaintext HTTP transport is not permitted.
403 scope_missing The credential lacks the required permission scope for this operation.
402 subscription_gated Your subscription tier does not allow this operation.
404 not_found The requested resource was not found in this workspace.
409 idempotency_key_reuse This idempotency key was previously used with a different request payload.
409 idempotency_request_in_progress A request with this idempotency key is currently in progress. Please retry.
409 contact_already_exists A contact with this phone number already exists in this workspace.
409 campaign_not_launchable The campaign is not in a launchable state.
413 payload_too_large The request payload exceeds the allowed size limit.
422 validation_failed The request could not be validated.
422 template_not_available The template is unknown, unapproved, or unavailable in the requested language.
422 service_window_closed The 24-hour service window is closed. Send an approved template instead.
422 contact_opted_out The recipient has opted out of messaging.
422 not_connected The workspace does not have an active WhatsApp connection.
422 channel_required Choose a messaging channel.
422 channel_account_required Choose a channel account.
422 channel_account_mismatch The selected channel account does not match the conversation or recipient.
422 channel_account_unavailable This channel account is unavailable.
422 channel_account_revoked Access to this channel account was revoked.
422 channel_account_removed This channel account was removed.
422 contact_archived This contact is archived.
422 template_unusable This template is unavailable for sending.
422 template_paused This template is paused.
422 unsupported_capability:template This channel does not support templates.
422 unsupported_capability:text This channel does not support text messages.
429 rate_limited Too many requests. Please slow down and retry after the rate limit window resets.
503 temporarily_unavailable A required service dependency is temporarily unavailable. Please try again.

Quickstart Tutorial: Sending a Message #

This complete walkthrough illustrates the entire lifecycle of programmatic messaging: creating a key, querying approved templates, sending a personalized template message with idempotency, and polling delivery status.

Step 1: Generate Scoped Credentials

Create an API key with the templates:read and messages:send scopes. Securely save the revealed secret token tgcp_live_EXAMPLE_do-not-use.

Step 2: List Approved Templates

Query approved WhatsApp message templates to inspect required variable positions:

# cURL Request
curl "https://tgcpilot.com/api/v1/templates" \
  -H "Authorization: Bearer tgcp_live_EXAMPLE_do-not-use"
# Response (200 OK)
{
  "data": [
    {
      "name": "order_shipped",
      "category": "UTILITY",
      "languages": [
        {
          "language": "ar",
          "status": "approved",
          "variables": [
            { "position": 1, "example": "1042" },
            { "position": 2, "example": "Tomorrow" }
          ]
        }
      ]
    }
  ],
  "meta": {
    "has_more": false,
    "next_cursor": null,
    "total": 1
  }
}

Step 3: Send Template Message

Dispatch the message payload with exact variable parameters and an Idempotency-Key:

# cURL Request
curl -X POST "https://tgcpilot.com/api/v1/messages" \
  -H "Authorization: Bearer tgcp_live_EXAMPLE_do-not-use" \
  -H "Idempotency-Key: e8c44ad0-2e47-4971-9c60-e8320490b6a2" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+96551234567",
    "template": {
      "name": "order_shipped",
      "language": "ar",
      "variables": { "1": "1042", "2": "Tomorrow" }
    }
  }'
# Response (202 Accepted)
{
  "data": {
    "id": "msg_18412",
    "conversation_id": "cnv_902",
    "direction": "outbound",
    "status": "queued",
    "failure_reason": null,
    "sent_via": { "type": "api_key", "id": "key_31", "name": "Integration key" },
    "created_at": "2026-08-17T09:14:22Z"
  }
}

Step 4: Poll Delivery Status

Query the message identifier to inspect updated delivery state:

# cURL Request
curl "https://tgcpilot.com/api/v1/messages/msg_18412" \
  -H "Authorization: Bearer tgcp_live_EXAMPLE_do-not-use"
# Response (200 OK)
{
  "data": {
    "id": "msg_18412",
    "conversation_id": "cnv_902",
    "direction": "outbound",
    "status": "delivered",
    "failure_reason": null,
    "sent_via": { "type": "api_key", "id": "key_31", "name": "Integration key" },
    "created_at": "2026-08-17T09:14:22Z"
  }
}

Endpoint Reference #

Send a template or free-form WhatsApp message. #

POST /api/v1/messages

Queue text or an approved template on an existing conversation or on a named or default channel account. WhatsApp text requires an open service window.

scope: messages:send Idempotent

Request Schema
{
    "type": "object",
    "properties": {
        "conversation_id": {
            "type": "integer",
            "minimum": 1
        },
        "channel": {
            "type": "string"
        },
        "channel_account_id": {
            "type": "string",
            "description": "Public channel account ULID."
        },
        "to": {
            "type": "string",
            "description": "Recipient address on the selected channel."
        },
        "type": {
            "type": "string",
            "enum": [
                "text",
                "template"
            ]
        },
        "template": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "language": {
                    "type": "string"
                },
                "variables": {
                    "type": "object",
                    "description": "Values keyed by variable position. A number is accepted and sent as its string form.",
                    "additionalProperties": {
                        "type": [
                            "string",
                            "number"
                        ]
                    }
                }
            },
            "required": [
                "name",
                "language"
            ]
        },
        "text": {
            "type": "string"
        }
    },
    "oneOf": [
        {
            "required": [
                "conversation_id"
            ],
            "not": {
                "required": [
                    "to"
                ]
            }
        },
        {
            "required": [
                "channel",
                "to"
            ],
            "not": {
                "required": [
                    "conversation_id"
                ]
            }
        }
    ],
    "required": [
        "type"
    ]
}
Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "conversation_id": {
                    "type": "string"
                },
                "direction": {
                    "type": "string",
                    "enum": [
                        "inbound",
                        "outbound"
                    ]
                },
                "channel": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string"
                        },
                        "account_id": {
                            "type": "string"
                        },
                        "account_label": {
                            "type": "string"
                        },
                        "account_removed": {
                            "type": "boolean"
                        }
                    },
                    "required": [
                        "type",
                        "account_id",
                        "account_label",
                        "account_removed"
                    ]
                },
                "provider_message_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "quoted_message_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "type": {
                    "type": "string"
                },
                "content": {
                    "type": "object"
                },
                "source": {
                    "type": "string"
                },
                "ingestion_mode": {
                    "type": "string",
                    "enum": [
                        "live",
                        "history",
                        "echo"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "received",
                        "queued",
                        "sending",
                        "sent",
                        "delivered",
                        "read",
                        "failed",
                        "delivery_unconfirmed"
                    ]
                },
                "status_reason": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "provider_error_class": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "failure_reason": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "sent_via": {
                    "type": [
                        "object",
                        "null"
                    ],
                    "properties": {
                        "type": {
                            "type": "string",
                            "enum": [
                                "api_key",
                                "user",
                                "system"
                            ]
                        },
                        "id": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "name": {
                            "type": "string"
                        }
                    }
                },
                "created_at": {
                    "type": "string",
                    "format": "date-time"
                }
            },
            "required": [
                "id",
                "conversation_id",
                "direction",
                "status",
                "created_at"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: validation_failed (422) not_found (404) channel_required (422) channel_account_required (422) channel_account_mismatch (422) channel_account_unavailable (422) channel_account_revoked (422) channel_account_removed (422) contact_archived (422) template_unusable (422) template_paused (422) unsupported_capability:template (422) unsupported_capability:text (422) service_window_closed (422) contact_opted_out (422) subscription_gated (402) scope_missing (403) unauthenticated (401) rate_limited (429) payload_too_large (413) idempotency_key_reuse (409) idempotency_request_in_progress (409)

Retrieve a message by ID. #

GET /api/v1/messages/{id}

Fetch delivery status and details for an outbound or inbound message in this workspace.

scope: messages:read

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "conversation_id": {
                    "type": "string"
                },
                "direction": {
                    "type": "string",
                    "enum": [
                        "inbound",
                        "outbound"
                    ]
                },
                "channel": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string"
                        },
                        "account_id": {
                            "type": "string"
                        },
                        "account_label": {
                            "type": "string"
                        },
                        "account_removed": {
                            "type": "boolean"
                        }
                    },
                    "required": [
                        "type",
                        "account_id",
                        "account_label",
                        "account_removed"
                    ]
                },
                "provider_message_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "quoted_message_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "type": {
                    "type": "string"
                },
                "content": {
                    "type": "object"
                },
                "source": {
                    "type": "string"
                },
                "ingestion_mode": {
                    "type": "string",
                    "enum": [
                        "live",
                        "history",
                        "echo"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "received",
                        "queued",
                        "sending",
                        "sent",
                        "delivered",
                        "read",
                        "failed",
                        "delivery_unconfirmed"
                    ]
                },
                "status_reason": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "provider_error_class": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "failure_reason": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "sent_via": {
                    "type": [
                        "object",
                        "null"
                    ],
                    "properties": {
                        "type": {
                            "type": "string",
                            "enum": [
                                "api_key",
                                "user",
                                "system"
                            ]
                        },
                        "id": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "name": {
                            "type": "string"
                        }
                    }
                },
                "created_at": {
                    "type": "string",
                    "format": "date-time"
                }
            },
            "required": [
                "id",
                "conversation_id",
                "direction",
                "status",
                "created_at"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429)

List contacts with filters and cursor pagination. #

GET /api/v1/contacts

Retrieve a cursor-paginated list of contacts in this workspace matching search terms, tags, segment, country_code, and creation date filters. phone returns the single contact owning that number as a primary or secondary number (E.164, or local with the workspace default country) and cannot be combined with other filters. updated_after (ISO-8601, UTC when no offset is given, inclusive) returns contacts changed since then, including contacts changed by imports, audience uploads and bulk tagging; ordering stays newest-created first.

scope: contacts:read Paginated Total Count

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "company": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "locale": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "country_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "ISO 3166-1 alpha-2 contact country."
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "attributes": {
                        "type": "object"
                    },
                    "consent_status": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id"
                ]
            }
        },
        "meta": {
            "type": "object",
            "properties": {
                "has_more": {
                    "type": "boolean"
                },
                "next_cursor": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "total": {
                    "type": "integer"
                }
            },
            "required": [
                "has_more"
            ]
        }
    },
    "required": [
        "data",
        "meta"
    ]
}

Possible Error Codes: validation_failed (422) not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429)

Create a new contact. #

POST /api/v1/contacts

Create a contact with phone, optional country_code (ISO 3166-1 alpha-2), name, email, company, locale, tags, and custom attributes. Country is used as the local phone parsing hint.

scope: contacts:write Idempotent

Request Schema
{
    "type": "object",
    "properties": {
        "phone": {
            "type": "string"
        },
        "name": {
            "type": "string"
        },
        "email": {
            "type": "string"
        },
        "company": {
            "type": "string"
        },
        "locale": {
            "type": "string",
            "enum": [
                "ar",
                "en"
            ]
        },
        "country_code": {
            "type": [
                "string",
                "null"
            ],
            "description": "ISO 3166-1 alpha-2 country; used to parse local phone numbers."
        },
        "tags": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "attributes": {
            "type": "object"
        }
    },
    "required": [
        "phone"
    ]
}
Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "phone": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "name": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "email": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "company": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "locale": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "country_code": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "description": "ISO 3166-1 alpha-2 contact country."
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "attributes": {
                    "type": "object"
                },
                "consent_status": {
                    "type": "string"
                },
                "created_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "updated_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                }
            },
            "required": [
                "id"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: validation_failed (422) contact_already_exists (409) scope_missing (403) unauthenticated (401) rate_limited (429) payload_too_large (413) idempotency_key_reuse (409) idempotency_request_in_progress (409)

Retrieve a contact by ID. #

GET /api/v1/contacts/{id}

Fetch details, tags, attributes, and consent status for a specific contact.

scope: contacts:read

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "phone": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "name": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "email": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "company": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "locale": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "country_code": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "description": "ISO 3166-1 alpha-2 contact country."
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "attributes": {
                    "type": "object"
                },
                "consent_status": {
                    "type": "string"
                },
                "created_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "updated_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                }
            },
            "required": [
                "id"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429)

Update an existing contact. #

PATCH /api/v1/contacts/{id}

Apply field-level changes to a contact including country_code (or null to clear it), name, email, company, locale, tags, and custom attributes.

scope: contacts:write Idempotent

Request Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string"
        },
        "email": {
            "type": "string"
        },
        "company": {
            "type": "string"
        },
        "locale": {
            "type": "string",
            "enum": [
                "ar",
                "en"
            ]
        },
        "country_code": {
            "type": [
                "string",
                "null"
            ],
            "description": "ISO 3166-1 alpha-2 country; null clears the value."
        },
        "tags": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "attributes": {
            "type": "object"
        }
    }
}
Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "phone": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "name": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "email": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "company": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "locale": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "country_code": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "description": "ISO 3166-1 alpha-2 contact country."
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "attributes": {
                    "type": "object"
                },
                "consent_status": {
                    "type": "string"
                },
                "created_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "updated_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                }
            },
            "required": [
                "id"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: validation_failed (422) not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429) payload_too_large (413) idempotency_key_reuse (409) idempotency_request_in_progress (409)

Delete (archive) a contact. #

DELETE /api/v1/contacts/{id}

Archive a contact in this workspace while preserving conversation history and consent state.

scope: contacts:delete Idempotent

Possible Error Codes: not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429) idempotency_key_reuse (409) idempotency_request_in_progress (409)

List custom contact attributes. #

GET /api/v1/contact-attributes

Returns the key, label, type and, for single-choice attributes, the options of every custom attribute defined in this workspace.

scope: contacts:read

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string"
                    },
                    "label": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "text",
                            "number",
                            "date",
                            "boolean",
                            "single_choice"
                        ]
                    },
                    "options": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "key",
                    "label",
                    "type",
                    "options"
                ]
            }
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: scope_missing (403) unauthenticated (401) rate_limited (429)

Add a tag to a contact. #

POST /api/v1/contacts/{id}/tags

Adds one tag, creating it if it does not exist, without touching the contact's other tags. Adding a tag the contact already has changes nothing.

scope: contacts:write Idempotent

Request Schema
{
    "type": "object",
    "properties": {
        "tag": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
        }
    },
    "required": [
        "tag"
    ]
}
Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "phone": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "name": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "email": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "company": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "locale": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "country_code": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "description": "ISO 3166-1 alpha-2 contact country."
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "attributes": {
                    "type": "object"
                },
                "consent_status": {
                    "type": "string"
                },
                "created_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "updated_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                }
            },
            "required": [
                "id"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: validation_failed (422) not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429) payload_too_large (413) idempotency_key_reuse (409) idempotency_request_in_progress (409)

Remove a tag from a contact. #

DELETE /api/v1/contacts/{id}/tags/{tag}

Removes one tag by name without touching the contact's other tags. Removing a tag the contact does not have changes nothing.

scope: contacts:write Idempotent

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "phone": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "name": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "email": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "company": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "locale": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "country_code": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "description": "ISO 3166-1 alpha-2 contact country."
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "attributes": {
                    "type": "object"
                },
                "consent_status": {
                    "type": "string"
                },
                "created_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "updated_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                }
            },
            "required": [
                "id"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429) idempotency_key_reuse (409) idempotency_request_in_progress (409)

Start a bulk contact import. #

POST /api/v1/contact-imports

Upload a CSV file and column mapping to import contacts asynchronously.

scope: contacts:import Idempotent

Request Schema
{
    "type": "object",
    "properties": {
        "file": {
            "type": "string",
            "format": "binary"
        },
        "mapping": {
            "type": "object"
        },
        "duplicate_strategy": {
            "type": "string",
            "enum": [
                "skip",
                "update"
            ]
        }
    },
    "required": [
        "file",
        "mapping",
        "duplicate_strategy"
    ]
}
Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "total_rows": {
                    "type": "integer"
                },
                "processed_rows": {
                    "type": "integer"
                },
                "created_count": {
                    "type": "integer"
                },
                "updated_count": {
                    "type": "integer"
                },
                "rejected_count": {
                    "type": "integer"
                },
                "started_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "completed_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "created_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                }
            },
            "required": [
                "id",
                "status"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: validation_failed (422) scope_missing (403) unauthenticated (401) rate_limited (429) payload_too_large (413) idempotency_key_reuse (409) idempotency_request_in_progress (409)

Get contact import status and progress. #

GET /api/v1/contact-imports/{id}

Fetch current progress, row counts, and completion status of a bulk contact import.

scope: contacts:import

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "total_rows": {
                    "type": "integer"
                },
                "processed_rows": {
                    "type": "integer"
                },
                "created_count": {
                    "type": "integer"
                },
                "updated_count": {
                    "type": "integer"
                },
                "rejected_count": {
                    "type": "integer"
                },
                "started_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "completed_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "created_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                }
            },
            "required": [
                "id",
                "status"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429)

List rejected rows for a contact import. #

GET /api/v1/contact-imports/{id}/rejections

Retrieve a cursor-paginated list of rejected and skipped rows for an import with rejection reasons and machine-readable error codes.

scope: contacts:import Paginated

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "row_number": {
                        "type": "integer"
                    },
                    "reason": {
                        "type": "string"
                    },
                    "reason_code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "row_number",
                    "reason"
                ]
            }
        },
        "meta": {
            "type": "object",
            "properties": {
                "has_more": {
                    "type": "boolean"
                },
                "next_cursor": {
                    "type": [
                        "string",
                        "null"
                    ]
                }
            },
            "required": [
                "has_more"
            ]
        }
    },
    "required": [
        "data",
        "meta"
    ]
}

Possible Error Codes: not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429)

List conversations with filters and cursor pagination. #

GET /api/v1/conversations

Retrieve a cursor-paginated list of conversations in this workspace ordered by newest activity with optional state, assignee, contact, and date filters. Filter by channel type with channel and by public account ULID with channel_account_id.

scope: conversations:read Paginated

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "contact_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "channel": {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string"
                            },
                            "account_id": {
                                "type": "string"
                            },
                            "account_label": {
                                "type": "string"
                            },
                            "account_removed": {
                                "type": "boolean"
                            }
                        },
                        "required": [
                            "type",
                            "account_id",
                            "account_label",
                            "account_removed"
                        ]
                    },
                    "participant": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "display_name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "external_id": {
                                "type": "string"
                            },
                            "external_id_label": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "id",
                            "display_name",
                            "external_id",
                            "external_id_label"
                        ]
                    },
                    "needs_contact_link": {
                        "type": "boolean"
                    },
                    "state": {
                        "type": "string"
                    },
                    "assignee_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "department_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_message_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "last_inbound_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "snoozed_until": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "closed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "internal_notes": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string"
                                },
                                "body": {
                                    "type": "string"
                                },
                                "author_id": {
                                    "type": "string"
                                },
                                "created_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "format": "date-time"
                                }
                            },
                            "required": [
                                "id",
                                "body",
                                "author_id"
                            ]
                        }
                    }
                },
                "required": [
                    "id",
                    "state"
                ]
            }
        },
        "meta": {
            "type": "object",
            "properties": {
                "has_more": {
                    "type": "boolean"
                },
                "next_cursor": {
                    "type": [
                        "string",
                        "null"
                    ]
                }
            },
            "required": [
                "has_more"
            ]
        }
    },
    "required": [
        "data",
        "meta"
    ]
}

Possible Error Codes: validation_failed (422) scope_missing (403) unauthenticated (401) rate_limited (429)

Retrieve a conversation by ID. #

GET /api/v1/conversations/{id}

Fetch details and state of a conversation, including internal notes when the credential carries the notes:read scope. The response identifies the channel account and participant and reports whether the conversation needs a contact link.

scope: conversations:read

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "contact_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "channel": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string"
                        },
                        "account_id": {
                            "type": "string"
                        },
                        "account_label": {
                            "type": "string"
                        },
                        "account_removed": {
                            "type": "boolean"
                        }
                    },
                    "required": [
                        "type",
                        "account_id",
                        "account_label",
                        "account_removed"
                    ]
                },
                "participant": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "string"
                        },
                        "display_name": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "external_id": {
                            "type": "string"
                        },
                        "external_id_label": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "id",
                        "display_name",
                        "external_id",
                        "external_id_label"
                    ]
                },
                "needs_contact_link": {
                    "type": "boolean"
                },
                "state": {
                    "type": "string"
                },
                "assignee_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "department_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "last_message_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "last_inbound_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "snoozed_until": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "closed_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "created_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "updated_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "internal_notes": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "body": {
                                "type": "string"
                            },
                            "author_id": {
                                "type": "string"
                            },
                            "created_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "required": [
                            "id",
                            "body",
                            "author_id"
                        ]
                    }
                }
            },
            "required": [
                "id",
                "state"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429)

List messages in a conversation thread. #

GET /api/v1/conversations/{id}/messages

Retrieve a cursor-paginated chronological list of messages in a conversation thread with delivery states and media references. Each message includes canonical content, its channel account and its provider message reference.

scope: conversations:read Paginated

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "direction": {
                        "type": "string"
                    },
                    "channel": {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string"
                            },
                            "account_id": {
                                "type": "string"
                            },
                            "account_label": {
                                "type": "string"
                            },
                            "account_removed": {
                                "type": "boolean"
                            }
                        },
                        "required": [
                            "type",
                            "account_id",
                            "account_label",
                            "account_removed"
                        ]
                    },
                    "provider_message_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "quoted_message_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "type": {
                        "type": "string"
                    },
                    "content": {
                        "type": "object"
                    },
                    "source": {
                        "type": "string"
                    },
                    "ingestion_mode": {
                        "type": "string",
                        "enum": [
                            "live",
                            "history",
                            "echo"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "received",
                            "queued",
                            "sending",
                            "sent",
                            "delivered",
                            "read",
                            "failed",
                            "delivery_unconfirmed"
                        ]
                    },
                    "status_reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "provider_error_class": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "body_text": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "delivered_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "read_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "failed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "media": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "media_kind": {
                                "type": "string"
                            },
                            "mime_type": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "caption": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "id",
                            "media_kind"
                        ]
                    }
                },
                "required": [
                    "id",
                    "direction",
                    "status"
                ]
            }
        },
        "meta": {
            "type": "object",
            "properties": {
                "has_more": {
                    "type": "boolean"
                },
                "next_cursor": {
                    "type": [
                        "string",
                        "null"
                    ]
                }
            },
            "required": [
                "has_more"
            ]
        }
    },
    "required": [
        "data",
        "meta"
    ]
}

Possible Error Codes: not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429)

Assign a conversation to a member. #

POST /api/v1/conversations/{id}/assign

Assigns the conversation to an active member of this workspace, using a member_id from GET /members. Assigning it to the member who already owns it changes nothing. A closed conversation cannot be assigned. The change is recorded against the API key.

scope: conversations:assign Idempotent

Request Schema
{
    "type": "object",
    "properties": {
        "member_id": {
            "type": "string",
            "description": "A member id from GET /members."
        }
    },
    "required": [
        "member_id"
    ]
}
Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "contact_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "channel": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string"
                        },
                        "account_id": {
                            "type": "string"
                        },
                        "account_label": {
                            "type": "string"
                        },
                        "account_removed": {
                            "type": "boolean"
                        }
                    },
                    "required": [
                        "type",
                        "account_id",
                        "account_label",
                        "account_removed"
                    ]
                },
                "participant": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "string"
                        },
                        "display_name": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "external_id": {
                            "type": "string"
                        },
                        "external_id_label": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "id",
                        "display_name",
                        "external_id",
                        "external_id_label"
                    ]
                },
                "needs_contact_link": {
                    "type": "boolean"
                },
                "state": {
                    "type": "string"
                },
                "assignee_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "department_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "last_message_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "last_inbound_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "snoozed_until": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "closed_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "created_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "updated_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "internal_notes": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "body": {
                                "type": "string"
                            },
                            "author_id": {
                                "type": "string"
                            },
                            "created_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "required": [
                            "id",
                            "body",
                            "author_id"
                        ]
                    }
                }
            },
            "required": [
                "id",
                "state"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: validation_failed (422) not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429) payload_too_large (413) idempotency_key_reuse (409) idempotency_request_in_progress (409)

Close a conversation. #

POST /api/v1/conversations/{id}/close

Closes the conversation. Closing one that is already closed changes nothing. The change is recorded against the API key.

scope: conversations:close Idempotent

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "contact_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "channel": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string"
                        },
                        "account_id": {
                            "type": "string"
                        },
                        "account_label": {
                            "type": "string"
                        },
                        "account_removed": {
                            "type": "boolean"
                        }
                    },
                    "required": [
                        "type",
                        "account_id",
                        "account_label",
                        "account_removed"
                    ]
                },
                "participant": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "string"
                        },
                        "display_name": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "external_id": {
                            "type": "string"
                        },
                        "external_id_label": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "id",
                        "display_name",
                        "external_id",
                        "external_id_label"
                    ]
                },
                "needs_contact_link": {
                    "type": "boolean"
                },
                "state": {
                    "type": "string"
                },
                "assignee_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "department_id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "last_message_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "last_inbound_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "snoozed_until": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "closed_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "created_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "updated_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "internal_notes": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "body": {
                                "type": "string"
                            },
                            "author_id": {
                                "type": "string"
                            },
                            "created_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "required": [
                            "id",
                            "body",
                            "author_id"
                        ]
                    }
                }
            },
            "required": [
                "id",
                "state"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429) payload_too_large (413) idempotency_key_reuse (409) idempotency_request_in_progress (409)

List the members conversations can be assigned to. #

GET /api/v1/members

Returns the id and name of each active member of this workspace that a conversation can be assigned to. No email, phone number or role is exposed.

scope: conversations:assign Paginated

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name"
                ]
            }
        },
        "meta": {
            "type": "object",
            "properties": {
                "has_more": {
                    "type": "boolean"
                },
                "next_cursor": {
                    "type": [
                        "string",
                        "null"
                    ]
                }
            }
        }
    },
    "required": [
        "data",
        "meta"
    ]
}

Possible Error Codes: scope_missing (403) unauthenticated (401) rate_limited (429)

List message templates. #

GET /api/v1/templates

Retrieve a cursor-paginated list of WhatsApp templates with per-language approval status, categories, and variable definitions. name matches the template name exactly; language (ar, en or a locale such as en_US) and status (approved, pending, rejected, paused, disabled, failed) keep only templates having a language version that matches both.

scope: templates:read Paginated Total Count

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "languages": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "language": {
                                    "type": "string"
                                },
                                "status": {
                                    "type": "string"
                                },
                                "variables": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "position": {
                                                "type": "integer"
                                            },
                                            "example": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "position",
                                            "example"
                                        ]
                                    }
                                }
                            },
                            "required": [
                                "language",
                                "status",
                                "variables"
                            ]
                        }
                    }
                },
                "required": [
                    "name",
                    "category",
                    "languages"
                ]
            }
        },
        "meta": {
            "type": "object",
            "properties": {
                "has_more": {
                    "type": "boolean"
                },
                "next_cursor": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "total": {
                    "type": "integer"
                }
            },
            "required": [
                "has_more",
                "total"
            ]
        }
    },
    "required": [
        "data",
        "meta"
    ]
}

Possible Error Codes: validation_failed (422) scope_missing (403) unauthenticated (401) rate_limited (429)

Trigger execution of a prepared campaign. #

POST /api/v1/campaigns/{id}/trigger

Launch a prepared audience campaign asynchronously and receive an execution tracking identifier. The id is the number after /campaigns/ in the campaign page address; audience must be the exact name of the campaign audience and confirms the right campaign is launched.

scope: campaigns:trigger Idempotent

Request Schema
{
    "type": "object",
    "properties": {
        "audience": {
            "type": "string"
        }
    },
    "required": [
        "audience"
    ]
}
Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                },
                "counts": {
                    "type": "object",
                    "properties": {
                        "queued": {
                            "type": "integer"
                        },
                        "sent": {
                            "type": "integer"
                        },
                        "delivered": {
                            "type": "integer"
                        },
                        "read": {
                            "type": "integer"
                        },
                        "failed": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "queued",
                        "sent",
                        "delivered",
                        "read",
                        "failed"
                    ]
                }
            },
            "required": [
                "id",
                "state",
                "counts"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: validation_failed (422) campaign_not_launchable (409) subscription_gated (402) not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429) payload_too_large (413) idempotency_key_reuse (409) idempotency_request_in_progress (409)

Retrieve campaign state and delivery metrics. #

GET /api/v1/campaigns/{id}

Fetch the current state and real-time delivery counts (queued, sent, delivered, read, failed) for a campaign.

scope: campaigns:trigger

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                },
                "counts": {
                    "type": "object",
                    "properties": {
                        "queued": {
                            "type": "integer"
                        },
                        "sent": {
                            "type": "integer"
                        },
                        "delivered": {
                            "type": "integer"
                        },
                        "read": {
                            "type": "integer"
                        },
                        "failed": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "queued",
                        "sent",
                        "delivered",
                        "read",
                        "failed"
                    ]
                }
            },
            "required": [
                "id",
                "state",
                "counts"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429)

List configured webhook endpoints. #

GET /api/v1/webhook-endpoints

Retrieve all registered webhook destinations for this workspace. A key owned by an integration connection (Make, Zapier) lists only the live subscriptions of that connection; any other key lists only member-created endpoints.

scope: webhooks:manage

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "event_types": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "status": {
                        "type": "string"
                    },
                    "is_paused": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "url",
                    "event_types",
                    "status",
                    "is_paused"
                ]
            }
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: scope_missing (403) unauthenticated (401) rate_limited (429)

Create a new webhook endpoint. #

POST /api/v1/webhook-endpoints

Register an HTTP destination URL and subscribed event types. The signing secret is returned only once in this response. With a key owned by an integration connection this subscribes that connection: exactly one trigger event (message.inbound, conversation.new, conversation.assigned, conversation.closed, contact.created or contact.updated), an immutable URL, the matching read scope, and optional ignore_own_changes (default true, contact.updated only). Subscribing the same URL and event again answers 200 with the existing subscription and no new secret.

scope: webhooks:manage Idempotent

Request Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string"
        },
        "url": {
            "type": "string",
            "format": "uri"
        },
        "event_types": {
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    },
    "required": [
        "name",
        "url",
        "event_types"
    ]
}
Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "url": {
                    "type": "string",
                    "format": "uri"
                },
                "event_types": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "status": {
                    "type": "string"
                },
                "is_paused": {
                    "type": "boolean"
                },
                "created_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "signing_secret": {
                    "type": "string"
                }
            },
            "required": [
                "id",
                "name",
                "url",
                "event_types",
                "status",
                "is_paused",
                "signing_secret"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: validation_failed (422) scope_missing (403) unauthenticated (401) rate_limited (429) payload_too_large (413) idempotency_key_reuse (409) idempotency_request_in_progress (409)

Update a webhook endpoint. #

PATCH /api/v1/webhook-endpoints/{id}

Modify the destination URL, name, subscribed event types, or active status of a webhook endpoint. A key owned by an integration connection can only pause or resume its own subscriptions (is_paused); URL and event cannot change.

scope: webhooks:manage Idempotent

Request Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string"
        },
        "url": {
            "type": "string",
            "format": "uri"
        },
        "event_types": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "is_paused": {
            "type": "boolean"
        }
    }
}
Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "url": {
                    "type": "string",
                    "format": "uri"
                },
                "event_types": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "status": {
                    "type": "string"
                },
                "is_paused": {
                    "type": "boolean"
                },
                "created_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                }
            },
            "required": [
                "id",
                "name",
                "url",
                "event_types",
                "status",
                "is_paused"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: validation_failed (422) not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429) payload_too_large (413) idempotency_key_reuse (409) idempotency_request_in_progress (409)

Delete a webhook endpoint. #

DELETE /api/v1/webhook-endpoints/{id}

Permanently remove a webhook endpoint from this workspace. A key owned by an integration connection unsubscribes its own subscription; repeating the call answers 204 again, and another connection's subscription answers 404.

scope: webhooks:manage Idempotent

Possible Error Codes: not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429) idempotency_key_reuse (409) idempotency_request_in_progress (409)

Show the calling key. #

GET /api/v1/me

Returns the workspace, the API key and, for a key owned by an integration connection, that connection. Any authenticated key may call it; it needs no scope.

Public

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "workspace": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "string"
                        },
                        "name": {
                            "type": "string"
                        },
                        "locale": {
                            "type": "string"
                        },
                        "timezone": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "id",
                        "name",
                        "locale",
                        "timezone"
                    ]
                },
                "api_key": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "string"
                        },
                        "name": {
                            "type": "string"
                        },
                        "last_four": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "scopes": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "expires_at": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date-time"
                        }
                    },
                    "required": [
                        "id",
                        "name",
                        "scopes"
                    ]
                },
                "connection": {
                    "type": [
                        "object",
                        "null"
                    ],
                    "properties": {
                        "id": {
                            "type": "string"
                        },
                        "provider": {
                            "type": "string"
                        },
                        "display_name": {
                            "type": "string"
                        },
                        "status": {
                            "type": "string",
                            "enum": [
                                "connected"
                            ]
                        }
                    }
                },
                "api_version": {
                    "type": "string"
                }
            },
            "required": [
                "workspace",
                "api_key",
                "connection",
                "api_version"
            ]
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: unauthenticated (401) rate_limited (429) temporarily_unavailable (503)

List connected stores. #

GET /api/v1/commerce/stores

Returns every store connected to this workspace, including a disconnected store whose data is kept until its removal date. Each store reports its import state, when it last synchronized and whether its data is stale.

scope: commerce:read

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "provider": {
                        "type": "string"
                    },
                    "url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "default_currency": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "timezone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "state": {
                        "type": "string",
                        "description": "The connection lifecycle state."
                    },
                    "import_state": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "importing",
                            "complete",
                            "failed"
                        ]
                    },
                    "data_since": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "last_synced_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "stale": {
                        "type": "boolean"
                    },
                    "disconnected_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "data_removal_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "provider",
                    "state",
                    "import_state",
                    "stale"
                ]
            }
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: scope_missing (403) unauthenticated (401) rate_limited (429)

List store orders with filters and cursor pagination. #

GET /api/v1/commerce/orders

Returns the orders imported from the connected stores, newest change first. Filter by store, order, payment or fulfillment status, last change (updated_since, ISO-8601, inclusive) or the buyer phone number in any format. A phone number that cannot be read returns an empty page. List items omit line items and fulfillments; fetch one order for those. Amounts are exact: integer minor units with their currency and exponent. Provider identifiers are never returned. Pages are ordered by change time, so an order that changes while you page can be missed: poll for changes with updated_since instead of re-walking the pages.

scope: commerce:read Paginated

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "store": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Id of the store the order belongs to."
                    },
                    "number": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "totals": {
                        "type": "object",
                        "properties": {
                            "subtotal": {
                                "type": "object",
                                "properties": {
                                    "amount_minor": {
                                        "type": "integer",
                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                    },
                                    "currency": {
                                        "type": "string",
                                        "description": "ISO 4217 code."
                                    },
                                    "exponent": {
                                        "type": "integer",
                                        "description": "Number of minor-unit digits of the currency."
                                    }
                                },
                                "required": [
                                    "amount_minor",
                                    "currency",
                                    "exponent"
                                ]
                            },
                            "discount": {
                                "type": "object",
                                "properties": {
                                    "amount_minor": {
                                        "type": "integer",
                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                    },
                                    "currency": {
                                        "type": "string",
                                        "description": "ISO 4217 code."
                                    },
                                    "exponent": {
                                        "type": "integer",
                                        "description": "Number of minor-unit digits of the currency."
                                    }
                                },
                                "required": [
                                    "amount_minor",
                                    "currency",
                                    "exponent"
                                ]
                            },
                            "shipping": {
                                "type": "object",
                                "properties": {
                                    "amount_minor": {
                                        "type": "integer",
                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                    },
                                    "currency": {
                                        "type": "string",
                                        "description": "ISO 4217 code."
                                    },
                                    "exponent": {
                                        "type": "integer",
                                        "description": "Number of minor-unit digits of the currency."
                                    }
                                },
                                "required": [
                                    "amount_minor",
                                    "currency",
                                    "exponent"
                                ]
                            },
                            "tax": {
                                "type": "object",
                                "properties": {
                                    "amount_minor": {
                                        "type": "integer",
                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                    },
                                    "currency": {
                                        "type": "string",
                                        "description": "ISO 4217 code."
                                    },
                                    "exponent": {
                                        "type": "integer",
                                        "description": "Number of minor-unit digits of the currency."
                                    }
                                },
                                "required": [
                                    "amount_minor",
                                    "currency",
                                    "exponent"
                                ]
                            },
                            "total": {
                                "type": "object",
                                "properties": {
                                    "amount_minor": {
                                        "type": "integer",
                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                    },
                                    "currency": {
                                        "type": "string",
                                        "description": "ISO 4217 code."
                                    },
                                    "exponent": {
                                        "type": "integer",
                                        "description": "Number of minor-unit digits of the currency."
                                    }
                                },
                                "required": [
                                    "amount_minor",
                                    "currency",
                                    "exponent"
                                ]
                            },
                            "original_total": {
                                "oneOf": [
                                    {
                                        "type": "object",
                                        "properties": {
                                            "amount_minor": {
                                                "type": "integer",
                                                "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                            },
                                            "currency": {
                                                "type": "string",
                                                "description": "ISO 4217 code."
                                            },
                                            "exponent": {
                                                "type": "integer",
                                                "description": "Number of minor-unit digits of the currency."
                                            }
                                        },
                                        "required": [
                                            "amount_minor",
                                            "currency",
                                            "exponent"
                                        ]
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "refunded_total": {
                                "oneOf": [
                                    {
                                        "type": "object",
                                        "properties": {
                                            "amount_minor": {
                                                "type": "integer",
                                                "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                            },
                                            "currency": {
                                                "type": "string",
                                                "description": "ISO 4217 code."
                                            },
                                            "exponent": {
                                                "type": "integer",
                                                "description": "Number of minor-unit digits of the currency."
                                            }
                                        },
                                        "required": [
                                            "amount_minor",
                                            "currency",
                                            "exponent"
                                        ]
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            }
                        }
                    },
                    "presentment_total": {
                        "oneOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "amount_minor": {
                                        "type": "integer",
                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                    },
                                    "currency": {
                                        "type": "string",
                                        "description": "ISO 4217 code."
                                    },
                                    "exponent": {
                                        "type": "integer",
                                        "description": "Number of minor-unit digits of the currency."
                                    }
                                },
                                "required": [
                                    "amount_minor",
                                    "currency",
                                    "exponent"
                                ]
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "presentment_original_total": {
                        "oneOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "amount_minor": {
                                        "type": "integer",
                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                    },
                                    "currency": {
                                        "type": "string",
                                        "description": "ISO 4217 code."
                                    },
                                    "exponent": {
                                        "type": "integer",
                                        "description": "Number of minor-unit digits of the currency."
                                    }
                                },
                                "required": [
                                    "amount_minor",
                                    "currency",
                                    "exponent"
                                ]
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "presentment_refunded_total": {
                        "oneOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "amount_minor": {
                                        "type": "integer",
                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                    },
                                    "currency": {
                                        "type": "string",
                                        "description": "ISO 4217 code."
                                    },
                                    "exponent": {
                                        "type": "integer",
                                        "description": "Number of minor-unit digits of the currency."
                                    }
                                },
                                "required": [
                                    "amount_minor",
                                    "currency",
                                    "exponent"
                                ]
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "status": {
                        "type": "object",
                        "description": "Normalized statuses with the store's own wording beside each.",
                        "properties": {
                            "order": {
                                "type": "string",
                                "enum": [
                                    "open",
                                    "completed",
                                    "cancelled",
                                    "unknown"
                                ]
                            },
                            "order_raw": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "payment": {
                                "type": "string",
                                "enum": [
                                    "pending",
                                    "authorized",
                                    "paid",
                                    "partially_paid",
                                    "partially_refunded",
                                    "refunded",
                                    "voided",
                                    "failed",
                                    "unknown"
                                ]
                            },
                            "payment_raw": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "fulfillment": {
                                "type": "string",
                                "enum": [
                                    "unfulfilled",
                                    "partially_fulfilled",
                                    "fulfilled",
                                    "in_transit",
                                    "delivered",
                                    "returned",
                                    "not_provided",
                                    "unknown"
                                ]
                            },
                            "fulfillment_raw": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "payment_method": {
                        "type": "object",
                        "properties": {
                            "category": {
                                "type": "string"
                            },
                            "raw": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "customer": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "An erased customer is only its id and erased=true.",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "phone": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "E.164."
                            },
                            "erased": {
                                "type": "boolean"
                            },
                            "contact_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ],
                                "description": "Id of the linked contact, usable with GET /contacts/{id}."
                            },
                            "link_state": {
                                "type": "string",
                                "enum": [
                                    "linked",
                                    "no_match",
                                    "no_phone",
                                    "invalid_phone",
                                    "ambiguous"
                                ]
                            }
                        }
                    },
                    "order_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "test": {
                        "type": "boolean",
                        "description": "True for a test order placed in the store (never a real sale)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "cancelled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "closed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "flags": {
                        "type": "object",
                        "properties": {
                            "incomplete": {
                                "type": "boolean"
                            },
                            "items_truncated": {
                                "type": "boolean"
                            },
                            "source_items_incomplete": {
                                "type": [
                                    "boolean",
                                    "null"
                                ]
                            },
                            "needs_reconciliation": {
                                "type": "boolean"
                            }
                        }
                    }
                }
            }
        },
        "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
        }
    },
    "required": [
        "data",
        "meta"
    ]
}

Possible Error Codes: validation_failed (422) scope_missing (403) unauthenticated (401) rate_limited (429)

Retrieve a store order by ID. #

GET /api/v1/commerce/orders/{id}

Returns one order with its line items and fulfillments. An order that does not exist, was deleted in the store or belongs to another workspace answers 404.

scope: commerce:read

Response Schema
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "store": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "description": "Id of the store the order belongs to."
                },
                "number": {
                    "type": "string"
                },
                "currency": {
                    "type": "string"
                },
                "totals": {
                    "type": "object",
                    "properties": {
                        "subtotal": {
                            "type": "object",
                            "properties": {
                                "amount_minor": {
                                    "type": "integer",
                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                },
                                "currency": {
                                    "type": "string",
                                    "description": "ISO 4217 code."
                                },
                                "exponent": {
                                    "type": "integer",
                                    "description": "Number of minor-unit digits of the currency."
                                }
                            },
                            "required": [
                                "amount_minor",
                                "currency",
                                "exponent"
                            ]
                        },
                        "discount": {
                            "type": "object",
                            "properties": {
                                "amount_minor": {
                                    "type": "integer",
                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                },
                                "currency": {
                                    "type": "string",
                                    "description": "ISO 4217 code."
                                },
                                "exponent": {
                                    "type": "integer",
                                    "description": "Number of minor-unit digits of the currency."
                                }
                            },
                            "required": [
                                "amount_minor",
                                "currency",
                                "exponent"
                            ]
                        },
                        "shipping": {
                            "type": "object",
                            "properties": {
                                "amount_minor": {
                                    "type": "integer",
                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                },
                                "currency": {
                                    "type": "string",
                                    "description": "ISO 4217 code."
                                },
                                "exponent": {
                                    "type": "integer",
                                    "description": "Number of minor-unit digits of the currency."
                                }
                            },
                            "required": [
                                "amount_minor",
                                "currency",
                                "exponent"
                            ]
                        },
                        "tax": {
                            "type": "object",
                            "properties": {
                                "amount_minor": {
                                    "type": "integer",
                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                },
                                "currency": {
                                    "type": "string",
                                    "description": "ISO 4217 code."
                                },
                                "exponent": {
                                    "type": "integer",
                                    "description": "Number of minor-unit digits of the currency."
                                }
                            },
                            "required": [
                                "amount_minor",
                                "currency",
                                "exponent"
                            ]
                        },
                        "total": {
                            "type": "object",
                            "properties": {
                                "amount_minor": {
                                    "type": "integer",
                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                },
                                "currency": {
                                    "type": "string",
                                    "description": "ISO 4217 code."
                                },
                                "exponent": {
                                    "type": "integer",
                                    "description": "Number of minor-unit digits of the currency."
                                }
                            },
                            "required": [
                                "amount_minor",
                                "currency",
                                "exponent"
                            ]
                        },
                        "original_total": {
                            "oneOf": [
                                {
                                    "type": "object",
                                    "properties": {
                                        "amount_minor": {
                                            "type": "integer",
                                            "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                        },
                                        "currency": {
                                            "type": "string",
                                            "description": "ISO 4217 code."
                                        },
                                        "exponent": {
                                            "type": "integer",
                                            "description": "Number of minor-unit digits of the currency."
                                        }
                                    },
                                    "required": [
                                        "amount_minor",
                                        "currency",
                                        "exponent"
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "refunded_total": {
                            "oneOf": [
                                {
                                    "type": "object",
                                    "properties": {
                                        "amount_minor": {
                                            "type": "integer",
                                            "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                        },
                                        "currency": {
                                            "type": "string",
                                            "description": "ISO 4217 code."
                                        },
                                        "exponent": {
                                            "type": "integer",
                                            "description": "Number of minor-unit digits of the currency."
                                        }
                                    },
                                    "required": [
                                        "amount_minor",
                                        "currency",
                                        "exponent"
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        }
                    }
                },
                "presentment_total": {
                    "oneOf": [
                        {
                            "type": "object",
                            "properties": {
                                "amount_minor": {
                                    "type": "integer",
                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                },
                                "currency": {
                                    "type": "string",
                                    "description": "ISO 4217 code."
                                },
                                "exponent": {
                                    "type": "integer",
                                    "description": "Number of minor-unit digits of the currency."
                                }
                            },
                            "required": [
                                "amount_minor",
                                "currency",
                                "exponent"
                            ]
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "presentment_original_total": {
                    "oneOf": [
                        {
                            "type": "object",
                            "properties": {
                                "amount_minor": {
                                    "type": "integer",
                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                },
                                "currency": {
                                    "type": "string",
                                    "description": "ISO 4217 code."
                                },
                                "exponent": {
                                    "type": "integer",
                                    "description": "Number of minor-unit digits of the currency."
                                }
                            },
                            "required": [
                                "amount_minor",
                                "currency",
                                "exponent"
                            ]
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "presentment_refunded_total": {
                    "oneOf": [
                        {
                            "type": "object",
                            "properties": {
                                "amount_minor": {
                                    "type": "integer",
                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                },
                                "currency": {
                                    "type": "string",
                                    "description": "ISO 4217 code."
                                },
                                "exponent": {
                                    "type": "integer",
                                    "description": "Number of minor-unit digits of the currency."
                                }
                            },
                            "required": [
                                "amount_minor",
                                "currency",
                                "exponent"
                            ]
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "status": {
                    "type": "object",
                    "description": "Normalized statuses with the store's own wording beside each.",
                    "properties": {
                        "order": {
                            "type": "string",
                            "enum": [
                                "open",
                                "completed",
                                "cancelled",
                                "unknown"
                            ]
                        },
                        "order_raw": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "payment": {
                            "type": "string",
                            "enum": [
                                "pending",
                                "authorized",
                                "paid",
                                "partially_paid",
                                "partially_refunded",
                                "refunded",
                                "voided",
                                "failed",
                                "unknown"
                            ]
                        },
                        "payment_raw": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "fulfillment": {
                            "type": "string",
                            "enum": [
                                "unfulfilled",
                                "partially_fulfilled",
                                "fulfilled",
                                "in_transit",
                                "delivered",
                                "returned",
                                "not_provided",
                                "unknown"
                            ]
                        },
                        "fulfillment_raw": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    }
                },
                "payment_method": {
                    "type": "object",
                    "properties": {
                        "category": {
                            "type": "string"
                        },
                        "raw": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    }
                },
                "customer": {
                    "type": [
                        "object",
                        "null"
                    ],
                    "description": "An erased customer is only its id and erased=true.",
                    "properties": {
                        "id": {
                            "type": "string"
                        },
                        "name": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "phone": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "description": "E.164."
                        },
                        "erased": {
                            "type": "boolean"
                        },
                        "contact_id": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "description": "Id of the linked contact, usable with GET /contacts/{id}."
                        },
                        "link_state": {
                            "type": "string",
                            "enum": [
                                "linked",
                                "no_match",
                                "no_phone",
                                "invalid_phone",
                                "ambiguous"
                            ]
                        }
                    }
                },
                "order_url": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "test": {
                    "type": "boolean",
                    "description": "True for a test order placed in the store (never a real sale)."
                },
                "created_at": {
                    "type": "string",
                    "format": "date-time"
                },
                "updated_at": {
                    "type": "string",
                    "format": "date-time"
                },
                "cancelled_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "closed_at": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "date-time"
                },
                "flags": {
                    "type": "object",
                    "properties": {
                        "incomplete": {
                            "type": "boolean"
                        },
                        "items_truncated": {
                            "type": "boolean"
                        },
                        "source_items_incomplete": {
                            "type": [
                                "boolean",
                                "null"
                            ]
                        },
                        "needs_reconciliation": {
                            "type": "boolean"
                        }
                    }
                },
                "items": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "title": {
                                "type": "string"
                            },
                            "variant_title": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "sku": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "quantity": {
                                "type": "integer"
                            },
                            "current_quantity": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "unit_price": {
                                "type": "object",
                                "properties": {
                                    "amount_minor": {
                                        "type": "integer",
                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                    },
                                    "currency": {
                                        "type": "string",
                                        "description": "ISO 4217 code."
                                    },
                                    "exponent": {
                                        "type": "integer",
                                        "description": "Number of minor-unit digits of the currency."
                                    }
                                },
                                "required": [
                                    "amount_minor",
                                    "currency",
                                    "exponent"
                                ]
                            },
                            "line_total": {
                                "type": "object",
                                "properties": {
                                    "amount_minor": {
                                        "type": "integer",
                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                    },
                                    "currency": {
                                        "type": "string",
                                        "description": "ISO 4217 code."
                                    },
                                    "exponent": {
                                        "type": "integer",
                                        "description": "Number of minor-unit digits of the currency."
                                    }
                                },
                                "required": [
                                    "amount_minor",
                                    "currency",
                                    "exponent"
                                ]
                            }
                        }
                    }
                },
                "fulfillments": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "string"
                            },
                            "status_raw": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "carrier": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "tracking_numbers": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "tracking_urls": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "required": [
        "data"
    ]
}

Possible Error Codes: not_found (404) scope_missing (403) unauthenticated (401) rate_limited (429)

Download OpenAPI 3.1 machine-readable specification. #

GET /api/v1/openapi.json

Fetch the full OpenAPI 3.1 JSON specification describing all Public API endpoints, schemas, and error codes.

Public

Response Schema
{
    "type": "object",
    "description": "OpenAPI 3.1 specification document."
}

Events & Automation #

Webhook endpoints receive real-time event deliveries. Each envelope carries id, type, occurred_at, api_version, workspace, an origin block (surface, connection_id, api_key_id, correlation_id), and data with a data.resource pointer. For signature verification, retry rules, and payload samples, see the Webhooks reference.

Event Read scope for automations Emitted when
contact.created contacts:read A contact is created from the app, the API, or a first inbound message.
contact.updated contacts:read A single contact changes; data.changed_fields lists what changed.
message.read — A customer reads an outbound message (read receipt).
message.delivered — An outbound message is delivered to the recipient device.
message.inbound messages:read A customer message is received (bounded preview, never media or history).
conversation.new conversations:read A new conversation starts.
conversation.assigned conversations:read A conversation is claimed, assigned, handed off, or released (data.action).
conversation.closed conversations:read Every conversation that is closed, including each one closed by a bulk close.
template.status_changed — A message template approval status changes (approved, rejected, paused).
system.error — A system or service failure occurs in the workspace.
subscription.gate_transition — The workspace subscription tier or feature gating changes.

At-least-once delivery

Deduplicate by the envelope id; it is stable for one occurrence. An event can arrive late, within 24 hours of the change. Notifications that could not be delivered within 24 hours are dropped and never replayed, so an outage or suspension can cause missed or stale automations.

Integration-owned subscriptions

A key issued to a Make or Zapier connection subscribes through POST /api/v1/webhook-endpoints: one event, an immutable URL, an idempotent subscribe for the same URL and event, and removal with DELETE. A connection sees only its own subscriptions; member-created endpoints keep their own queue, retries and behaviour.

Loop protection

contact.updated for a change made by the subscribing connection is not delivered while ignore_own_changes is true (the default). A contact that changes more than 10 times a minute for one subscription is suppressed and the connection is flagged for attention.

What emits

Single-contact create, edit, tag, consent, number and archive changes emit contact events. Imports, audience uploads, bulk tagging, history import and coexistence sync emit nothing. A no-op change emits nothing. Events never send a message, change consent or start a flow.

Change: bulk close

Closing several conversations at once sends one conversation.closed for each conversation that was closed, each with its own conversation_id and event id. Before, one event was sent with conversation_id 0. An endpoint that relied on that single aggregate event should handle one event per conversation instead.