Migration from Channels v1 to Auths v2

Move from API v1 Channels to API v2 Auths and auth webhooks

API v1 Channels are being replaced by API v2 Auths. An auth is the v2 name for a connected messaging provider (WhatsApp, Telegram, VK, and others).

This guide helps you switch integrations that create, list, update, or delete channels — and that listen for channel-related webhooks.

What changes

The entity is the same — connected messaging accounts. What changes is the API:

WhatAPI v1API v2
Base URLhttps://api.pact.im/p1/...https://api.pact.im/api/p2/...
Channel webhooksData with entity: "channel", type: "qr_code", and similar fields — see Webhooks v1Unified format with "type": "auth" and "event": "create" | "update" | "delete" — see Auth events
How to confirm a channelrequest_code / confirm methods and webhook data (QR, etc.)Confirm auth (QR, code, or OAuth) and Enable auth when needed
Channel API methods/p1/companies/:company_id/channels/.../api/p2/companies/:company_id/auths/... — see Auths

Token auth still uses your private API token. In v2 you typically pass private_api_token as a query or body parameter — see Authentication.

Endpoint mapping

ActionAPI v1 (Channels)API v2 (Auths)
ListGET /p1/companies/:company_id/channelsGet company authsGET /api/p2/companies/:company_id/auths
Create / connectPOST /p1/companies/:company_id/channelsCreate authPOST /api/p2/companies/:company_id/auths
Confirm (code / enable)POST .../channels/:id/request_code, POST .../channels/:id/confirmConfirm auth and Enable auth
Disable / pauseDisable auth
Re-enableEnable auth
DeleteDELETE /p1/companies/:company_id/channels/:idDelete auth
List across companiesGet auths (multi-company)

Provider-specific create parameters (token, phone number, sync period, and so on) are documented on Create auth.

Confirmation flows (QR, code, OAuth)

In v1, confirmation was spread across channel create, request_code, confirm, and webhook payloads (for example QR codes).

In v2:

  1. Create auth for the provider.
  2. Complete the flow described in Confirm auth:
    • QR — WhatsApp, Telegram Personal, MAX (qr in the response and in webhooks)
    • Code — WhatsApp / Telegram Personal when phone_number is provided
    • OAuth — Facebook, VK, Instagram Business, WhatsApp Business, Avito (oauth_provider_url)
  3. Use Enable auth when the provider requires a verification code (for example Telegram Personal code flow).

Migrating webhooks

v1 channel lifecycle events used payloads with entity: "channel", type: "qr_code", and similar shapes under v1 Webhooks.

v2 delivers a single envelope with "type": "auth" and "event": "create" | "update" | "delete". Full payloads and meanings are in Auth events.

Situationv2 auth event
Auth createdevent: create
Connected / readyevent: update with state: enabled
Disconnectedevent: update with state: disabled
Deletedevent: delete
QR refresh, pages list, OAuth progressevent: update (see auth-events examples)

Checklist for webhook handlers

  1. Register or update a company webhook URL with Company webhooks (if you are not already receiving v2 events).
  2. Accept the v2 envelope: event, type, object.
  3. When type === "auth", read provider state from object (and pages / qr / oauth_provider_url when present).
  4. Stop relying on v1-only fields such as channel_id, channel_type, or entity: "channel" for new logic.
  5. Keep v1 handlers only while you still have traffic on the old API; plan to turn them off after cutover.

Suggested migration steps

  1. Read the v2 Auths overviewAuths and the Auth object.
  2. Map your calls — replace each Channels endpoint you use with the matching Auths method above.
  3. Update create + confirm — follow Create auth and Confirm auth for each provider you support.
  4. Switch webhooks — implement handling for Auth events; verify create / connect / disconnect / delete in a staging company.
  5. Smoke-test — list auths, create one test auth, complete confirmation, confirm webhooks, then delete or disable the test auth.
  6. Cut over — point production traffic to v2; remove v1 Channels usage when ready.

Search…

Start typing to search