Skip to content

Mint a workspace Agent token

POST
/v1/workspaces/{workspaceId}/agent-tokens
curl --request POST \
--url https://shareout.site/v1/workspaces/example/agent-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "scopes": [ "artifacts:read" ], "expires_at": "example" }'

Mints a non-human, workspace-scoped Agent token (prefix sot_). Creates a headless service principal and adds it as a first-class workspace member that owns the artifacts it publishes. Plaintext token is returned exactly once. Owner/admin only.

workspaceId
required
string

Workspace ID or slug.

Media type application/json
object
name
required

Human label, e.g. “CI bot”.

string
scopes
required
Array<string>
>= 1 items
Allowed values: artifacts:read artifacts:publish data:read data:write
expires_at

Optional ISO datetime; omit for no expiry.

string
nullable

Token minted (plaintext shown once)

Media type application/json
object
ok
boolean
token
string
shown_once
boolean
token_id
string
principal_user_id
string
scopes
Array<string>
Example
{
"token": "sot_…"
}

Missing name or invalid scopes

Caller is not a workspace owner/admin