> ## Documentation Index
> Fetch the complete documentation index at: https://developers.getfernand.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

To interact with the Fernand API, you need to include your API key in every request.
This is done by passing it in the `X-Api-Key` header.

You can create and manage your keys directly from your Fernand dashboard under **Integrations → API Key**.

<Frame caption="API Key integration page in the Fernand dashboard">
  <img src="https://mintcdn.com/fernand/ppqyIBFqKGg3-Vsr/images/integrations.png?fit=max&auto=format&n=ppqyIBFqKGg3-Vsr&q=85&s=fb905570f8de1015159af99912201b30" alt="Fernand API integration and key management" width="2580" height="1486" data-path="images/integrations.png" />
</Frame>

## Managing keys

<Steps>
  <Step title="Go to Integrations">
    Navigate to **Integrations** in your workspace settings.
  </Step>

  <Step title="Access API Key settings">
    Click on **Manage keys** under the **API Key** integration card.
  </Step>

  <Step title="Create or copy your key">
    Create a new key if you don't already have one, or copy an existing key.
  </Step>

  <Step title="Use your key">
    Include this key in the `X-Api-Key` header when making API calls.
  </Step>
</Steps>

<Warning>
  **Security best practices:**

  * Keep your keys secret. Do not paste them into public repositories or client-side code.
  * Rotate your keys regularly for added security.
  * If you suspect a leak, revoke the key immediately from the dashboard.
</Warning>

## Making a request

Once you have an API key, include it in the header of your request. Here are some examples:

<Tabs>
  <Tab title="Fetching conversations">
    ```bash theme={null}
    curl -H "X-Api-Key: sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
      https://api.getfernand.com/conversations
    ```
  </Tab>

  <Tab title="Fetching messages in a conversation">
    ```bash theme={null}
    curl -H "X-Api-Key: sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
      https://api.getfernand.com/conversations/<CONVERSATION_ID>/messages
    ```
  </Tab>
</Tabs>
