tokens
Create token
Changed onCreates a first-party API token. Omit user_id (or set it to the caller's ID) to create a token for yourself. Set user_id to a service user's ID to mint a token that authenticates as that service user. Creating a token for another human user is not allowed.
The signed_token value in the response is the secret credential and is only returned once at creation time.
post/tokens
Request
- Base URLhttps://api.opal.dev/v1
- AuthHTTP bearer
Request body
Example request
{
"token_label": "My API Token",
"user_id": "d4a7d928-783e-4599-8ec6-088d635a5bcc",
"expires_at": "2023-01-23T04:56:07Z"
}Response
The created API token. signed_token is only returned on creation.
Example response
{
"token": {
"token_id": "f454d283-ca87-4a8a-bdbb-df212eca5353",
"created_at": "2022-01-23T04:56:07Z",
"token_preview": "ab123",
"token_label": "My API Token",
"creator_user_id": "d4a7d928-783e-4599-8ec6-088d635a5bcc",
"user_id": "d4a7d928-783e-4599-8ec6-088d635a5bcc",
"access_level": "READ_ONLY"
},
"signed_token": "opal_pat_abc123..."
}Changes
- info
endpoint added
- info