Skip to main content
POST
/
v2
/
XTokenCreateForRole
Create access token for role
curl --request POST \
  --url http://localhost:3000/v2/XTokenCreateForRole \
  --header 'Content-Type: application/json' \
  --header 'X-Bunker-Token: <api-key>' \
  --data '
{
  "roleid": 123,
  "rolename": "<string>",
  "finaltime": "<string>",
  "slidingtime": "<string>",
  "request_metadata": {}
}
'
{
  "status": "ok",
  "xtoken": "<string>"
}

Authorizations

X-Bunker-Token
string
header
required

API token for authentication

Body

application/json
roleid
integer

ID of the role

rolename
string

Name of the role

finaltime
string

Absolute expiration time for the token

slidingtime
string

Sliding time period for the token

request_metadata
object

Additional metadata for the request

Response

200 - application/json

Access token created successfully

status
string
Example:

"ok"

xtoken
string

The created access token