You’ll need to authenticate your requests to access any of the endpoints in the Buckets API. In this guide, we’ll look at how authentication works.
Get a Token
Start by getting an API token from your dashboard. Depending on your environment, it’ll look something like:
Using Your Token
The only way to authenticate with the Nightly API is by using OAuth2. When establishing a connection using OAuth2, you will need an API key — you will find it in the Nightly dashboard under API settings. Here’s how to add the token to the request header using cURL:
curl https://api.nightly.sh/v1/buckets \
-H "Authorization: Bearer {token}"
Always keep your token safe and reset it in the dashboard if you suspect it
has been compromised.