# Authentication

[Copyfactory](https://copyfactory.io) uses API keys to allow access to the API. You can get an API key by to your account settings in Copyfactory. There is also a link in the nav that takes you directly to your account page.

Copyfactory expects the API key to be included in all API requests to the server in a header that looks like the following:

`Authorization: API_KEY`

## Test your connection

To make your first request, send an authenticated request to the /me endpoint. This will provide you with your account status.

## Get account details

<mark style="color:blue;">`GET`</mark> `https://app.copyfactory.io/api/v2/me`

Test connection.

#### Headers

| Name                                            | Type   | Description          |
| ----------------------------------------------- | ------ | -------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | You account API key. |

{% tabs %}
{% tab title="200 Success" %}

```javascript
{
  "message": "Authorized",
}
```

{% endtab %}
{% endtabs %}

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

```
curl --location --request GET 'https://app.copyfactory.io/api/v2/me' \
--header 'Authorization: API-KEY'
```

{% endtab %}

{% tab title="Python" %}

```
import requests

url = "https://app.copyfactory.io/api/v2/me"

headers = {
  'Authorization': 'API-KEY'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}


---

# 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://developers.copyfactory.io/getting-started/overview/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.
