v2

latestOpenAPI 3.1.0raw.githubusercontent.com2026-02-120617.5 KB
whatsapp_accounts

Triggered when a WhatsApp account is successfully connected for a workspace user.

postWebhookwhatsapp_account:connected

Headers

X-TL-Partner-Idstring required

The unique identifier for the partner.

X-TL-Signaturestring required

A JSON Web Token (JWT) signed with your Partner Secret using the HS256 algorithm. Use this header to verify that the webhook was genuinely sent by TimelinesAI.

The JWT contains the following claims: | Claim | Description | |-------|-------------| | partner_id | Your partner identifier — must match the X-TL-Partner-Id header | | nbf | Not-before timestamp (Unix epoch) | | exp | Expiration timestamp (Unix epoch) |

Verification steps:

  1. Extract the X-TL-Signature header value from the incoming request.
  2. Decode and verify the JWT using your Partner Secret with the HS256 algorithm.
  3. Confirm that the partner_id claim matches the X-TL-Partner-Id header.
  4. Reject the request if verification fails (invalid signature, expired token, or mismatched partner ID).

JavaScript example:

const jwt = require(''jsonwebtoken'');
function verifyWebhook(req) {
  const signature = req.headers[''x-tl-signature''];
  const partnerId = req.headers[''x-tl-partner-id''];
  try {
    const decoded = jwt.verify(signature, PARTNER_SECRET);
    return decoded.partner_id === partnerId;
  } catch (err) {
    return false;
  }
}

Python example:

import jwt
def verify_webhook(headers):
    signature = headers.get(''X-TL-Signature'')
    partner_id = headers.get(''X-TL-Partner-Id'')
    try:
        decoded = jwt.decode(signature, PARTNER_SECRET, algorithms=[''HS256''])
        return decoded[''partner_id''] == partner_id
    except jwt.InvalidTokenError:
        return False

See the PartnerAPI Webhooks Overview for more details.

Payload

workspace_idstring required

Identifier of the workspace where the WhatsApp account was connected / disconnected.

event_type'whatsapp_account:connected' | 'whatsapp_account:disconnected' required

Partner webhook event name.

partner_idstring required

Unique identifier of the partner that owns the workspace.

triggered_atstring date-time required

Timestamp when the event was triggered.

whatsapp_account_idinteger required

Internal WhatsApp account identifier.

phone_number_e164string required

Phone number associated with the WhatsApp account in E.164

user_idinteger required

Identifier of the user in the workspace who owns the WhatsApp

disconnected_atstring date-time
reasonstring

Example payload

{
  "workspace_id": "my-workspace",
  "event_type": "whatsapp_account:disconnected",
  "partner_id": "partner_12345",
  "triggered_at": "2024-01-01T12:00:00Z",
  "whatsapp_account_id": 67890,
  "phone_number_e164": "+123456789",
  "user_id": 98765,
  "disconnected_at": "2024-01-01T12:00:00Z",
  "reason": "(logged out)"
}

Response

Receiver accepted the event