# Authentication

## Create Basic Token

<mark style="color:green;">`POST`</mark> `https://{organisation}.clearlrs.com/api/auth/basic`

Inserts new **Basic Authentication** credentials for a given actor that can be used to make further API requests on behalf of the actor.

#### Request Body

| Name     | Type   | Description                                                                                                                                                                                                    |
| -------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| username | string | Username for Basic Auth credentials. Must be unique ofr every set of new credentials.                                                                                                                          |
| password | string | Password to be used for these Basic Auth credentials.                                                                                                                                                          |
| ttlMins  | number | The length of time these credentials will be active before expiry.                                                                                                                                             |
| data     | object | <p>Optional data to store against these credentials, can include the following properties:<br><code>actor</code> – will restrict these credentials to the same level of permissions as the supplied actor.</p> |

{% tabs %}
{% tab title="200 The username for the inserted credentials." %}

```
{
  "username": "uuid"
}
```

{% endtab %}
{% endtabs %}


---

# 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://dev.clearxp.com/clear-api-reference/authentication.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.
