# Authentication

The RedirHub API uses an API key and API secret to authenticate requests. To get started, you must first create an [API key](https://dash.redirhub.com/user/token) by signing into your RedirHub Dashboard.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

The RedirHub API requires an `Authorization` request header to be set in any requests that are made. The synyax for the header is as follows: `Authorization: bearer <token>`. The token is a string that you can generate in the RedirHub dashboard.

\ <br>

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

```bash
# cURL is most likely already installed on your machine
curl --location --request GET 'https://api.redirhub.com/v1/test' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your-token-here}'

```


---

# 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://dev.redirhub.com/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.
