Collect an approved token
Collect the token a request created, once
POST /api/v1/token-requests/{id}/collect
CLI sign-in required · personal tokens cannot manage tokens
Needs a sign-in (theseus login); a personal token gets insufficient_scope.
Example request
Link to this section# Token management needs a CLI sign-in; personal tokens cannot do it.
# token create handles browser approval and collection.
theseus token create --name "Review reader" --scope read --workspace example-teamParameters
Link to this section| Name | In | Type | Description |
|---|---|---|---|
id required | path | string |
Responses
Link to this sectionStill waiting, or the new token with its secret
Response fields
Content type application/json
One of:
Pending approval
idstring requiredstatusstring requiredAlways
pending
Token issued
idstring requiredstatusstring requiredAlways
completetokenToken requiredtoken fields
idstring requiredThe token’s ID, which is not its secret
namestring requiredscopesarray of string requiredWhat the token may do. New scopes may be added
workspacesarray of string requiredThe only workspaces it can reach
repositoriesarray of string or null requiredThe only repositories it can reach; null for every one in its workspaces
created_atstring (date-time) requiredexpires_atstring (date-time) requiredlast_used_atstring (date-time) required
secretstring requiredThe token itself,
ths_pat_…. Returned once; Theseus keeps only its hash
Example responses
Link to this sectionIllustrative response · complete
{
"id": "hnd_EXAMPLE",
"status": "pending"
}Illustrative response · selected fields
{
"id": "hnd_EXAMPLE",
"status": "complete",
"token": {
"id": "lgn_EXAMPLE",
"name": "Review reader",
"scopes": [
"read"
],
"workspaces": [
"wsp_EXAMPLE"
],
"repositories": null
},
"secret": "<issued-token-secret-shown-once>"
}Errors
Link to this section401 · A valid bearer token is required
403 · The credential's scopes do not allow this
404 · Not found
426 · Upgrade the CLI: run theseus update
429 · Too many requests
Headers
Retry-AfterintegerSeconds to wait before the next request, when known
500 · Theseus could not complete the request; retrying will not help
503 · Theseus is unavailable; retry the same request
Headers
Retry-AfterintegerSeconds to wait before the next request, when known
Error response fields
Content type application/problem+json
typestring (uri) requiredIdentifies the problem type; branch on
codeinsteadtitlestring requiredstatusinteger requireddetailstringcodestring requiredWhy the request failed. New codes may be added: treat an unknown one by its status
One of
invalid_request,unauthenticated,not_in_plan,insufficient_scope,admission_required,not_found,ambiguous,conflict,rate_limited,internal_error,unavailable,search_authorization_pending,search_unavailable,cli_upgrade_requiredrequest_idstring requiredQuote this when reporting the problem
errorsarray of FieldErrorWith
invalid_request: what is wrong with each fielderrors fields
pathstring requiredWhere in the request, as dotted segments
messagestring required
required_scopestringWith
insufficient_scope: the scope the operation needsnextstringRecovery action, such as theseus update
candidatesarray of CandidateWith
ambiguous: what the request could mean; ask whichcandidates fields
idstring requiredpathstring requiredkindstring requiredtitlestring requiredurlstring (uri) required