Mint a workspace Agent token
POST
/v1/workspaces/{workspaceId}/agent-tokens
const url = 'https://shareout.site/v1/workspaces/example/agent-tokens';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","scopes":["artifacts:read"],"expires_at":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” workspaceId
required
string
Workspace ID or slug.
Request Body required
Section titled “Request Body required ” Media type application/json
object
name
required
Human label, e.g. “CI bot”.
string
scopes
required
Array<string>
expires_at
Optional ISO datetime; omit for no expiry.
string
Responses
Section titled “ Responses ”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