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 Settings menu is only visible if you have an Admin role.
Create an API key
Be sure to copy the generated API key because you cannot view it after you close the Create API key dialog.
Each API key is valid for a specific tenant (app) within an organization.
To create an API key:
-
On the menu bar, click Settings and, in the INTEGRATION section of the left pane, click API keys.
-
On the API keys page, click
Create API key.
-
In the Create API key dialog, in the Name field, enter a name for the key.
-
Select one of the following options:
-
Delivery - to use the Delivery API. This is for a production environment and exposes all published content.
-
Preview - to use the Preview API. This is for a staging or testing environment and exposes a preview of all content (including drafts).
-
-
Click Save. This generates an API key that you can use with GraphQL.
-
In the API key created dialog, click Copy
to copy the key to the clipboard.
-
Click Open GraphQL IDE to open the integrated development environment (IDE) on a new tab.
-
In the IDE, on the HTTP HEADERS tab, add the API key you just copied using the following format:
RequestResponse{ "X-GQL-Token":"<API_KEY>" }
Rename an API key
You can only edit the name of the API key.
To rename an API key:
-
On the menu bar, click Settings and, in the INTEGRATION section of the left pane, click 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 Settings and, in the INTEGRATION section of the left pane, click API keys.
-
On the API keys page, next to the API key you want to delete, click More actions
> Delete.
-
Confirm the deletion.