WASync Account API
Slot quota and connection health for the token's workspace — check before provisioning another connection.
Slot quota and connection health for the token's workspace — check before provisioning another connection.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/wasync-app:wasync-app-account-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: WASync WhatsApp Platform Account API
version: 1.0.0
description: 'Send and receive WhatsApp from your app or AI agent — beyond Bitrix24.
The same WhatsApp connections WASync runs inside Bitrix24 CRM are exposed here as a REST API (and a remote MCP server at `https://cloudapi.wasync.app/api/mcp`).
**Auth — start with an API key.** Create one at https://developers.wasync.app/keys and send it as `Authorization: Bearer wsk_live_…`. That is the whole setup for a partner automating their OWN account: no redirect URI, no PKCE, no consent screen, no token refresh. Keys carry scopes and an optional IP allowlist, and are revocable from the same page.
**OAuth 2.0 is the other path**, for an app that OTHER WASync customers install: Authorization Code with **PKCE (S256 required)**, token endpoint `client_secret_post`, discovery at `https://cloudapi.wasync.app/.well-known/oauth-authorization-server`. Use it when a third party must consent to connections they own; use a key otherwise. Both credential types are accepted on every endpoint in this spec, in the same `Authorization: Bearer` header.
**Access gate:** only connections with an active licence / per-connection API add-on are visible and sendable. Pricing and activation: https://developers.wasync.app/billing
**Base URL.** The canonical host is `https://developers.wasync.app/api/v1`. The older `https://cloudapi.wasync.app/api/v1` is a permanent alias for the same API and remains valid indefinitely — existing integrations pointed at it need no change. (The OAuth endpoints, the `/.well-known/…` discovery documents and the MCP server URL are protocol identifiers already registered by clients: they stay on `cloudapi.wasync.app` and are unchanged.)
**Provisioning:** `POST /connections` (create + initial QR) → `GET /connections/{id}` (poll status/QR) → `POST /connections/{id}/pairing-code` (an 8-character code the customer types into WhatsApp instead of scanning — for the very common case where the phone running WhatsApp is the same device your flow is open on; **a code is not always available, so keep the QR flow as a fallback**) → `POST /connections/{id}/restart` (re-pair a broken session) → `POST /connections/{id}/logout` (clear credentials) → `DELETE /connections/{id}` (permanent). With an API key you can create a workspace''s very first connection over the API — nothing has to be clicked in a portal UI first. `GET /account` reports the slot quota before you provision.
**Webhooks:** set your endpoint with `PUT /webhook` and you get a signing secret back; rotate it with `POST /webhook/rotate`. Five event types are delivered: `message.received`, `message.status`, `connection.disconnected`, `connection.connected` and `message.transcribed` (a voice note''s transcript is ready — schema `MessageTranscribedEvent`). The first four fire for **QR/WAPP connections (`provider: qr`) only** — Meta/WABA connections (`provider: cloud_api`) emit no message webhooks today; poll `GET /messages` and `GET /connections/{id}` for those. `message.transcribed` fires on every connection whose portal has voice-note transcription on. An endpoint configured before an event type existed receives it after `PUT /webhook` is called again. Disconnect detection is typically **≤ 5 minutes** (status probe) and can take **~15–20 minutes** on the restart-failure path. Full contract: https://developers.wasync.app/docs/webhooks
Quickstart: https://developers.wasync.app/docs'
contact:
name: WASync Developers
url: https://developers.wasync.app/docs
servers:
- url: https://developers.wasync.app/api/v1
description: Production REST v1 (canonical host)
- url: https://cloudapi.wasync.app/api/v1
description: Production REST v1 — legacy alias. Identical API, kept working indefinitely; existing integrations need no change.
security:
- apiKey: []
- oauth2:
- whatsapp.read
tags:
- name: Account
description: Slot quota and connection health for the token's workspace — check before provisioning another connection.
paths:
/account:
get:
tags:
- Account
summary: Slot quota and connection health
description: 'Answers "can I onboard another connection right now?" before you take the order. Everything is scoped to the token''s workspace — there is no way to ask about another one.
`slots.available` is what `POST /connections` can still consume with an active licence; `slots.nextExpiry` is the date you must renew before, so a slot never expires underneath a customer who already paid. `connections.needsReconnect` counts numbers waiting for their owner to scan a fresh QR (the same state that fires the `connection.disconnected` webhook).
**A slot is capacity, not a phone number** and not something you bind to a customer: it attaches when a number actually pairs, and deleting a connection returns its slot to the pool carrying whatever time is left on it, ready for the next number you connect. Map WASync''s connection `id` (a stable cuid, echoed by every REST response and by `connection_id` on every webhook) to your own customer record — we mint the id, you map it. Do not try to track slots per customer; track connections.'
operationId: getAccount
security:
- apiKey: []
- oauth2:
- whatsapp.read
responses:
'200':
description: Slot quota and connection health for the token's workspace.
content:
application/json:
schema:
$ref: '#/components/schemas/AccountResponse'
example:
slots:
total: 10
used: 7
available: 3
nextExpiry: '2026-09-01T00:00:00.000Z'
connections:
total: 7
connected: 6
needsReconnect: 1
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/ServerError'
components:
responses:
Forbidden:
description: '`insufficient_scope` — the credential lacks the scope this operation requires.
`ip_not_allowed` — the API key has an IP allowlist and the calling address is not on it (or could not be determined). The key itself is valid: add the address on https://developers.wasync.app/keys, which is reachable from anywhere because it is authenticated by your account and not by the key.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
insufficient_scope:
value:
error: insufficient_scope
ip_not_allowed:
value:
error: ip_not_allowed
Unauthorized:
description: 'Missing or invalid credential. Carries a `WWW-Authenticate: Bearer` challenge.
`invalid_key` — the API key is unknown or has been revoked (create a new one at https://developers.wasync.app/keys).
`invalid_token` — the OAuth access token is expired or malformed (refresh once, then retry).
`invalid_grant` — the OAuth grant was revoked; re-authorize from scratch.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
missing_token:
value:
error: missing_token
invalid_key:
value:
error: invalid_key
invalid_token:
value:
error: invalid_token
ServerError:
description: Unexpected server error.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: server_error
schemas:
Error:
type: object
required:
- error
description: All errors carry a stable `error` code. On 400 `invalid_request`, the optional `field` and `hint` properties identify the specific failing input. Branch on `error`; treat `field`/`hint` as informational.
properties:
error:
type: string
description: A stable, machine-readable error code. Never branch on human-readable text.
field:
type: string
description: 'On 400 `invalid_request`: the name of the request body field that failed validation (e.g. `connectionId`, `to`, `text`). Additive — present only when the server knows the exact failing field.'
example: connectionId
hint:
type: string
description: 'On 400 `invalid_request`: a short human-readable tip about what to fix. Additive — may be absent.'
example: expected string; did you send `connection` instead of `connectionId`?
AccountResponse:
type: object
required:
- slots
- connections
description: Slot quota and connection health for the token's workspace. camelCase, like the rest of v1.
properties:
slots:
type: object
required:
- total
- used
- available
- nextExpiry
properties:
total:
type: integer
description: Connection slots the workspace holds in total.
example: 10
used:
type: integer
description: Slots already consumed by existing connections.
example: 7
available:
type: integer
description: Slots you can still fill with `POST /connections` and have the connection come up licensed.
example: 3
nextExpiry:
type:
- string
- 'null'
format: date-time
description: When the next slot expires — renew before this date so a slot never lapses underneath a paying customer. `null` when nothing is due to expire.
example: '2026-09-01T00:00:00.000Z'
connections:
type: object
required:
- total
- connected
- needsReconnect
properties:
total:
type: integer
description: Connections in the workspace.
example: 7
connected:
type: integer
description: Currently live sessions.
example: 6
needsReconnect:
type: integer
description: Numbers waiting for their owner to scan a fresh QR — the same state that fires `connection.disconnected`.
example: 1
securitySchemes:
apiKey:
type: http
scheme: bearer
bearerFormat: wsk_live_*
description: '**The default way to authenticate.** Create a key at https://developers.wasync.app/keys and send it as `Authorization: Bearer wsk_live_…`.
The key is shown once at creation and stored only as a hash — lose it and you revoke it and create another. Each key carries its own scopes (`whatsapp.read`, `whatsapp.send`, `whatsapp.events`, `whatsapp.manage`) and an optional **IP allowlist**.
Errors: an unknown or revoked key returns **401 `invalid_key`**; a key whose IP allowlist does not cover the calling address returns **403 `ip_not_allowed`** (a distinct code on purpose — the key is fine, the address is not). Both carry a `WWW-Authenticate: Bearer` challenge. Scopes and the connection list are resolved live on every request, so revoking a key or narrowing it takes effect on the next call.'
oauth2:
type: oauth2
description: 'OAuth 2.0 Authorization Code flow — **for apps that other WASync customers install**, where a third party must consent to connections they own. If you are automating your own account, use an API key instead (see `apiKey`).
**PKCE with `S256` is required.** The token endpoint uses **`client_secret_post`** (send `client_id` + `client_secret` + `code_verifier` in the form body). Consent happens either in the connection owner''s Bitrix portal (Settings → "API & Agents": the admin enters the short code shown during authorization and picks the connections + scopes) or, for standalone workspaces, at https://developers.wasync.app/authorize.
`access_token` TTL is 15 minutes; `refresh_token` TTL is 30 days and ROTATES on use — persist the new one atomically and never refresh concurrently.'
flows:
authorizationCode:
authorizationUrl: https://cloudapi.wasync.app/oauth/authorize
tokenUrl: https://cloudapi.wasync.app/oauth/token
refreshUrl: https://cloudapi.wasync.app/oauth/token
scopes:
whatsapp.read: Read connections and messages
whatsapp.send: Send WhatsApp messages (text and media)
whatsapp.events: Receive incoming messages via webhooks
whatsapp.manage: Create, inspect, restart, log out, and delete WhatsApp connections