# Authentication

The Dashworks API uses API keys for authentication. This page explains how to use API keys, how to obtain them, and best practices for managing them securely.

## Using API Keys

All API endpoints require authentication using an API key. To authenticate your requests:

1. Include an `Authorization` header in your HTTP request.
2. Set the value to `Bearer {api_key}`, replacing `{api_key}` with your actual API key.

Example:

```http
Authorization: Bearer your_api_key_here
```

If you send an incorrect or deleted API key, you will receive a 401 Unauthorized response.

## Obtaining API Keys

To generate API keys for your workspace:

1. Log in to your Dashworks account.
2. Navigate to [Settings > API Keys](https://web.dashworks.ai/admin/api-keys).
3. Click on the "New API Key" button.

Only Admins can create and manage API keys. API keys are long-lived and do not expire automatically. You can delete API keys at any time by going to Settings > API Keys.

{% hint style="info" %}
If you encounter any issues with authentication or have questions about API key management, please contact our [support team](mailto:undefined).
{% endhint %}


---

# 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://support.dashworks.ai/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.
