Manage API keys using the app
To use the Preview or Delivery API, you require a valid API key. You can create, rename, or delete API keys using the Content Hub ONE app if you have the necessary permissions, or you can use the API.
The Integration menu is only visible if you have the Admin role. Each API key is valid for a specific tenant (app) within an organization.
Create an API key
Be sure to copy the generated API key because you cannot view it after you close the New API key window.
To create an API key:
-
On the menu bar, click Integration > API keys.
-
On the API keys page, click + Add API key.
-
In the New API key dialog box, in the Name field, enter a name for the key.
-
Choose one of the following options:
- Preview - to use the Preview API. This is for a staging or testing environment and exposes a preview of all content (including drafts).
- Delivery - to use the Delivery API. This is for a production environment and exposes all published content.
-
Click Save.
This generates an API key that you can use with GraphQL.
-
Click Copy
to copy the key to the clipboard.
-
In the Integrated Development Environment (IDE), click the HTTP HEADERS tab.
-
Add the API key you just copied using the following format (replacing the example API key):
RequestResponseshell{ "X-GQL-Token":"aEtSNzBsTaEtSNzBsTaEtSNzBsTaEtSNzBsTaEtSNzBsTBiaDJ6UFZjuT18bXRzdC1kLTAyMA==" }
Rename an API key
You can only edit the name of the API key.
To rename an API key:
-
On the menu bar, click Integration > API keys.
-
On the API keys page, next to the API key you want to edit, click More actions
> Edit.
-
Change the name of the API key as required and click Save.
Delete an API key
To delete an API key:
-
On the menu bar, click Integration > API keys.
-
On the API keys page, next to the API key you want to delete, click More actions
> Delete.
-
Confirm the deletion.