# Authentication

The Paytree API authenticates requests using API keys, which you can view and manage in your back office.

Since your API keys grant access to sensitive functions, it’s important to keep them secure. Never expose your secret API keys in publicly accessible areas like GitHub, client-side code, or similar locations.

All API requests must be made over HTTPS. Requests sent via plain HTTP will be automatically redirected to HTTPS. Additionally, any requests without proper authentication will fail.

### How to authenticate

All requests should have an `Authorization` header followed by `Token` and your API key. For example.

```
Authorization: Token 4040e5f6d2a248b0aa88c4b3c7174899
```


---

# 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://paytree.gitbook.io/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.
