# Authentication

The platform supports both Token Authentication and Session Authentication:

* **Token Authentication** (Primary): After successful login, a token `key` is returned. Include this in the `Authorization: Token <key>` header for subsequent API requests.
* **Session Authentication** (Fallback): Session cookie `sessionid=<value>` can be used on authenticated endpoints.
* **CSRF Protection**: For unsafe methods (POST/PUT/PATCH/DELETE) include `X-CSRFToken` with the token issued by the site when using session auth.


---

# 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://apidocs.akinon.com/commerce-openapis/users/module-3/introduction/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.
