docs/hosting/tokens.md
import reflex as rx
A Reflex token authenticates CLI and API requests. Tokens created from the Builder are scoped to the selected organization, and their project scope and resource permissions limit what they can access.
The token is still owned by the person who creates it. For long-running automation that should not depend on a person's membership, use an organization-owned service account.
rx.image(
src="https://web.reflex-assets.dev/docs-preview/hosting/tokens.webp",
alt="Organization-scoped Reflex tokens with expiration and access details",
class_name="rounded-md h-auto mb-4",
border=f"0.81px solid {rx.color('slate', 5)}",
)
rx.image(
src="https://web.reflex-assets.dev/docs-preview/hosting/token_create.webp",
alt="Creating a Reflex token with an expiration and access template",
class_name="rounded-md h-auto mb-4",
border=f"0.81px solid {rx.color('slate', 5)}",
)
Templates provide a safe starting point that you can adjust:
| Template | Starting access |
|---|---|
| CI / auth only | Authentication only, with no resource access |
| Deploy | Read and write access to Projects and Apps so the token can create and deploy apps |
| Full access | Read and write access to every resource group |
Review the resulting permissions before creating the token instead of assuming a template fits every workflow.
Choose which projects the project-scoped permissions cover:
The project selection applies to Projects, Apps, and Threads. Organization permission is organization-wide.
Each resource group supports No access, Read-only, or Read & write:
| Resource | What it covers |
|---|---|
| Projects | Project settings, members, audit logs, and deletion |
| Apps | Viewing, editing, deploying, starting, stopping, and deleting deployed apps |
| Threads | Conversations and their generated code and secrets |
| Organization | Organization members, billing, and creating projects or teams |
Use a token with commands that support --token, or set the recognized REFLEX_ACCESS_TOKEN environment variable.
export REFLEX_ACCESS_TOKEN="<token>"
reflex cloud scan --no-interactive
Because a token is owned by its creator, it may stop being suitable when that person changes roles or leaves the organization. Use a service account for organization-owned automation.