# Authentication - API Key

## How use your API Key in requests http

Before making any request to the integration APIs, you need to include the API Key in the request header using the `Authorization` parameter. The API Key should be encoded in base64 format.

```shell
const secretKey = 'client_id' + Buffer.from('client_id').toString('base64');
```

Here is an example of how to use your API Key in a CURL command, which demonstrates including the API Key in the header. You can also use this example for making requests via Postman.

**1. CURL**

```shell
curl --request GET \
--url https://api.sparc.solutions/pix
--header 'Accept: application/json' \
--header 'client_id: {CLIENT_ID}'
--header 'client_secret: {CLIENT_SECRET}'
```

Finally, if the API Key is not informed and/or is invalid, requests will issue a 403 error with the return:

```shell
{
    "message": "Unauthorized",
    "statusCode": 401
}
```


---

# 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://docs.sparc.solutions/overview/authentication-api-key.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.
