Skip to content
Documentation topics

Authentication

How your system identifies itself to the Synaptik API: a Microsoft Entra application token, and an integration key for tickets.

There are two ways to authenticate. Each one covers a different set of routes.

MethodUsed forHeader
Application token (Microsoft Entra)Customers, contacts, documents, paymentsAuthorization: Bearer ...
Integration keySupport ticketsX-Integration-Key: sk_...

1. Microsoft Entra application token

Your system identifies itself with its own Microsoft Entra ID application, with no person signed in (the client_credentials flow). The API accepts tokens issued for your application, as long as Pintor Project has authorized it.

What Pintor Project does

To enable your system, Pintor Project:

  1. Assigns your application a role of the "Synaptik API" application (for example Documents.Write to write documents, or Finance.Read to read only).
  2. Adds your application to the list of authorized callers, with its application ID, your Entra directory ID, the company (tenant) and workspace it may use, and the list of writes it may make.
  3. Creates a service user in Synaptik with the minimum permissions your system needs. A call works only if that user has the permission for the route.

Pintor Project gives you the API application ID (for the token scope), your tenant name, and your workspace uid.

Getting the token

Ask Microsoft for a token with the scope api://API_APPLICATION_ID/.default:

curl -X POST "https://login.microsoftonline.com/YOUR_ENTRA_DIRECTORY/oauth2/v2.0/token" \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_APPLICATION_ID" \
  -d "client_secret=YOUR_SECRET" \
  -d "scope=api://API_APPLICATION_ID/.default"

If your system runs in Azure with a managed identity, it can get the token without a secret; the scope is the same. A role change only shows up in tokens requested after the change.

Headers on every call

HeaderValueRequired
AuthorizationBearer YOUR_TOKENYes
X-Synaptik-TenantThe name (slug) or uid of your company in SynaptikYes, if your access is limited to one company (the usual case)
X-Synaptik-WorkspaceYour workspace uidYes, if your access is limited to workspaces (the usual case)
X-Client-UidThe same workspace uidYes on the document, customer and payment routes
Content-Typeapplication/jsonOn calls with a body

If X-Client-Uid is missing on a route that needs it, the API answers 400 with the message Missing or invalid X-Client-Uid header: this endpoint is workspace-scoped.

curl "https://YOUR_API_ADDRESS/api/v1/clients?search=77333333" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Synaptik-Tenant: YOUR_TENANT" \
  -H "X-Synaptik-Workspace: YOUR_WORKSPACE_UID" \
  -H "X-Client-Uid: YOUR_WORKSPACE_UID"

Which writes you can make

A read call (GET) works if your service user has the permission for the route. For writing, each kind of write is authorized by name, and everything else is refused before it reaches the route:

NameRoutes it enables
documents.createPOST /api/v1/documents, POST /api/v1/documents/{uid}/items
documents.statePATCH /api/v1/documents/{uid}/state
payments.createPOST /api/v1/paymentdocuments, POST /api/v1/receivables/customer-payments
payments.reversePOST /api/v1/receivables/customer-payments/reverse
clients.createPOST /api/v1/clients/upsert-by-rut
contacts.upsertPOST /api/v1/crm/contacts/upsert

If your access has no authorized writes, it is read-only: any method other than GET or HEAD answers 403 service_caller_read_only.

Refusal answers

StatusBodyCause
401(from Microsoft Entra)Missing or expired token, or an application that is not authorized
403{ "error": "service_caller_denied" }The token fails a check: wrong directory, role or service user
403{ "error": "service_caller_read_only" }A write was tried with a read-only access
403{ "error": "service_caller_write_denied" }That write is not authorized for your access
403{ "error": "service_caller_tenant_denied" }X-Synaptik-Tenant is missing or names another company
403{ "error": "service_caller_workspace_denied" }X-Synaptik-Workspace or X-Client-Uid is missing or names another workspace

2. Integration key (tickets)

To open tickets from another system you do not use Entra. You use a key sent in the X-Integration-Key header.

curl -X POST "https://YOUR_API_ADDRESS/api/v1/integration/tickets" \
  -H "X-Integration-Key: sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "externalReference": "ALERT-2041", "subject": "Disk at 95% on server 3", "body": "Alert details" }'
  • The format is sk_ followed by 64 hexadecimal characters.
  • Each key is tied to one WorkTrack project of one company. Tickets always go to that project; the request cannot name another destination.
  • Synaptik stores only a hash of the key. If you lose it, a new one is created.
  • A key that does not exist or was revoked answers 401 with no body; the two cases look the same.

How a key is created

A person in the company who has the wt.integrationkeys.manage permission creates it, with their normal Synaptik session (a user token). An integration key cannot create other keys.

curl -X POST "https://YOUR_API_ADDRESS/api/v1/integration/keys" \
  -H "Authorization: Bearer THE_PERSONS_TOKEN" \
  -H "X-Client-Uid: YOUR_WORKSPACE_UID" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Server monitoring", "projectUid": "PROJECT_UID" }'

The response carries the key in data.apiKey. This is the only time it is shown. The warning text is returned in Spanish.

{
  "success": true,
  "data": {
    "key": {
      "uid": "6f1c2a8e-3d41-4b7e-9a50-2f0d5c7e9b11",
      "projectUid": "PROJECT_UID",
      "projectName": "Support",
      "name": "Server monitoring",
      "createdAt": "2026-11-05T14:02:11Z",
      "lastUsedAt": null,
      "revokedAt": null,
      "isActive": true
    },
    "apiKey": "sk_...",
    "warning": "Guarde esta clave ahora. No podremos volver a mostrarla: sólo almacenamos su hash."
  }
}
OperationRoute
List keys (revoked ones included)GET /api/v1/integration/keys
Create a keyPOST /api/v1/integration/keys
Revoke a keyDELETE /api/v1/integration/keys/{uid} (answers 204)

Usage limit

The ticket routes accept up to 60 requests per minute from one IP address. Past that limit they answer 429.