# Authentication

> Authenticate API requests with a Bearer token issued by Veripass for your organization. Webhooks authenticate through their own ingress binding instead.

Source: https://docs.sommatic.ai/en/api/authentication/ (updated 2026-11-26)

Every request to the API says who is making it. Sommatic AI uses that identity to scope what you see to your
organization and to record who did what in each run, task and change.

## Send a Bearer token

Send the token in the `Authorization` header of every request:

```text
Authorization: Bearer <token>
```

The token is issued by **Veripass**, Sommatic AI's identity authority, for your organization. It carries who you are,
your organization and your role, so every sensitive operation is bound to an actor and an organization.

**curl**

```bash
curl "https://api.sommatic.ai/work-management/task/inbox?user_id=$USER_IDENTITY&page=1&pageSize=25" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch('https://api.sommatic.ai/platform-infrastructure/credential/organization-id?search=' + organizationId, {
  headers: { Authorization: `Bearer ${token}` },
});
```

**React SDK**

```javascript
import { PlatformInfrastructureCredentialService } from '@sommatic/react-sdk';

const credentials = new PlatformInfrastructureCredentialService({ apiKey: token });
const response = await credentials.getByParameters({ queryselector: 'organization-id', search: organizationId });
```

A request without a valid token is rejected with HTTP 401:

```json
{ "status": 401, "success": false, "message": "Unauthorized", "result": null }
```

> **Warning: Treat the token as a password**
>
> Keep tokens on the server or in the signed-in person's session. Never commit them, never put them in a `VITE_`
> variable or any other bundle that reaches the browser, and never in a URL.

## Webhooks authenticate per binding

`POST /workflow-orchestration/trigger/webhooks/:mode/:bindingIdentifier` is the one route that does not take the
Bearer token: external systems that call your workflows usually have no Veripass identity. Each webhook is exposed
through an **ingress binding**, and the binding declares how its callers authenticate in its `authentication` block:

| `authentication.mode` | What the binding expects                                             |
| --------------------- | -------------------------------------------------------------------- |
| `api-key`             | A key from the binding's `allowed_api_keys`.                         |
| `oauth2`              | An OAuth 2 token with the binding's `oauth_scopes`.                  |
| `veripass-session`    | A Veripass session, checked against the binding's `veripass_policy`. |
| `service-token`       | A service token.                                                     |
| `custom`              | A scheme specific to that integration.                               |
| `none`                | Nothing. Use it only for test bindings that do not touch real data.  |

```json
{
  "slug": "ingress.http.inbound-requests",
  "ingress_kind": "http",
  "mode": "prod",
  "authentication": { "mode": "api-key", "allowed_api_keys": ["replace-with-a-long-random-key"] }
}
```

Create and edit bindings with the [Triggers](https://docs.sommatic.ai/en/api/reference/triggers.md) endpoints, which do take the Bearer token.
How to call a webhook, its `test` and `prod` modes and its payload are in [Webhooks](https://docs.sommatic.ai/en/workflows/webhooks.md).

## Next steps

- [Conventions](https://docs.sommatic.ai/en/api/conventions.md): Organization scope, selectors and pagination.
- [Security](https://docs.sommatic.ai/en/security.md): Identity, credentials and audit in Sommatic AI.
