WASync Webhook API

Point WASync at your endpoint and manage the signing secret. Self-service — no app, no consent step.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 3

GET /webhook Read the webhook configuration #
PUT /webhook Set the webhook endpoint #
POST /webhook/rotate Rotate the webhook signing secret #

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/wasync-app:wasync-app-webhook-api"
All apis
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.

Get an API 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 Specification

wasync-app-webhook-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: WASync WhatsApp Platform Webhook 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: Webhook
  description: Point WASync at your endpoint and manage the signing secret. Self-service — no app, no consent step.
paths:
  /webhook:
    get:
      tags:
      - Webhook
      summary: Read the webhook configuration
      description: 'Returns the endpoint URL, the event types delivered to it, and whether a signing secret is set.


        **The secret is never returned here.** A read is routinely logged, cached and pasted into support tickets; a secret that leaks through it is a secret you cannot reason about. If you lost yours, rotate it — which is what you would have to do after a leak anyway.'
      operationId: getWebhook
      security:
      - apiKey: []
      - oauth2:
        - whatsapp.events
      responses:
        '200':
          description: The workspace's webhook configuration.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookConfig'
              example:
                url: https://example.com/wasync/webhook
                events:
                - message.received
                - message.status
                - connection.disconnected
                - connection.connected
                - message.transcribed
                secretSet: true
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
    put:
      tags:
      - Webhook
      summary: Set the webhook endpoint
      description: 'Points WASync at your URL and returns the signing secret for it. Idempotent — calling it again with a different URL moves the endpoint.


        The URL must be HTTPS on a publicly reachable host; http, localhost and private ranges are rejected with 400 `invalid_webhook`.


        Signature scheme (unchanged): every delivery carries `X-WASync-Signature: sha256=` = HMAC-SHA256 of `${X-WASync-Timestamp}.${rawBody}` keyed with this secret. `X-WASync-Timestamp` is epoch milliseconds; reject anything older than 5 minutes. Verify over the RAW body, before parsing. Full contract: https://developers.wasync.app/docs/webhooks'
      operationId: setWebhook
      security:
      - apiKey: []
      - oauth2:
        - whatsapp.events
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetWebhookRequest'
            example:
              url: https://example.com/wasync/webhook
      responses:
        '200':
          description: Endpoint set. The response carries the signing secret — store it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetWebhookResponse'
              example:
                url: https://example.com/wasync/webhook
                events:
                - message.received
                - message.status
                - connection.disconnected
                - connection.connected
                - message.transcribed
                secret: whsec_3f9a…
        '400':
          description: The URL is missing, or not HTTPS on a public host.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_request:
                  value:
                    error: invalid_request
                    field: url
                invalid_webhook:
                  value:
                    error: invalid_webhook
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
  /webhook/rotate:
    post:
      tags:
      - Webhook
      summary: Rotate the webhook signing secret
      description: 'Issues a new signing secret and invalidates the old one immediately — there is no overlap window. Deploy the new secret to your receiver promptly; the retry policy (3 attempts with exponential backoff) covers a rollout measured in seconds, not hours.


        Signature scheme (unchanged): every delivery carries `X-WASync-Signature: sha256=` = HMAC-SHA256 of `${X-WASync-Timestamp}.${rawBody}` keyed with this secret. `X-WASync-Timestamp` is epoch milliseconds; reject anything older than 5 minutes. Verify over the RAW body, before parsing. Full contract: https://developers.wasync.app/docs/webhooks'
      operationId: rotateWebhookSecret
      security:
      - apiKey: []
      - oauth2:
        - whatsapp.events
      responses:
        '200':
          description: A new signing secret.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RotateWebhookResponse'
              example:
                secret: whsec_7c21…
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    RotateWebhookResponse:
      type: object
      properties:
        secret:
          type: string
          description: The new signing secret. The previous one stops working immediately.
    WebhookConfig:
      type: object
      properties:
        url:
          type:
          - string
          - 'null'
          format: uri
          description: The endpoint WASync POSTs to, or null when none is set.
          example: https://example.com/wasync/webhook
        events:
          type: array
          items:
            type: string
          description: Event types delivered to this endpoint.
          example:
          - message.received
          - message.status
          - connection.disconnected
          - connection.connected
          - message.transcribed
        secretSet:
          type: boolean
          description: Whether a signing secret exists. The secret itself is NEVER returned by this endpoint — it is issued by `PUT /webhook` and re-issued by `POST /webhook/rotate`.
    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`?
    SetWebhookResponse:
      type: object
      properties:
        url:
          type:
          - string
          - 'null'
          format: uri
        events:
          type: array
          items:
            type: string
        secret:
          type:
          - string
          - 'null'
          description: The signing secret for this endpoint. Returned HERE because this is the moment it is issued and the moment you need it to write your verification code. Store it — `GET /webhook` will not return it again.
    SetWebhookRequest:
      type: object
      required:
      - url
      properties:
        url:
          type: string
          format: uri
          description: HTTPS URL on a publicly reachable host. http://, localhost and private ranges are rejected.
          example: https://example.com/wasync/webhook
  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
  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