Authentication
How your system identifies itself to the Synaptik API: a Microsoft Entra application token, and an integration key for tickets.
Ova stranica još nije prevedena na Vaš jezik. Prikazana je na jeziku koji je dostupan.
There are two ways to authenticate. Each one covers a different set of routes.
| Method | Used for | Header |
|---|---|---|
| Application token (Microsoft Entra) | Customers, contacts, documents, payments | Authorization: Bearer ... |
| Integration key | Support tickets | X-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:
- Assigns your application a role of the "Synaptik API" application (for example
Documents.Writeto write documents, orFinance.Readto read only). - 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.
- 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
| Header | Value | Required |
|---|---|---|
Authorization | Bearer YOUR_TOKEN | Yes |
X-Synaptik-Tenant | The name (slug) or uid of your company in Synaptik | Yes, if your access is limited to one company (the usual case) |
X-Synaptik-Workspace | Your workspace uid | Yes, if your access is limited to workspaces (the usual case) |
X-Client-Uid | The same workspace uid | Yes on the document, customer and payment routes |
Content-Type | application/json | On 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:
| Name | Routes it enables |
|---|---|
documents.create | POST /api/v1/documents, POST /api/v1/documents/{uid}/items |
documents.state | PATCH /api/v1/documents/{uid}/state |
payments.create | POST /api/v1/paymentdocuments, POST /api/v1/receivables/customer-payments |
payments.reverse | POST /api/v1/receivables/customer-payments/reverse |
clients.create | POST /api/v1/clients/upsert-by-rut |
contacts.upsert | POST /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
| Status | Body | Cause |
|---|---|---|
| 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."
}
}
| Operation | Route |
|---|---|
| List keys (revoked ones included) | GET /api/v1/integration/keys |
| Create a key | POST /api/v1/integration/keys |
| Revoke a key | DELETE /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.