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:

  1. 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.
  2. 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. Note that you can have a maximum of 10 API keys per project.

To create an API key:

  1. Navigate to the API Keys section of the Settings tab in the project's dashboard.
  2. Select Create API Key.
  3. Select either the Preview or Production environment.
  4. Enter a name for the key.
  5. Select Create. Note the key value as you'll need that to make API calls.

To rename an API key:

  1. 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.
  2. Select the context menu (the three dots to the right of the key's created time).
  3. Select Edit.
  4. 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:

  1. 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.
  2. Select the context menu (the three dots to the right of the key's created time).
  3. 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.

Was this page helpful?