API Keys

Introduction

API keys are used to authenticate requests to the API. They are a way to identify the user and project making the request.

const apiKey = env.ITTYBIT_API_KEY;

const response = await fetch('https://api.ittybit.com/files', {
  headers: {
    'Authorization': `Bearer ${apiKey}`
  }
});

Keys give access to all the resources for the project so you should not share them with anyone.

You should store your API keys in a secure environment, such as a secret manager or environment variable, and never include them in source controlled files.

Create an API Key

When you first create a project, you will be asked to create an API key.

Project Creation

Click 'Generate Key'.

Then you will be able to copy the key to your clipboard.

copy to clipboard

View your API keys

Project Dashboard

Whenever you need to grab your API key, you can do so from the 'Quick Start' section of the project dashboard.

Project Dashboard

Project Settings

You can also view and manage your keys from your project settings page.

  1. Settings is accessible from the sidebar menu.

Menu

  1. Clicking the 'Manage' button above your key on the project dashboard will also bring you to the project settings page.

Scroll down to the 'API Keys' section.

Settings

Pause API Key

You can pause an API key to stop it from being used, but retain the option to re-enable it.

This is useful if you need to test changes in your system without causing side effects, or to prevent runaway costs during an unexpected busy period.

Pause

You can also re-enable a paused key.

Re-enable

Delete API Key

You can delete an API key to remove it from the project. This will immediately stop all requests using the key.

Delete

Deleting a key is irreversible so you will be shown a confirmation dialog before the key is permanently deleted.

Roll API Keys

If you need to rotate (aka roll) a project's API key, you can do so without downtime by:

  1. Clicking the '+ Create Key' button in project settings.

  2. Updating your code to use the new key.

  3. Deleting the old key.

On this page