Create an access token for a user
POST/v1/users/:username/tokens
Create an access token for a user
Request
Path Parameters
target user's name
- application/json
Body
required
token expiration in seconds
Possible values: >= 300
and <= 31536000
Possible values: non-empty
and <= 255 characters
Possible values: [read_write
, read_scaling
]
read_write
Responses
- 200
- 400
- 401
- 403
- 404
- 500
Successful response
- application/json
- Schema
- Example (from schema)
Schema
access token
Time token expires at
Time token was originally created
Possible values: [read_write
, read_scaling
]
{
"token": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"expire_at": "string",
"created_ts": "string",
"read_only": true,
"token_type": "read_write"
}
Bad Request
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
The error message
Bad Request
The error code
BAD_REQUEST
issues
object[]
An array of issues that were responsible for the error
{
"code": "BAD_REQUEST",
"message": "Bad Request",
"issues": []
}
Invalid Credentials
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
The error message
Invalid Credentials
The error code
UNAUTHORIZED
issues
object[]
An array of issues that were responsible for the error
{
"code": "UNAUTHORIZED",
"message": "Invalid Credentials",
"issues": []
}
Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
The error message
Unauthorized
The error code
FORBIDDEN
issues
object[]
An array of issues that were responsible for the error
{
"code": "FORBIDDEN",
"message": "Unauthorized",
"issues": []
}
Not Found
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
The error message
Not Found
The error code
NOT_FOUND
issues
object[]
An array of issues that were responsible for the error
{
"code": "NOT_FOUND",
"message": "Not Found",
"issues": []
}
Internal Error
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
The error message
Internal Error
The error code
INTERNAL_SERVER_ERROR
issues
object[]
An array of issues that were responsible for the error
{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal Error",
"issues": []
}