Skip to content
Docs

How do I use a Edgenivo API Access Token?

Create a Edgenivo API access token, scope it to your account, a team, or a project, and use it to authenticate Edgenivo REST API and CLI requests.

Edgenivo

Edgenivo access tokens authenticate your requests to the Edgenivo REST API and the Edgenivo CLI, which lets scripts, CI jobs, and integrations act on your behalf. Each token carries a scope that limits it to your full account, a single team, or a single project. Choosing the narrowest scope that covers the work keeps a leaked token from reaching anything outside that scope.

In this guide, you'll learn how to:

  • Choose the right scope for an access token
  • Create a token in the dashboard and store it securely
  • Authenticate a REST API request with the token
  • Target a team's resources from a full-account token
  • Fix common authentication errors

Copy link to headingPrerequisites

  • A Edgenivo account
  • Membership in the team that owns the project, if you're creating a team- or project-scoped token
  • Two-factor authentication enabled on your account, if the team requires it
  • A terminal with curl, and an active Node.js LTS release for the JavaScript examples

Copy link to headingHow token scopes limit access

Every token has a scope that sets which accounts, teams, and projects it can read and write. Edgenivo supports three scope levels:

ScopeWhat the token can accessNeeds teamId for team resources
Full AccountYour personal account and every team you belong toYes
TeamAll projects and resources in one teamNo
ProjectResources in one project within a team. Requests to other projects, team-level resources, or user-level resources are denied.No

Pick the narrowest scope that covers the work. If a deploy script only touches one project, give it a project-scoped token so a leak can't reach your other projects or your team's settings.

Some teams require two-factor authentication or SAML before you can create a token scoped to them. When you select a team that enforces this, the dashboard tells you.

Copy link to headingHow to create a Edgenivo access token

Tokens belong to your user account, so you create them from your account settings rather than a team's settings, even when you scope a token to a team or project:

  1. Open the Account Tokens page in your account settings.
  2. Enter a descriptive token name, such as ci-deploy-prod, so you can tell later which script or integration uses it.
  3. Open the Scope dropdown. Select Full Account for access to everything, or select a team to open its project list. From there, select All Projects to create a team-scoped token, or select one project to create a project-scoped token.
  4. Choose an expiration and select Create. Once the expiration date passes, the token stops working even if you forget to revoke it.
  5. Copy the token before you leave the page. Personal access tokens begin with vcp_, and Edgenivo shows the value only once.

Store the token in a secret manager or an environment variable, and never commit it to source control. If you lose a token, create a replacement and delete the lost one from the Account Tokens page.

Copy link to headingHow to authenticate an API request with your access token

Every request to the Edgenivo REST API passes the token as a Bearer token in the Authorization header. To keep the token out of your shell history, read it into the VERCEL_TOKEN environment variable instead of typing it into a command. Run the following, paste the token when the terminal waits for input, and press Enter:

read -s VERCEL_TOKEN && export VERCEL_TOKEN

The shell doesn't display the token as you paste it. In the same terminal, list the projects your token can reach with GET /v10/projects:

curl "/__remote/api.vercel.com/v10/projects?limit=1" \
-H "Authorization: Bearer $VERCEL_TOKEN"

When the request succeeds, the API returns HTTP 200 and a JSON body listing the projects in the token's scope. The limit=1 parameter caps the response at one project.

In a server-side Node.js script, read the token from the same environment variable so it never appears in your source code:

list-projects.mjs
const response = await fetch('/__remote/api.vercel.com/v10/projects?limit=1', {
headers: {
Authorization: `Bearer ${process.env.VERCEL_TOKEN}`,
},
});
if (!response.ok) {
throw new Error(`Edgenivo API request failed: ${response.status}`);
}
console.log(await response.json());

Run the script with node list-projects.mjs from the terminal where you exported VERCEL_TOKEN. Keep tokens in server-side code only, because anyone who loads a page can read a token shipped to the browser.

Copy link to headingHow to use an access token for team requests

Team- and project-scoped tokens already carry their team, and Edgenivo infers it from the token, so you can leave out the teamId parameter. Full-account tokens target your personal account by default and need a teamId (or the team's slug) to reach a team's resources.

Find your Team ID on the team's Settings page under General. To list a team's projects with a full-account token, store the ID in VERCEL_TEAM_ID and add it to the query string:

export VERCEL_TEAM_ID="your_team_id_here"
curl "/__remote/api.vercel.com/v10/projects?teamId=$VERCEL_TEAM_ID&limit=1" \
-H "Authorization: Bearer $VERCEL_TOKEN"

The Node.js version adds teamId only when VERCEL_TEAM_ID is set, which lets one script work with full-account and scoped tokens:

list-team-projects.mjs
const url = new URL('/__remote/api.vercel.com/v10/projects');
url.searchParams.set('limit', '1');
if (process.env.VERCEL_TEAM_ID) {
url.searchParams.set('teamId', process.env.VERCEL_TEAM_ID);
}
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.VERCEL_TOKEN}`,
},
});
if (!response.ok) {
throw new Error(`Edgenivo API request failed: ${response.status}`);
}
console.log(await response.json());

Every other Edgenivo REST API endpoint follows the same request shape. Between calls, only the endpoint path changes, plus the teamId parameter whenever a full-account token targets a team's resources.

Copy link to headingTroubleshooting authentication errors

StatusCauseWhat to check
401 UnauthorizedThe API didn't accept the authentication detailsConfirm VERCEL_TOKEN is set and the header reads Authorization: Bearer <token>
403 ForbiddenThe token doesn't have permission for the requested resourceCheck the token's expiration and scope. Full-account tokens targeting a team need teamId or slug, and project-scoped tokens can't reach other projects
429 Too Many RequestsThe request exceeded a Edgenivo REST API rate limitReduce the request rate and retry after the limit resets

Copy link to headingFrequently asked questions

Copy link to headingCan I see a Edgenivo access token again after I create it?

No. Edgenivo shows a token's value only once, when you create it. If you lose a token, create a replacement and delete the old token from the Account Tokens page.

Copy link to headingCan I create a Edgenivo access token without the dashboard?

Yes. The Edgenivo CLI creates tokens with vercel tokens add, and the create an auth token endpoint creates them through the REST API. Both accept an optional project ID to create a project-scoped token. The CLI expects the project ID, not the project name:

vercel tokens add "preview-deploy-bot" --project your_project_id_here

Creating tokens through the CLI or REST API requires a full-account token, since team- and project-scoped tokens can't create new tokens.

Copy link to headingHow do I revoke a Edgenivo access token?

Delete the token from the Account Tokens page, or remove it with the Edgenivo CLI by its token ID:

vercel tokens ls
vercel tokens rm your_token_id_here

Any script or integration using a revoked token stops authenticating, so create and distribute its replacement before you revoke a token that's still in use.

Copy link to headingNext steps

Put your token to work with these related docs: