Skip to main content
This guide follows the order a partner works in: from registering a customer to a connected number that sends messages. Each customer has one project and one API key. The organization is where you work as a partner.
Before you start, take the dashboard steps in Partner API: partner profile, redirect origins and partner key.
The Node.js examples use @routa-chat/sdk/partner, which is experimental and can change in a minor version. Run everything on your server. The partner key and the signing secret never go to the browser.

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.
The key secret appears only once in the response. Keep it in your secrets vault. Ask only for the scopes the customer needs, and use expires_at and ip_allowlist when it makes sense. See API key scopes.
Issuing and rotating keys does not accept Idempotency-Key. If the response is lost, a retry can issue a second key. If that matters to you, do not retry these calls automatically: in the SDK, use maxRetries: 0 on them.
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
Open the link with 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 your redirect_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:
No key, secret or provider credential appears in the URL. Events also reach your webhook, with the same 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 as POST /v1/messages:
Node.js
To receive the events of every customer in one place, set the organization webhook. Each event carries the 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.
Deleting requires the opt-in 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.