---
title: "Create an API key for a content collection"
slug: "create-an-api-key-for-a-content-collection"
abstract: "How to create an API key that only gives access to a specific content collection."
---
# Create an API key for a content collection

> [!warning]
> You must have a *Contributor* or *Manager* [role](https://doc.sitecore.com/ch/en/users/content-hub/user-roles-and-permissions.html) to create, use, or manage API keys for content collections.

To create an API key for a content collection:

1. On the menu bar, click **Content** and then click **Content Collections**.
2. On the **Content collections** page, click a content collection name.
3. On the content collection details page, click **More actions** :mdiDotsHorizontal: and then click **API keys**.
4. In the **API keys** dialog, click **\+ API key**.
5. In the **API key** dialog, in the **Name** field, enter a name for the key.
6. Select one of the following options to define the purpose of the key:
    - **Delivery** - for the Delivery API, which provides access to approved content. This is for a production environment and exposes all published content.
    - **Preview** - for the Preview API, which allows access to all content, including drafts and other content that is not yet approved. This is for a staging or testing environment.
7. Click **Create**.
8. Copy and save the key for future use. Remember, you cannot request this key again after closing the dialog.