API Keys
Grafbase uses API keys to authenticate access to APIs for a specific project's branch environments.
Whenever you create a new project, Grafbase creates a new API key for both the Preview and Production environments for that project. API keys do not expire.
You can see your existing API keys, create a new API key, rename an existing API key, or delete an API key in the API Keys section of the Settings tab in a project's dashboard.
To list your API keys:
- Navigate to the API Keys section of the Settings tab in the project's dashboard. You'll see your keys listed, with their name, environment, hidden value, and date created.
- To see a key value, select Reveal. Once the value is revealed, select Copy to copy the value to your clipboard.
You must be a project owner, or member of the owning account if the owner is an organization, to create an API key.
To create an API key:
- Navigate to the API Keys section of the Settings tab in the project's dashboard.
- Select Create API Key.
- Select either the Preview or Production environment.
- Enter a name for the key.
- Select Create. Note the key value as you'll need that to make API calls.
Note that you can have a maximum of 10 API keys per project.
To rename an API key:
- Navigate to the API Keys section of the Settings tab in the project's dashboard. You'll see your keys listed, with their name, environment, hidden value, and date created.
- Select the context menu (the three dots to the right of the key's created time).
- Select Edit.
- Enter a new value in the Name field. Note that despite the Environment field, you cannot reassign the key to the other environment.
To delete an API key:
- Navigate to the API Keys section of the Settings tab in the project's dashboard. You'll see your keys listed, with their name, environment, hidden value, and date created.
- Select the context menu (the three dots to the right of the key's created time).
- If there is more than one API key in the environment, you should see a Delete option. Select Delete to delete the key.
Note that you cannot delete every API key for either the Preview or Production environments; there must be at least one API key for each environment to be able to call APIs in that environment.