Skip to main content
Generate a scoped access token that can be used to access a preview programmatically. ingress generate-access-token generates an access token. Using this token, you can access your Namespace previews programmatically. By default, the token is scoped to the entire workspace. You can restrict the token to only grant access to a single instance though.

Usage

Example

The following example starts a new ephemeral environment, running nginx. The nginx container image has nginx, an http reverse proxy, listening on port 80. We export that port to a public endpoint, using -p 80. Then, we generate an access token and query the exposed application with curl.
1

Start nginx

Start nginx and expose port 80 through a public endpoint:
Output
2

Generate an access token

Generate an access token for the instance:
3

Query the application

Query the exposed application using the access token:
Output

Options

—instance <instance-id>

If set, the generated access token will be limited to this instance.

—output_to <path>

Write the generated access token to this path. If file already exists, it will get overwritten.
Last modified on August 20, 2026