Skip to main content
The customer connects their number on a Routa page. You send them there with a signed link, which the dashboard calls the onboarding link:
The signature proves that the link comes from you. It uses the signing secret of your partner profile, which is different from the partner key. Always sign on your server.

Parameters

The link carries these parameters and, besides them, only lang, which is optional and outside the signature. An unknown or repeated parameter makes the link invalid. Leave out an optional parameter you do not use. An empty parameter makes the link invalid. No value can contain a line break. The first valid link creates the customer project, if it does not exist yet.

The signature

signature is an HMAC-SHA256, in lowercase hexadecimal, with your signing secret as the key, computed over this string and nothing else:
  • The first line is the fixed label routa-partner-link-v1. Each following line is name=value for every parameter you send, except signature.
  • The names are in ascending byte order (external_ref, name, partner_id, redirect_url, state, ts), separated by a single \n, with no trailing line break.
  • The values are the decoded strings, exactly what you put in the link, before any URL encoding.
The SDK’s buildOnboardingLink is a pure function: it makes no requests and validates the parameters locally. That matters, because Routa answers every invalid link with the same message, without saying why. The SDK is the only place where you find out why a value would be refused. It is marked as experimental.

Page language

The connect page exists in Portuguese and in English. To choose the language, add lang to the link you already signed:
Node.js (SDK)
  • The values are pt-BR or en, written exactly like that. Any other value, such as pt_BR or pt, is ignored, and the link stays valid.
  • lang is not part of the signature. Do not include it in the signed string.
  • Without lang, the page uses the language the person had already chosen on Routa or, without a choice, the browser’s first language: Portuguese for any variant of Portuguese, English for everything else.
  • Someone signed in to a Routa account sees the language of the account, even with lang in the link.
  • The person can switch the language on the page itself.

Validity

Routa accepts the link for 10 minutes after ts, and up to 60 seconds ahead of its own clock, to tolerate clock differences. Within that window, the customer can open the same link more than once. Build the link when the customer clicks, not earlier. If it has to last longer, in an email for example, host your own redirector that signs on click.

The redirect_url origin

redirect_url must:
  • use https, with no username or password, spaces, control characters or backslash;
  • have a full origin (scheme, host and port) equal to an origin you registered in the dashboard.
You register the origin in the dashboard. Partner keys do not register origins. Routa checks the address when the link arrives and again when the attempt ends.

Returning to your site

When the attempt ends, the customer’s browser is sent to your redirect_url. Your own query string is preserved, and Routa adds: If the page was opened with window.open, it also posts the same fields to window.opener, addressed to the registered origin of your redirect_url, never to *:
Treat the redirect and the message as hints. Anyone can forge a request to your redirect_url, and window.opener can be lost after the provider’s connection screen. Check your state against the customer session and then retrieve the project to confirm the result.
The error field uses these values: No key, secret or provider credential appears in the URL or in the message. Every kind of bad link gets the same response: the customer sees “this link is not valid”, and so does anyone testing links. This includes:
  • an unknown partner_id or a wrong signature;
  • a ts outside the window;
  • a redirect_url that is not https or is not on a registered origin;
  • a malformed, unknown or repeated parameter, except for lang;
  • a plan without the Partner API.
If your links are refused, check in this order:
  1. The signing secret in use. After a rotation, the old secret stays valid for 24 hours.
  2. The canonical string. Compare it with the test vectors below.
  3. Your server clock.
  4. The origins registered in the dashboard.

Test vectors

Use these two examples to check your implementation. The test secret is rt_psign_TESTVECTORSECRET0000000000000000000000. Minimal. Parameters: partner_id=ptn_TestPartner0000000000, external_ref=lead_123, ts=1790000000.
signature = 0676f9f5ee8e76eff763defdac73798afd0b7cf165abb875356ef4f370ff524a Complete. Adds name=Acme Ltda, redirect_url=https://partner.example/connected?x=1 and state=opaque:state/42.
signature = ff77d689a13e1057dda3b87e9f3f4e0788a98568d3022794ea6ecfc7c6dbb90c Both values were computed with Node.js createHmac('sha256', secret) over the strings above.