Before you start, take the dashboard steps in Partner API: partner profile, redirect origins and partner key.
1. Create the customer project
POST /v1/partner/projects creates the project. Required scope: projects:write.
external_ref is your ID for the customer. It has 1 to 128 characters among A-Z a-z 0-9 . _ : -, with no spaces. Never use an email address, a phone number or a name. It is unique in the organization and does not change once set.
Repeating the call, on a retry or a second click, returns the same project: 201 the first time and 200 after that. On a 200 response, the name you sent is ignored. In the SDK, created tells you which of the two happened.
If the plan reached its project limit, the response is 402 project_limit_exceeded, with the limit in error.details.limit. Creating the project is optional: the first signed link also creates it.
2. Issue the project API key
POST /v1/partner/projects/{project_id}/api_keys issues the key the customer’s traffic uses. Required scope: api_keys:write.
expires_at and ip_allowlist when it makes sense. See API key scopes.
3. Sign the link and open it
The customer connects their number on a Routa page, opened through a link you sign. Sign the link when the customer clicks, because it is valid for 10 minutes.Node.js
window.open, from your page, or in a new tab. The page that opens belongs to Routa and then shows the provider’s connection screen. That screen needs a full window or tab and does not work inside an iframe.
The link format, the signature and the step-by-step verification are in Signed link.
4. Confirm: the redirect is a hint, not proof
When the attempt ends, the customer’s browser goes back to yourredirect_url (if the link had one), with your state unchanged, and with these parameters:
Anyone can forge a request to your
redirect_url. Check your state against the customer session, then retrieve the project and trust only that:
project_id. If you do not have a webhook yet, poll the project at growing intervals and with a deadline: the customer may never finish.
To see the numbers of all your customers at once, use GET /v1/partner/channels. It accepts the status, project_id and external_ref filters. To find the projects that never finished the link, use has_channel=false in GET /v1/partner/projects.
5. Send with the project key and receive everything on one webhook
Use the API key from step 2 on the usual data routes, such asPOST /v1/messages:
Node.js
project_id and the external_ref, so you route by your own ID without keeping a lookup table.
6. Delete a customer project to free the slot
The plan limits the projects in the organization. An abandoned link or a customer who left still counts. Delete the project to free the slot.projects:delete scope, which a new key does not have. The deletion removes the project and everything it owns: messages, templates, events, contacts, keys, webhook endpoints, media files and disabled channels, whose numbers become free again. The plan, the allowance, the audit log and the partner keys of the organization do not change. Nothing changes on WhatsApp.
To delete a project that still has a channel, the channel must be
disabled. See Partner keys.