> For the complete documentation index, see [llms.txt](https://documentation.virtuedeep.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.virtuedeep.tech/guides/using-the-public-apis/getting-started/authenticating-your-data-source-to-use-our-apis.md). Agents can also search and read this documentation through its [MCP server](https://documentation.virtuedeep.tech/~gitbook/mcp).

# Authenticating your data source to use our APIs

Learn how to authenticate your front end to enable it to send data to Affective Computing through API calls

To connect the front end of your data source (app or device) to Affective Computing, you must complete the authentication process and obtain an access token. This access token enables you to securely call our APIs and send external data.

{% hint style="info" %}
Our server hosts are protected resources that provide authentication and authorization via OAuth 2.0 (JWT "JSON WEB TOKEN").
{% endhint %}

You must include your access token in the header of your API calls in the following format:

| Key           | Value                               |
| ------------- | ----------------------------------- |
| Authorization | Bearer *\<your valid access token>* |

If your request is authorized, your application can access the outcomes associated with your tenant account.

However, before obtaining an access token, you must first generate an API key and its corresponding secret key.

## Generating an API key

You can generate your API and secret keys either using the Portal or an API itself.

### Obtaining an API key from the Portal

{% content-ref url="/pages/TyG55kKmxC8R4pTpVwKS" %}
[Obtaining an API key](https://documentation.virtuedeep.tech/guides/using-the-portal/obtaining-an-api-key.md)
{% endcontent-ref %}

### Obtaining an API key using an API

You can obtain your keys using the `GenerateApiKey` endpoint in the `ApiKeys` collection. For detailed API documentation, see:

{% content-ref url="/pages/g155PfcjfL9ZjYc8qG4k" %}
[Generate an API key](https://documentation.virtuedeep.tech/guides/using-the-public-apis/authentication/creating-and-managing-api-keys/generate-an-api-key.md)
{% endcontent-ref %}

## Obtaining an access token

Access tokens allow you to make requests to our APIs. To obtain an access token, do the following:

1. [Obtain an API key and its corresponding secret key](#generating-an-api-key).
2. Generate your access token using the `Auth` endpoint in the `TokenAuth` collection.&#x20;

For detailed API documentation, see:&#x20;

{% content-ref url="/pages/cQsncI3oaVGFGvEurqBL" %}
[Issue a new access token](https://documentation.virtuedeep.tech/guides/using-the-public-apis/authentication/obtaining-and-managing-access-tokens/issue-a-new-access-token.md)
{% endcontent-ref %}
