PerpetuusPerpetuus Developers

Authentication and multi-tenancy

API key (ppt_…), scopes, connection test, organization, and rate limits for the Perpetuus API.

The official credential for integrations (Zapier, Make, n8n, scripts, BI) is the API key, a token that starts with ppt_. It belongs to a user and an organization, has scopes, an expiration date, and can be revoked at any time.

Headers

HeaderRequiredExample
AuthorizationYesBearer ppt_4fJk…
x-tenant-idNo, with an API keyacme

The key already knows its organization. Without x-tenant-id, the API uses the key's organization. If you send x-tenant-id for a different organization, the response is 403.

With an invalid, expired, or revoked token, the API responds 401. Without the Authorization header on an authenticated route, 403. With a key that lacks the route's scope, or with a user who lacks permission, also 403.

curl "https://api.perpetuus.com.br/api/boards" \
  -H "Authorization: Bearer ppt_SUA_CHAVE"

Create an API key

Organization administrators and managers can create keys.

  1. In the app, open Configurações → API Tokens e MCP (/settings/api-tokens).
  2. In the Conectar sua IA (MCP) card, click Conectar editor and then Conectar novo editor.
  3. Give the key a name (for example, Zapier), choose the expiration in days (from 1 to 365; default 30) and select the permissions (scopes).
  4. Click Gerar configuração.
  5. Copy the ppt_… key from the Authorization field of the configuration shown. It is shown only once. Store it like a password (an environment variable or a secrets vault).

Scopes

The key never goes beyond the user's role in the organization: a scope unlocks a type of route, and the role (administrator, manager, operator) still applies on every call.

ScopeWhat it unlocks
crm:readRead access to the CRM: boards, phases, fields, cards, contacts, tasks, calendar, segments, reports. Includes queries that use POST only to send filters (segment preview, field-condition evaluation, calendar availability). Includes campaign:read.
crm:writeCreate, edit, and delete in the CRM (POST, PUT, PATCH, DELETE), including creating and sending campaigns, which send real messages. Includes crm:read.
chat:readRead access to support: conversations, messages, channels, and unread counts.
chat:writeSend messages, change conversation status, and configure channels (including pairing by QR). Includes chat:read.
ai:controlPause, resume, and take over AI on cards.
campaign:readRead access to campaigns and send statistics.

A key cannot create, list, or revoke keys, and cannot use the copilot (Pergunte ao CRM): those routes require an app session.

Expiration and revocation

  • Expiration ranges from 1 to 365 days. After that the key stops working (401) and you need to create another one.
  • To revoke, open the same panel, find the key under Conexões ativas, and click Remover conexão. Revocation takes effect immediately.
  • If a key leaks, revoke it and create another one.

Test the connection

GET /api/auth/token-info confirms that the credential works and says who it belongs to. It is the connection-test and account-label endpoint used by connectors. Any valid key can call it, with any scope.

curl "https://api.perpetuus.com.br/api/auth/token-info" \
  -H "Authorization: Bearer ppt_SUA_CHAVE"
{
  "data": {
    "credential": {
      "type": "pat",
      "id": "k2j3h4g5f6d7s8a9",
      "name": "Zapier",
      "scopes": ["crm:read", "crm:write"],
      "expiresAt": "2027-11-16T12:00:00.000Z",
      "lastUsedAt": "2026-11-16T12:00:00.000Z"
    },
    "user": { "id": 42, "documentId": "us1a2b3c", "email": "voce@empresa.com", "username": "luis" },
    "organization": { "documentId": "or1a2b3c", "slug": "acme", "name": "Acme Ltda" }
  }
}

The response never includes the token, the hash, or the key prefix. With an app session JWT, credential.type is session and scopes is null.

Suggested account label in a connector: {{organization.name}} ({{user.email}}).


Rate limits

Requests authenticated with an API key or an OAuth token are limited per minute (fixed window):

WindowLimit
Per key (or OAuth connection)120 requests per minute
Per organization (sum of keys)600 requests per minute

Every response to a request with an API key or OAuth token includes:

HeaderMeaning
X-RateLimit-LimitLimit of the window closest to being exceeded (key or organization)
X-RateLimit-RemainingRequests remaining in that window
X-RateLimit-ResetEnd of the current window, as epoch seconds

When the limit is exceeded, the API responds 429 with Retry-After (seconds until the next window):

{
  "data": null,
  "error": {
    "status": 429,
    "name": "TooManyRequestsError",
    "message": "Limite de 120 requisições por minuto desta chave de API atingido. Tente de novo em 42s.",
    "details": { "code": "RATE_LIMITED", "scope": "pat", "limit": 120, "windowSeconds": 60, "retryAfter": 42 }
  }
}

Wait for Retry-After before trying again. For large loads, prefer the bulk endpoints (POST /contacts/bulk, crm_bulk_create_cards).


Session JWT (apps acting on behalf of the user)

If your application acts in real time on behalf of someone who signs in, you can use the app session JWT:

curl -X POST "https://api.perpetuus.com.br/api/auth/local" \
  -H "Content-Type: application/json" \
  -d '{ "identifier": "voce@empresa.com", "password": "SuaSenha123!" }'

The response includes jwt. With it, x-tenant-id is required (without the header, 400). The session JWT has no scopes (the user's role applies) and is not counted in the per-key limits above. For integrations that run on their own, use an API key.

People who created their account with Entrar com Google do not have a password. To use /auth/local, set a password first via Esqueceu a senha? on the login screen; Google sign-in keeps working.

If your product is a third-party app used by multiple Perpetuus customers, do not ask for a password or a key: use OAuth 2.1. The OAuth token follows the same scopes, the same organization rule, and the same per-credential limits as an API key.


Legacy (deprecated)

The "Personal Access Token" generated at POST /users/generate-token (and in the card of the same name in Configurações) is deprecated. It still works during the transition, and the shutdown date will be announced. Migrate to an API key ppt_….

The legacy token is a JWT with no scopes and no bound organization: it has all of the user's permissions, requires x-tenant-id, and cannot be revoked individually.

curl -X POST "https://api.perpetuus.com.br/api/users/generate-token" \
  -H "Authorization: Bearer SEU_JWT_DE_SESSAO" \
  -H "Content-Type: application/json" \
  -d '{ "expiration": "30d" }'

To migrate: create an API key with the scopes the integration uses, replace the Authorization value, and test with GET /api/auth/token-info.

On this page