# API Token

### Create a Token

In order to access the Select Star API, you'll need to first generate a token.

In your Account Settings page, under `Client API Token`, click on `Manage API Tokens` :

![](/files/-MjB2BFjtNj1XiryX-49)

Then, in the modal, click on the `Create` button.

![](/files/-MjB2GX1PFxrEwqVpGDs)

Copy the text in the `API Token` field to use as the token in API requests.

![](/files/-MjB2Jq_IZ-zuiz1WEBq)

API tokens have no expiration, but they can be deleted and then recreated manually.

### Making Authenticated Requests

All Select Star API endpoints require authentication, so the token must be included it in all requests. Set the `Authorization` header for bearer authentication like the following:

```
Authorization: Token <token>
```

{% hint style="warning" %}
Please note that for authorization type, you must use **`Token`** and not `Bearer`
{% endhint %}

For example, in `curl`, set the header using the `-H` flag:

```
curl https://api.production.selectstar.com/v1/tables/ -H "Authorization: Token <your_token>"
```

If the token is missing or invalid, the endpoint will return `401: Unauthorized` with one of the following messages in the body:

```
{
    "detail": "Authentication credentials were not provided."
}
```

```
{
    "detail": "Given token not valid for any token type",
    "code": "token_not_valid",
    "messages": [
        {
            "token_class": "AccessToken",
            "token_type": "access",
            "message": "Token is invalid or expired"
        }
    ]
}
```


---

# 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.selectstar.com/select-star-api/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.
