Skip to main content
For deploys after the first registration of the same email, you can skip the browser and use auto-activation by email — a single API call. The flow below is still required for the first registration of an email.

Flow overview

Manual activation flow diagram: instance calls register/init, displays URL, operator authenticates in browser, instance polls, receives api_key, activates via HMAC and continues with heartbeats. The base URL is set via the LICENSE_BASE_URL env var in the product .env (default: https://license.evolutionfoundation.com.br).

Step 1 — Initiate registration

When the instance detects no api_key is saved locally, it calls:
Fields: Response (200):
The token expires in 30 minutes. Rate limit is 10 inits per hour per IP. If the operator doesn’t complete activation in time, just repeat step 1.
Possible errors:

Step 2 — Show URL to operator

The instance displays register_url to the operator. Accepted patterns:
  • Web UI / Manager — “Activate License” button opens the link in a browser
  • Terminal / CLI — print the URL and wait
  • QR Code — in headless deployments, generate a QR for scanning
CLI output example:

Step 3 — What happens in the browser

The license server renders the registration page with Evolution’s visual identity. The operator picks one of:
  • Magic Link — provides name + email, receives a confirmation link by email
  • Google OAuth — Google account login
  • GitHub OAuth — GitHub account login
After authenticating, the server creates (or retrieves) the customer and generates an internal authorization_code. This flow is transparent to the instance — it only needs to poll.

Step 4 — Status polling

While the operator handles login, the instance polls:
While pending:
On completion:
After expiration:
Implementation recommendations:
  • Polling interval between 3 and 5 seconds (not faster)
  • Total timeout of 30 minutes
  • On completed, persist api_key in a secure location (encrypted config, secret manager, etc.)

Step 5 — Activate the instance

With the api_key in hand, the instance calls the activation endpoint:
Response:
Geolocation (operator_country, operator_city) is detected automatically from the request IP. The instance does not send that info.

Step 6 — Periodic heartbeat

After activation, the instance sends heartbeats every 5 minutes:
The telemetry_bundle field is free-form JSON. Fields extracted automatically by the server are detailed in Telemetry.

Step 7 — Deactivation (optional)

On graceful shutdown (uninstall, intentional container stop), recommended:
This frees the instance count in licensing. Not mandatory — the server auto-expires inactive instances after 7 days without heartbeat.

HMAC authentication

All calls to /v1/activate, /v1/heartbeat and /v1/deactivate require the X-Signature header with HMAC-SHA256 of the body. Algorithm:
  1. Serialize the body as JSON
  2. Compute HMAC-SHA256(body, api_key)
  3. Convert to hexadecimal
  4. Send in the X-Signature header
The body used in the HMAC must be byte-for-byte identical to what is sent. Do not reformat the JSON between signing and sending.

Python example

Node.js example

Go example


Error codes


Integration checklist

For those implementing activation in a fork or derivative product:
  • Generate and persist instance_id (UUID v4) on first run
  • Implement POST /v1/register/init when no api_key exists
  • Display register_url to operator (UI, terminal or QR)
  • Poll GET /v1/register/status every 3–5s
  • Persist api_key in a secure location (no plain text)
  • Implement HMAC-SHA256 for all signed calls
  • POST /v1/activate on service startup
  • POST /v1/heartbeat every 5min with messages_sent + features
  • POST /v1/deactivate on graceful shutdown
  • Handle errors (expired token, suspended key, instance limit)
  • Exponential backoff on transient network failures

Offline mode and degradation

If the license server is unreachable:
  • The instance keeps working normally
  • Heartbeats fail silently (no application crash)
  • After reconnection, the next heartbeat resumes the cycle
The initial activation (steps 1–5) is the only stage that requires connectivity. After that, the instance tolerates offline periods. See FAQ — offline mode for details.