# Get and use an Authorization Token

To gain access to our API, you need a valid token in an [Authorization header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization)![](/files/i1X0t7ez6Vlx9HiwQQXC). The token is granted by our API in exchange for a [Client ID / Client Secret pair](/api/guides/use-the-api.md). This can also be handled by third party OAuth client libraries.

Example Python request (replace CLIENT\_ID and CLIENT\_SECRET):

{% code fullWidth="false" %}

```python
import requests

data = {
    'grant_type': 'client_credentials',
}

response = requests.post('https://api.certn.co/token/', data=data, auth=('CLIENTID', 'CLIENTSECRET'))
```

{% endcode %}

* Replace `TOKEN` with your API key in the following header:

```python
{ 'Authorization': 'Bearer TOKEN' }
```

{% hint style="info" %}
Include this header in every call to our API, and keep it secure. It is your access key.‌
{% endhint %}

## Token lifespan

Token lifespan is indicated by the `expires_in` parameter returned when a new token is requested. The default value is `36000` seconds (10 hours).


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.certn.co/api/guides/use-the-api/authorization-header.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
