{{define "content"}}

API tokens

Non-interactive credentials for /api/v1. They authenticate programs, not people.

{{if .NewSecret}}

Your new token{{if .NewName}}: {{.NewName}}{{end}}

This is the only time it will be shown. Relata stores only a hash of it and cannot show it again. Copy it now.

{{.NewSecret}}

The value exists only in this response and is not included in the page URL. Copy it before navigating away; refreshing the page will not recover the same secret.

{{end}}

Create a token

So you can tell your tokens apart later.

Scopes {{range .Scopes}} {{end}}

Grant only what the program needs. Scopes narrow permission; they never widen it.

Maximum {{.MaxTTL}} days. A token stops working at its expiry with no further action.

Back to settings

Your tokens

{{if .Tokens}} {{range .Tokens}} {{end}}
NamePrefixScopes CreatedExpiresLast usedStatus
{{.Token.Name}} {{.Token.Prefix}}… {{.Scopes}} {{.Token.CreatedAt.Format "2 Jan 2006"}} {{if .Token.ExpiresAt.IsZero}}never{{else}}{{.Token.ExpiresAt.Format "2 Jan 2006"}}{{end}} {{if .Token.LastUsedAt}}{{.Token.LastUsedAt.Format "2 Jan 2006 15:04"}}{{else}}never{{end}} {{.Status}} {{if not .Revoked}}
{{end}}

Revoked and expired tokens stay listed. Hiding them would make this page a worse record of what existed than the audit log.

{{else}}

You have no API tokens. Create one above to use the API.

{{end}}

Using a token

curl -H "Authorization: Bearer $RELATA_TOKEN" \
  '{{"https://your-host/api/v1/search?q=delivery"}}'

Send it in the Authorization header only — never in a query parameter, where it would end up in access logs, browser history and referrer headers. Full API description.

{{end}}