Skip to content

API token

An API token is the credential your integration uses to authenticate with Prefactor — it is how a running agent proves to the platform which account it belongs to and, in the case of a deployment token, which agent it is.

Tokens come in two forms with different scopes. Choosing the right one depends on what you need to identify at runtime.

An account token grants access to the whole account. Any SDK or script authenticated with one can send activity for any agent in the account and read data across all of them via the API. You pass the agent identity separately when using an account token — the token itself says nothing about which agent is running.

Account tokens are suited to scripts, CI pipelines, or administrative access where you need account-wide reach rather than agent-specific identity.

A deployment token is scoped to a single agent deployment — one agent in one environment. The agent identity is built into the token, so an SDK authenticated with one does not need to pass an agent identifier — Prefactor knows which agent the activity belongs to from the token alone. This is the recommended way to instrument a deployed agent, because it ties the running code to a specific agent and environment without any extra configuration.

Both token types go through the same lifecycle: Active tokens authenticate requests; a token can be Suspended (disabled but recoverable) or Revoked (permanently invalidated). Revoked tokens can then be deleted.

  • Account — tokens belong to an account and are managed from account settings.
  • Agent — deployment tokens carry the agent identity and are the recommended way to instrument a deployed agent.
  • Agent deployment — deployment tokens are issued for a specific agent deployment and carry its identity at runtime.
  • Environment — deployment tokens are scoped to one agent in one environment.