Authenticate with Webflow

Learn about authentication options for the Webflow CLI.

To access Webflow resources via the CLI, authenticate with your Webflow account. The CLI uses one workspace-scoped login flow.

ConceptDescriptionUsed by
Workspace authenticationDefault CLI login scoped to one workspace. Run webflow auth login once per project.All CLI commands
Site scopingChooses which site a command targets within your authenticated workspace.DevLink export, Webflow Cloud, and site-scoped API commands (sites, cms, assets, forms)

Workspace authentication

Authenticate with your Webflow workspace before running CLI commands:

$webflow auth login

This command opens your browser to authenticate with Webflow, where you select a workspace and grant access.

After authentication completes, the CLI creates or updates an .env file in your project’s root with a fresh WEBFLOW_API_TOKEN.

.env
$WEBFLOW_API_TOKEN=your-api-token
Include .env in your .gitignore file

Never commit your .env file to version control. Be sure to add .env to your .gitignore file.

If you run a command such as webflow devlink import without a saved token, the CLI opens the same browser login flow.

Site scoping

Commands that operate on a site pick the site from configuration or flags.

MethodWhen to use
siteId in webflow.jsonDevLink export, Webflow Cloud, and other project-level defaults
WEBFLOW_SITE_ID in .envSite default when siteId is not set in webflow.json
--site or --site-id flagsOne-off overrides on supported commands — see the command reference
Interactive promptsWhen no site is configured and the command supports prompting

Yes. One workspace token covers every site in that workspace. Use a different siteId in each project’s webflow.json, or pass --site when you run a command.

Non-interactive authentication (for CI/CD)

For automated environments like CI/CD pipelines, pass a Workspace API token with the --api-token flag or set WEBFLOW_API_TOKEN in your environment. This bypasses the browser login flow.

To target multiple workspaces, generate a unique Workspace API token for each workspace from your workspace settings.

Examples

$# Run a command in CI with an explicit token
$webflow devlink import --api-token <WORKSPACE_API_TOKEN> --no-input
$
$# Deploy the same library to a different workspace
$webflow devlink import --api-token <OTHER_WORKSPACE_API_TOKEN> --no-input

To work with multiple workspaces in CI/CD, create a Workspace API token for each workspace. Pass the token with --api-token or set WEBFLOW_API_TOKEN in your pipeline environment.

Any user in the workspace can authenticate via the CLI. Only Workspace Admins can create a Workspace API token from the settings page in the workspace dashboard.

Workspace API tokens provide access to workspace-specific resources via the Webflow Data API. Use them for non-interactive CLI runs in CI/CD pipelines.