Skip to main content
WG Messaging Guides

Use a connection

Use this path when the workspace already has a WhatsApp number connected. Otherwise, register a connection first.

Find the sending numberโ€‹

From your backend, use a credential with connections:read:

curl "$WG_API_BASE_URL/partner/v1/connections" --header "Authorization: Bearer $WG_PARTNER_KEY"

Set these variables in your backend environment. Choose the intended connection from the response; do not assume the first entry is the correct sender.

IdentifierUse
connection_idConnection details, health and template management.
phone_number_idRequired sender selector when sending a message.
workspace_idWorkspace-specific lifecycle operations; must match the credential.

Store this mapping against your own customer/account records. Treat IDs as opaque strings.

Check readinessโ€‹

Read Connection details and Connection health. Confirm the connection is connected, inspect webhook subscription status, and resolve any reported readiness problem. Connection status alone is not proof of billing readiness or template approval.

Check marketing_messages_supported before depending on the dedicated marketing route. Do not treat its descriptive qualification label as a stable machine-readable status.

Reconnect the same numberโ€‹

When the sender needs renewed authorization, keep its saved connection_id and phone_number_id. Ask the user to select the same number and WhatsApp Business Account (WABA) during authorization.

  1. Use a backend credential with connections:manage. Create a session with purpose: "reconnect", the stored connection_id, the configured HTTPS callback and an idempotency key.
  2. For a hosted handoff, confirm the deployed reconnect flow with the platform team and read the session after the user returns. For a self-hosted Meta login, submit the fresh code, session ID and stored expected_phone_number_id to Reconnect from your backend with its own idempotency key.
  3. Read the session. After a successful exchange it reaches completed. Confirm the same connection now reports connected. A phone or WABA mismatch ends the session in failed. Read the failure details and use a fresh reconnect session to select the original sender. PIN recovery and partial registration apply to new-number signup only.

To add a different sender, register a new connection. Disconnect is a separate operation that affects queued work for that number.

Continue with Billing readiness and Prepare a template.