Wapiworld API 1.0.0
Public REST API for Wapiworld — WhatsApp API as a service. Authenticate with an API key created in the Wapiworld dashboard: send the base64-encoded key secret with HTTP Basic auth. Each key is scoped to a single project and carries per-resource scopes like instances:read or instances:write.
https://api.wapiworld.com
apiKey— HTTP Basic auth carrying only the API key secret:Authorization: Basic base64(<key secret>).accessToken— Operator session token issued by the Wapiworld dashboard:Authorization: Token <access token>.
Instances
GET/api/instances
List WhatsApp instances
Lists the WhatsApp instances of your organization. An API key is scoped to a single project and only sees that project's instances. Requires the instances:read scope.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId |
query | string | |
fields |
query | string | Comma-separated projection of fields to return |
limit |
query | integer | Optional page size, capped at 500 |
skip |
query | integer | Optional zero-based page offset |
Responses
| Status | Meaning |
|---|---|
200 | Array of instances |
401 | Missing or invalid credentials |
403 | API key is missing the instances:read scope |
429 | API key rate limit exceeded |
POST/api/instances
Create a WhatsApp instance
Creates a new WhatsApp instance in your project. A caller-supplied _id, whether in the body or instanceId query, requires a stable Idempotency-Key; retrying the same create (including the same write-only webhook signing secret) returns the same resource, while reusing either identity for a different intent returns 409. The first accepted command pins its runtime backend, so an exact retry resumes the same command even if a deployment gate changed meanwhile. Keyed creates reserve the resource in stopped state and must be started with the reconnect action after the caller durably stores the returned id. Unkeyed legacy creates retain their historical auto-start behavior. Requires the instances:write scope and emits instance.created.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key |
header | string | Stable 16-128 character key. Required when the request body supplies _id or the query supplies instanceId; recommended for every automated create. |
Wapiworld-Required-Create-Backend-Protocol |
header | string durable-generation-v1 | legacy-direct-v1 | Fail before reservation unless the selected create backend exactly matches this protocol |
instanceId |
query | string | Optional caller-supplied 24-character lowercase hex resource id |
Responses
| Status | Meaning |
|---|---|
200 | The created or exactly replayed instance |
401 | Missing or invalid credentials |
403 | API key is missing the instances:write scope |
409 | The identity/key conflicts, a legacy effect lease is retryably busy, or runtime capacity is full |
429 | API key rate limit exceeded |
503 | The explicitly required create backend is not currently selected |
GET/api/instances/{instanceId}
Get a WhatsApp instance
Returns a single instance by id. Requires the instances:read scope. Answers 404 when the instance belongs to another organization or project.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
instanceId required |
path | string |
Responses
| Status | Meaning |
|---|---|
200 | The instance |
401 | Missing or invalid credentials |
403 | API key is missing the instances:read scope |
404 | Instance not found |
429 | API key rate limit exceeded |
PUT/api/instances/{instanceId}
Update a WhatsApp instance
Updates an existing instance. A body containing webhookSigningSecret is always an atomic durable configuration command and requires a stable Idempotency-Key. Its exact public patch and write-only secret may be replayed until the returned configurationOperation reaches completed; changing that intent for the same key returns 409. Requires the instances:write scope. May emit instance.connected / instance.disconnected on a status transition.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
instanceId required |
path | string | |
Idempotency-Key |
header | string | Required for a body containing webhookSigningSecret; stable 16-128 character operation key |
Responses
| Status | Meaning |
|---|---|
200 | The updated instance and completed configuration operation, or an ordinary synchronous update |
202 | The atomic configuration command is accepted and awaiting exact runtime acknowledgement |
403 | API key is missing the instances:write scope |
409 | The idempotency key conflicts or the operation was superseded |
429 | API key rate limit exceeded |
DELETE/api/instances/{instanceId}
Delete a WhatsApp instance
Durably requests logout, provider-state purge, and deletion. Repeat the same DELETE to poll the intrinsic delete:{instanceId} operation; 202 is pending and 200 includes the immutable completion event. Requires the instances:write scope and emits instance.deleted exactly once. Answers 404 for an instance in another organization or project.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
instanceId required |
path | string |
Responses
| Status | Meaning |
|---|---|
200 | Deletion completed; response includes the stable operation and event |
202 | Deletion was durably accepted and is still pending |
403 | API key is missing the instances:write scope |
404 | Instance not found |
409 | A transitional create external effect is still in flight; retry without changing intent |
429 | API key rate limit exceeded |
POST/api/instances/{instanceId}/action/send-message-idempotent
Send a WhatsApp message with a durable idempotency key
Requires one stable Idempotency-Key and the instances:write scope. Reuse the key only for the exact same instance, normalized chat, and content. An exact retry reuses one deterministic WhatsApp message id; changed intent returns 409. The unversioned send-message action is legacy and rejects every Idempotency-Key.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
instanceId required |
path | string | |
Idempotency-Key required |
header | string | Required exactly once; retries of one command must reuse the exact value |
Responses
| Status | Meaning |
|---|---|
200 | The action result from the instance |
400 | The Idempotency-Key is present but invalid |
403 | API key is missing the instances:write scope |
404 | Instance not found |
409 | The key conflicts or the WhatsApp account is not currently connected |
422 | WhatsApp could not address the recipient; no provider message was attempted |
429 | API key rate limit exceeded |
503 | The keyed-send protocol, recipient lookup, or durable outcome is unavailable; retry the exact command and key |
504 | The send timed out with an ambiguous outcome; retry the exact command and key |
POST/api/instances/{instanceId}/action/{action}
Perform a legacy or non-send action on a WhatsApp instance
Drives actions such as logout, reconnect, and the legacy unkeyed send-message. Every Idempotency-Key is rejected on this route. Use the exact send-message-idempotent path for durable keyed sends.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
instanceId required |
path | string | |
action required |
path | string |
Responses
| Status | Meaning |
|---|---|
200 | The action result from the instance |
202 | A reconnect was durably accepted for background reconciliation |
400 | An Idempotency-Key was supplied to a legacy or non-send action |
403 | API key is missing the instances:write scope |
404 | Instance not found |
409 | Reconnect capacity is unavailable or the WhatsApp account is not currently connected |
422 | A legacy send could not address the recipient; no provider message was attempted |
429 | API key rate limit exceeded |
502 | The instance action could not be completed |
503 | A retryable recipient lookup is unavailable before a legacy provider message attempt |
Messages
GET/api/messages
List recorded WhatsApp messages
Reads the recorded messages of one instance, optionally filtered by chat. Message recording is opt-in per instance and TTL-expired. Requires the messages:read scope.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
instanceId required |
query | string | |
chatId |
query | string | |
startTime |
query | string | |
endTime |
query | string | |
limit |
query | integer default 100 | |
skip |
query | integer default 0 |
Responses
| Status | Meaning |
|---|---|
200 | Array of recorded messages |
401 | Missing or invalid credentials |
403 | API key is missing the messages:read scope |
429 | API key rate limit exceeded |
Projects
GET/api/projects
List projects
Lists your organization's projects. An API key is scoped to a single project and returns only that one. Requires the projects:read scope.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fields |
query | string | Optional comma-separated top-level fields to return |
Responses
| Status | Meaning |
|---|---|
200 | Array of projects |
401 | Missing or invalid credentials |
403 | API key is missing the projects:read scope |
429 | API key rate limit exceeded |
GET/api/projects/{projectId}
Get a project
Returns a single project by id. Requires the projects:read scope. Answers 404 for a project in another organization, or for a project-scoped key asking for a different project.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required |
path | string |
Responses
| Status | Meaning |
|---|---|
200 | The project |
403 | API key is missing the projects:read scope |
404 | Project not found |
429 | API key rate limit exceeded |
Webhook subscriptions
GET/api/webhooksubscriptions
List webhook subscriptions
Webhook subscriptions deliver instance.created, instance.connected, instance.disconnected and instance.deleted events to your server as signed POST requests (X-Wapiworld-Signature: t=<timestamp>,v1=<hex HMAC-SHA256 of "timestamp.body">). An endpoint failing 20 times in a row is disabled automatically. Subscriptions are managed with an operator access token. Responses contain only the reviewed public subscription fields; the secret is returned once, on create.
Responses
| Status | Meaning |
|---|---|
200 | Array of webhook subscriptions (without secrets) |
POST/api/webhooksubscriptions
Create a webhook subscription
The response includes the signing secret exactly once — store it; it cannot be retrieved again.
Request body application/json
| Field | Type | Description |
|---|---|---|
projectId required |
string | |
url required |
string | |
events |
array | Empty array subscribes to all events |
deliveryVersion |
integer 1 | 2 | Version 1 is the legacy envelope; version 2 is the canonical CloudEvent |
Responses
| Status | Meaning |
|---|---|
200 | The created subscription, including its secret |
PUT/api/webhooksubscriptions/{webhookSubscriptionId}
Update a webhook subscription
url, events, deliveryVersion and active are editable; the secret and project are immutable. Re-enabling an auto-disabled endpoint is done by setting active back to true.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
webhookSubscriptionId required |
path | string |
Responses
| Status | Meaning |
|---|---|
200 | The updated subscription (without secret) |
DELETE/api/webhooksubscriptions/{webhookSubscriptionId}
Delete a webhook subscription
Parameters
| Name | In | Type | Description |
|---|---|---|---|
webhookSubscriptionId required |
path | string |
Responses
| Status | Meaning |
|---|---|
200 | Deleted |