Skip to main content
Version: Next

Tokens

Available API Paths


/api/projects/{projectId}/tokens/{tokenId}

The following methods are available for this path:

DELETE

Deletes project token specified by passed token id.

Parameters

NameLocationTypeDescription
projectIdpathstringA project id
tokenIdpathstringA token id
Responses

Status Description Response Content or Scheme
200 Flag indicating if deletion was successful or not.
401 Unauthorized request error
{
"message": {
"type": "string",
"description": "A descriptive error message"
},
"code": {
"type": "string",
"description": "A textual error code"
},
"status": {
"type": "integer",
"description": "A corresponding HTML status code"
},
"info": {
"type": "object",
"description": "An optional info object containing error dependent information"
}
}
403 Request is not allowed error
{
"message": {
"type": "string",
"description": "A descriptive error message"
},
"code": {
"type": "string",
"description": "A textual error code"
},
"status": {
"type": "integer",
"description": "A corresponding HTML status code"
},
"info": {
"type": "object",
"description": "An optional info object containing error dependent information"
}
}
404 Resource is not found error
{
"message": {
"type": "string",
"description": "A descriptive error message"
},
"code": {
"type": "string",
"description": "A textual error code"
},
"status": {
"type": "integer",
"description": "A corresponding HTML status code"
},
"info": {
"type": "object",
"description": "An optional info object containing error dependent information"
}
}
500 Internal server error
{
"message": {
"type": "string",
"description": "A descriptive error message"
},
"code": {
"type": "string",
"description": "A textual error code"
},
"status": {
"type": "integer",
"description": "A corresponding HTML status code"
},
"info": {
"type": "object",
"description": "An optional info object containing error dependent information"
}
}

/api/projects/{projectId}/tokens

The following methods are available for this path:

GET

Returns a list of all currently available project tokens.

Parameters

NameLocationTypeDescription
projectIdpathstringA project id
Responses

Status Description Response Content or Scheme
200 A list of project tokens.
401 Unauthorized request error
{
"message": {
"type": "string",
"description": "A descriptive error message"
},
"code": {
"type": "string",
"description": "A textual error code"
},
"status": {
"type": "integer",
"description": "A corresponding HTML status code"
},
"info": {
"type": "object",
"description": "An optional info object containing error dependent information"
}
}
403 Request is not allowed error
{
"message": {
"type": "string",
"description": "A descriptive error message"
},
"code": {
"type": "string",
"description": "A textual error code"
},
"status": {
"type": "integer",
"description": "A corresponding HTML status code"
},
"info": {
"type": "object",
"description": "An optional info object containing error dependent information"
}
}
404 Resource is not found error
{
"message": {
"type": "string",
"description": "A descriptive error message"
},
"code": {
"type": "string",
"description": "A textual error code"
},
"status": {
"type": "integer",
"description": "A corresponding HTML status code"
},
"info": {
"type": "object",
"description": "An optional info object containing error dependent information"
}
}
500 Internal server error
{
"message": {
"type": "string",
"description": "A descriptive error message"
},
"code": {
"type": "string",
"description": "A textual error code"
},
"status": {
"type": "integer",
"description": "A corresponding HTML status code"
},
"info": {
"type": "object",
"description": "An optional info object containing error dependent information"
}
}

POST

Creates a new project token with given name and valid date.

Parameters

NameLocationTypeDescription
projectIdpathstringA project id
Request Body

Name Location Type Description
body body object Properties:

{
"name": {
"type": "string"
},
"role": {
"type": "string",
"enum": [
"admin",
"editor",
"viewer"
]
},
"brokers": {
"type": "array",
"items": {
"type": "string"
}
},
"type": {
"type": "string",
"enum": [
"restricted",
"unrestricted"
]
},
"valid_date": {
"type": "string"
}
}
Responses

Status Description Response Content or Scheme
200 The newly created token.
{
"id": {
"type": "string"
},
"project_id": {
"type": "string"
},
"role_id": {
"type": "string",
"enum": [
"admin",
"editor",
"root",
"viewer"
]
},
"issuer": {
"type": "string"
},
"name": {
"type": "string"
},
"hash": {
"type": "string"
},
"issue_date": {
"type": "number"
},
"valid_date": {
"type": "number"
},
"last_used_date": {
"type": "number"
},
"brokers": {
"type": "array",
"items": {
"type": "string"
}
},
"type": {
"type": "string",
"enum": [
"restricted",
"unrestricted"
]
},
"token": {
"type": "string"
}
}
401 Unauthorized request error
{
"message": {
"type": "string",
"description": "A descriptive error message"
},
"code": {
"type": "string",
"description": "A textual error code"
},
"status": {
"type": "integer",
"description": "A corresponding HTML status code"
},
"info": {
"type": "object",
"description": "An optional info object containing error dependent information"
}
}
403 Request is not allowed error
{
"message": {
"type": "string",
"description": "A descriptive error message"
},
"code": {
"type": "string",
"description": "A textual error code"
},
"status": {
"type": "integer",
"description": "A corresponding HTML status code"
},
"info": {
"type": "object",
"description": "An optional info object containing error dependent information"
}
}
404 Resource is not found error
{
"message": {
"type": "string",
"description": "A descriptive error message"
},
"code": {
"type": "string",
"description": "A textual error code"
},
"status": {
"type": "integer",
"description": "A corresponding HTML status code"
},
"info": {
"type": "object",
"description": "An optional info object containing error dependent information"
}
}
500 Internal server error
{
"message": {
"type": "string",
"description": "A descriptive error message"
},
"code": {
"type": "string",
"description": "A textual error code"
},
"status": {
"type": "integer",
"description": "A corresponding HTML status code"
},
"info": {
"type": "object",
"description": "An optional info object containing error dependent information"
}
}