> For the complete documentation index, see [llms.txt](https://docs.datasentinel.io/manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasentinel.io/manual/implementation/platform-usage/api-reference/access-token.md).

# Access Token

{% hint style="info" %}
This access token will remain operational for a 24-hour period.
{% endhint %}

## Access Token

## Token Creation

<mark style="color:green;">`POST`</mark> `https://<<platform-server>>/ds-api/user-token`

Authentication is mandatory, requiring a valid username and password.

**Response**

{% tabs %}
{% tab title="201: Created " %}

```json
{
  "user-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1ODAyMTYyMjQsImlhdCI6MTU4MDEyOTgxOSwiZGF0YWJhc2UiOiJNYWluIE9yZy4iLCJlbWFpbCI6InRlc3RAZGF0YXNlbnRpbmVsLmlvIiwidXNlciI6InRlc3QifQ.JMDvq2JPcqz9M0_it_0UtP9y79dClVwx9pDEzCl9HTk"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

{% tab title="500: Internal Server Error " %}

{% endtab %}
{% endtabs %}

{% code title="Example" %}

```bash
curl -u myUser:myPassword -k -X POST https://<<platform-server>>/ds-api/user-token
```

{% endcode %}

{% code title="output " %}

```json
{
  "user-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1ODAyMTYyMjQsImlhdCI6MTU4MDEyOTgxOSwiZGF0YWJhc2UiOiJNYWluIE9yZy4iLCJlbWFpbCI6InRlc3RAZGF0YXNlbnRpbmVsLmlvIiwidXNlciI6InRlc3QifQ.JMDvq2JPcqz9M0_it_0UtP9y79dClVwx9pDEzCl9HTk"
}
```

{% endcode %}

## Token Infos

<mark style="color:blue;">`GET`</mark> `https://<<platform-server>>/ds-api/user-token?token={user-token}`

Authentication is mandatory, requiring a valid username and password.

#### Query Parameters

| Name                                         | Type   | Description  |
| -------------------------------------------- | ------ | ------------ |
| user-token<mark style="color:red;">\*</mark> | String | Access Token |

**Response**

{% tabs %}
{% tab title="200: OK " %}
{% code title="Output example" %}

```json
{
    "email": "contact@datasentinel.io",
    "expire_time": "2020-04-28 13:58:53",
    "organization_name": "ds-data",
    "user": "datasentinel"
}
```

{% endcode %}
{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

{% tab title="500: Internal Server Error " %}

{% endtab %}
{% endtabs %}

{% code title="Example" %}

```bash
export TOKEN=<<user_token>>
curl -u myUser:myPassword -k -X GET https://<<platform-server>>/ds-api/user-token?token=$TOKEN
```

{% endcode %}

{% code title="output " %}

```json
{
    "email": "contact@datasentinel.io",
    "expire_time": "2023-04-28 13:58:53",
    "organization_name": "ds-data",
    "user": "datasentinel"
}
```

{% endcode %}


---

# 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 dynamically by asking a question.

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

```
GET https://docs.datasentinel.io/manual/implementation/platform-usage/api-reference/access-token.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
