> For the complete documentation index, see [llms.txt](https://docs.posynt.win/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.posynt.win/getting-started/authentication.md).

# Authentication

Posynt uses **Bearer API keys**. Every request must include your key in the `Authorization` header.

```http
Authorization: Bearer psy_live_xxx
```

## Example

```bash
curl https://api.posynt.win/v1/tracks \
  -H "Authorization: Bearer psy_live_xxx"
```

## Best practices

* **Never** expose your key on the client side (browser, public mobile app). Call Posynt from your backend.
* Store the key in an environment variable, not hardcoded in your source.
* If a key leaks, **regenerate it** from the dashboard — the old one dies instantly.

## Two-factor authentication

You can enable **TOTP 2FA** in the dashboard settings (optional). When enabled, sensitive actions (regenerating your API key, deleting your account) require a 6-digit code from your authenticator app in addition to your API key.

## Authentication & limit errors

| Code                     | Meaning                                                                                                                                                 |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `401 Unauthorized`       | Missing, invalid or revoked key.                                                                                                                        |
| `402 Payment Required`   | Inactive or expired subscription.                                                                                                                       |
| `403 plan_limit_reached` | A `POST`/`PATCH` would exceed your plan's hashtag, account, engagement-tracking, or Discord webhook limit.                                              |
| `429 rate_limited`       | Over the per-minute request cap for your plan, or a sensitive endpoint's tighter limit — see [Rate limiting](/api-reference/overview.md#rate-limiting). |

Going over your **monthly alert quota** isn't an error at all: new posts just stop being stored/delivered until the period resets (see `GET /v1/usage`).

Error format:

```json
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid API key."
  }
}
```


---

# 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.posynt.win/getting-started/authentication.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.
