Skip to content

app.personal_access_tokens

TableRow level security on

Personal API tokens (Section 4.5.6 personal settings item 15): one person's token for one org, where the org allows them (developer.personal_tokens). The secret is shown once; only its SHA-256 hash is stored. A token acts as its person, narrowed to its scopes.

Primary key: id

Columns of app.personal_access_tokens
ColumnTypeNullableDescription
iduuidNoPrimary key, UUID v7.
org_iduuidNoOwning org. A row never moves to another org.References app.organizations.id
person_iduuidNoPerson the token acts as.References app.people.id
nametextNoToken name the person chose, for example Laptop scripts.
prefixtextNoVisible start of the secret (xos_pat_ and 8 hex digits), so people can tell tokens apart.
secret_hashbyteaNoSHA-256 of the full secret. Never readable by signed-in callers.
expires_attimestamp with time zoneNoWhen the token stops working. At most one year after creation.
last_used_attimestamp with time zoneYesWhen the token last authenticated a request, to the minute.
revoked_attimestamp with time zoneYesWhen the token was revoked; a revoked token never works again.
revoked_byuuidYesPerson who revoked the token: its owner or an org admin.References app.people.id
created_attimestamp with time zoneNoWhen the row was inserted. Set by the database.
created_byuuidYesPerson who inserted the row, or null for a platform process. Set by the database.References app.people.id
updated_attimestamp with time zoneNoWhen the row last changed. Set by the database.
updated_byuuidYesPerson who last changed the row, or null for a platform process. Set by the database.References app.people.id
deleted_attimestamp with time zoneYesSoft delete time. A row with deleted_at set is ignored by every access helper.