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

# Authentication

Every Linkie API request must include a valid personal API key in the `Authorization` header.

#### Generating an API key

{% hint style="info" %}
For an image-guided, step-by-step tutorial, [click here](https://linkie.bio/help/en/article/how-to-change-the-accent-color-kowgve/?bust=1780094204936).
{% endhint %}

1. Go to the [Linkie Playground](https://app.linkie.bio/playground) and log in.
2. Click on the account profile icon at the top right of the playground → **Settings** → **API keys**.
3. In the **API Keys** section, click **Generate new key**.
4. Name the key something of your choice to help identify it, then hit **Generate**.
5. Copy and securely store your key. It starts with `lkp_` and won't be shown again for security reasons.

#### Using your API key

You must include the API key in the `Authorization` header for every request towards the Linkie API.

```http
Authorization: Bearer YOUR_API_KEY
```

Example (get profiles):

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET https://app.linkie.bio/api/v1/profiles \
  -H "Authorization: Bearer YOUR_API_KEY"
```

{% endtab %}

{% tab title="JS" %}

```javascript
const response = await fetch("https://app.linkie.bio/api/v1/profiles", {
  headers: {
    Authorization: `Bearer YOUR_API_KEY`,
  },
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);
```

{% endtab %}
{% endtabs %}

#### Security recommendations

* Strictly stick to HTTPS requests over HTTP.
* Rotate API keys every 3-6 months.
* Store your keys outside of source control, such as in an `.env` file.
* Never expose your API key in client-side code. Make API calls from your backend server.
* Use separate keys for separate environments when possible.

#### Common errors

* 401 Unauthorized
  * Missing or invalid `Authorization` header.
  * Invalid API key.

#### Troubleshooting

If you're still having issues, double check:

* Your API key exists and is correct.
* Verify you're passing the Authorization header correctly.
* Contact <support@linkie.bio> for assistance.

#### Related Pages

{% content-ref url="/pages/uV26mrXe88kOpc2YCRmZ" %}
[Getting Started](/docs/getting-started/quickstart.md)
{% endcontent-ref %}

{% content-ref url="/pages/1FtxMvVshyQiHgcPgEZi" %}
[API Reference](/docs/api-reference-1/profiles.md)
{% endcontent-ref %}


---

# 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://linkie.bio/docs/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.
