---
title: API Tokens tab
description: Create and manage tokens for programmatic access to Prefactor.
editUrl: true
head: []
template: doc
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

API tokens are how your SDKs and scripts authenticate with Prefactor. Account-wide tokens grant access to all agents in the account; deployment-scoped tokens are narrower and embed the agent identity.

All tokens associated with the account appear in this tab.

## Tokens table

Each row is a single **Token** cell stacked with:

- A status badge: **Active** (authenticates API calls), **Suspended** (authentication disabled but recoverable), or **Revoked** (permanently invalidated).
- The token's scope: **Account**, **Environment (<environment name>)**, or **Agent deployment (<agent name> · <environment name>)**.
- **Created** – when the token was created.
- **Expires** – when the token expires.
- **Last used** – the last time the token was used in an API request, or *Never*.
- **Created by** – the user who generated the token.

A row action menu sits beside the cell. Available actions depend on the token's current state:

- **Suspend** – on an active token. Disables it without deleting it.
- **Activate** – on a suspended token. Re-enables it.
- **Revoke** – on an active or suspended token. Permanently invalidates it. A revoked token cannot be re-enabled.
- **Delete** – on a revoked token. Removes the row.

## Creating a token

Token creation from this page produces account-wide tokens only.

1. Select **Create API token**.
2. Copy the token value when shown -- it is only displayed once.

To create a deployment-scoped token, open the agent's [Agent › Deployments tab](/admin-ui/agent/deployments) and use **Create deployment token** there.

Environment-scoped tokens may appear in the table if they were created programmatically or through a legacy flow. There is no interface on this page to create new environment-scoped tokens.

## Using a token with the SDK

Pass the token as `PREFACTOR_API_TOKEN` in your environment, or set `apiToken` in the SDK config directly. See [Configuration and environment variables](/sdks/configuration) for details.

## Related

- [API token](/platform/concepts/api-token) — what API tokens are, scoping, and how they authenticate requests.
- [Account page](/admin-ui/account) — how Account settings tabs fit together.
- [Agent page › Deployments tab](/admin-ui/agent/deployments) — deployment-scoped tokens for a single agent.
- [Configuration and environment variables](/sdks/configuration) — pass a token to the SDK via `PREFACTOR_API_TOKEN`.