Skip to content

Authentication and scopes

Create a personal API token with only the access your script needs.

Scripts and services call the API with a personal token. It acts as you, limited to the scopes, workspaces and repositories you give it, and never reaches more than you can.

Create a token

Link to this section

In Settings → Personal → Security, Read and write covers reading guides and feedback, sending session notes, generating guides, and managing webhooks. Choose Read only for a reader, or Custom to select individual capabilities. Then confirm with GitHub and copy the token, which appears once. If you go Back from GitHub before confirming, you can close the dialog or try again. If the token was already shown or the request expired, create a new token.

You can also sign in with theseus login and request the scopes a script needs. Replace example-team with your workspace:

theseus token create --name "Review reader" \
  --scope read \
  --workspace example-team \
  --expires-in-days 30

Approve the request in the browser. The CLI prints the secret once, starting with ths_pat_; Theseus keeps only its hash, so store it in your secret store straight away. --expires-in-days takes 1 to 365 and defaults to 90. Without --workspace, the token reaches the workspace this machine has selected.

Restrict the token to one repository

Link to this section

By default a token reaches every repository you can access in its workspaces. To limit it, look up the repository's Theseus ID from a PR Theseus already knows:

theseus changeset status example/project#42 --json

Add --repository with the repository.id from the result (rep_…, not owner/repo) to the create command. Repeat it for more repositories. If Theseus doesn't know the PR yet, generate a guide for it once.

ScopeAllows
readRead changesets, guides, reviews, events and search
notes:writeSend session notes
runs:writeGenerate guides
webhooks:manageCreate and manage integrations and their deliveries
cli:downloadDownload staff preview CLI releases; stable releases are public

Repeat --scope to add more than one. Each operation in the API reference names the scope it needs. webhooks:manage also needs an owner or admin role in the workspace and a plan that includes integrations.

Load the secret into THESEUS_API_TOKEN and send it as a bearer token:

curl --fail-with-body \
  -H "Authorization: Bearer $THESEUS_API_TOKEN" \
  https://app.theseus.dev/api/v1/me

The response names your account and the workspaces the token reaches. Send the token only in the header, never in a URL.

Read a guide as Markdown

Link to this section

A coding agent can read a guide without MCP or the CLI. Add .md to the pull request's Theseus link and send a token that has the read scope:

curl --fail-with-body \
  -H "Authorization: Bearer $THESEUS_API_TOKEN" \
  https://example-team.theseus.dev/example/project/pr/42.md

The response is the latest ready guide: its summary, unknowns, rollout plan and every change with its explanation. A link with ?version= reads that guide instead, as in …/pr/42.md?version=ver_…. A change's link with .md added, such as …/pr/42/change-1.md, reads that change with its files and focused diff. Each response prints these .md links, pinned to the guide it read. For a branch whose name ends in .md, add a second .md.

The token is checked as it is for the API, so a request without one gets 401 unauthenticated, and a pull request you can't open is 404 not_found. A browser cookie doesn't work here, and a browser that opens a .md link gets the web app.

List and revoke tokens

Link to this section
theseus token list
theseus token revoke lgn_YOUR_ID

Use the ID from theseus token list. Revoking stops the token at once. To rotate, create the new token, switch your service to it, then revoke the old one.

Managing tokens needs your CLI or browser sign-in; a personal token can't create, list or revoke tokens.

If a request is refused

Link to this section
ErrorCheck
unauthenticatedThe token is present, unexpired and not revoked
insufficient_scopeThe token has the scope in required_scope. With no required_scope, the operation needs a CLI or browser sign-in
admission_requiredYou can read a repository in a Theseus workspace on GitHub, or your request is approved
not_foundThe token's workspaces and repositories, your current workspace membership, and your GitHub access