---
title: "Add an API key or access token to a request header"
slug: "add-an-api-key-or-access-token-to-a-request-header"
abstract: "Learn how to access Sitecore Search APIs by adding an API key or access token in the request header."
---
# Add an API key or access token to a request header

You must include an API key or an access token in the header of every request you send to a Sitecore Search API.

## Add an API key to a request header

To pass the API key in the header when you make a POST request to the search and recommendation API

- Use the following code sample.

```shell
curl -X POST \

  'https://discover.sitecorecloud.io/discover/v2/<customer-key>?data={"content":{}}' \

  -H 'Authorization: <api-key>'
```

## Add an access token to a request header

To pass the access token in the header when you make a POST request to the search and recommendation API:

- Use the following code sample.

```shell
curl -X POST \

  'https://discover.sitecorecloud.io/discover/v2/<customer-key>?data={"content":{}}' \

  -H 'Authorization: Bearer <access-token>'
```