> For the complete documentation index, see [llms.txt](https://docs.toolkit.equs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toolkit.equs.ai/standards/api/authentication.md).

# Authentication

Get an access token with your Client ID and Secret, and use it to call the EQUS APIs securely from your server.

Three steps to your first API call 🔑 Get a token, use it, renew it.

Your back end calls the platform APIs as your **Tenant**. It proves who it is with the **Client ID** and **Client Secret** you received when you set up your account (see [Registration](/standards/onboarding/registration.md)), using the standard OAuth 2.0 **Client Credentials** flow: exchange the credentials for a short-lived access token, then send that token with every API call.

### 1. Get an access token 🎟️

Send your client credentials to the token endpoint as a form-encoded `POST`:

```bash
curl -X POST 'https://auth.us.equs.ai/realms/agents/protocol/openid-connect/token' \
  -d 'grant_type=client_credentials' \
  -d 'client_id=<CLIENT_ID>' \
  -d 'client_secret=<CLIENT_SECRET>'
```

The response is a standard OAuth 2.0 token response. The fields you need:

| Field          | Meaning                                |
| -------------- | -------------------------------------- |
| `access_token` | The token to send with your API calls  |
| `expires_in`   | How many seconds the token stays valid |
| `token_type`   | Always `Bearer`                        |

### 2. Call the APIs 📡

Send the token in the `Authorization` header of every request to the [Control API](/api/control-api.md) and the [Integration API](/api/integration-api.md):

```bash
curl 'https://control-api.us.equs.ai/api/v1/issuers' \
  -H 'Authorization: Bearer <ACCESS_TOKEN>'
```

The token identifies your Tenant, so every call is scoped to your own Issuers, Verifiers, schemas and credentials. You don't need to send the optional `x-tenant-id` header shown in the API reference.

### 3. Renew the token 🔄

Tokens are short-lived, and this flow has no refresh token. When a token is about to expire, request a new one with the same call. Cache the token and reuse it until then, rather than requesting a new one for every API call.

A call made with an expired or invalid token is rejected with `401 Unauthorized`.

### Keep the secret on your back end 🤫

* Call the token endpoint and the protected APIs only from your back end. Never put the Client Secret or an access token in a browser, a mobile app or a public repository.
* Embedded UI never holds your credentials: the calls that need them go through your back end.
* Keep the secret in a secrets manager, not in code or in configuration files under source control.

### If the secret is lost or exposed 🚨

Generate a new one in the [Operator Portal](https://portal.us.equs.ai/) under **Instructions → APIs**, then update your back end with it. Your Client ID stays the same.

{% hint style="info" %}
If your Tenant's access has an end date, your client credentials stop working when it passes. The Operator Portal shows the time remaining.
{% endhint %}

### Next steps 🚀

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h3><i class="fa-plug" style="color:$primary;">:plug:</i></h3></td><td><strong>Integration API</strong></td><td>Start and manage Issuance and Presentation flows from your back end.</td><td><a href="/api/integration-api.md">Integration API</a></td></tr><tr><td><h3><i class="fa-sliders" style="color:$primary;">:sliders:</i></h3></td><td><strong>Control API</strong></td><td>Set up Issuers, Verifiers and schemas, and revoke credentials.</td><td><a href="/api/control-api.md">Control API</a></td></tr><tr><td><h3><i class="fa-gauge" style="color:$primary;">:gauge:</i></h3></td><td><strong>Rate Limits</strong></td><td>Know the limits your API calls run under.</td><td><a href="/standards/api/rate-limits.md">Rate Limits</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.toolkit.equs.ai/standards/api/authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
