API tokens schema

service.token.graphqls

This API is available in Enterprise and AWS editions only.

To authenticate API requests, you’ll need an API token. Learn how to generate an access token.

See usage examples in the cloudbeaver-graphql-examples repository.

You can try queries in the built-in GraphQL console, available on your server at https://your-server-address/api/gql/console. This tool lets you test requests directly from your browser.

For a live example, see the demo GraphQL console.

API Endpoints
https://your-server-address/api/gql

Queries

tokenApiList

Description

Returns list of user API tokens

Response

Returns [APITokenInfo!]!

Example

Query
query tokenApiList {
  tokenApiList {
    tokenName
    createTime
    expireTime
    createTimeAt
    expireTimeAt
  }
}
Response
{
  "data": {
    "tokenApiList": [
      {
        "tokenName": "<string>",
        "createTime": "<date>",
        "expireTime": "<date>",
        "createTimeAt": "<datetime>",
        "expireTimeAt": "<datetime>"
      }
    ]
  }
}

Mutations

tokenApiCreate

Description

Creates API token for user. You can specify token name and expiration time.

Response

Returns an APIFullTokenInfo!

Arguments
Name Description
tokenName - String!
expiresAt - DateTime

Example

Query
mutation tokenApiCreate(
  $tokenName: String!,
  $expiresAt: DateTime
) {
  tokenApiCreate(
    tokenName: $tokenName,
    expiresAt: $expiresAt
  ) {
    tokenName
    token
    createTime
    expireTime
    createTimeAt
    expireTimeAt
  }
}
Variables
{"tokenName": "<string>", "expiresAt": "<datetime>"}
Response
{
  "data": {
    "tokenApiCreate": {
      "tokenName": "<string>",
      "token": "<string>",
      "createTime": "<date>",
      "expireTime": "<date>",
      "createTimeAt": "<datetime>",
      "expireTimeAt": "<datetime>"
    }
  }
}

tokenApiDelete

Description

Deletes API token for user based on its name

Response

Returns a Boolean!

Arguments
Name Description
tokenName - String!

Example

Query
mutation tokenApiDelete($tokenName: String!) {
  tokenApiDelete(tokenName: $tokenName)
}
Variables
{"tokenName": "<string>"}
Response
{"data": {"tokenApiDelete": "<boolean>"}}

Types

APIFullTokenInfo

Fields
Field Name Description
tokenName - String!
token - String!
createTime - Date! Use createTimeAt argument instead (26.1.1)
expireTime - Date Use expireTimeAt argument instead (26.1.1)
createTimeAt - DateTime!
expireTimeAt - DateTime
Example
{
  "tokenName": "<string>",
  "token": "<string>",
  "createTime": "<date>",
  "expireTime": "<date>",
  "createTimeAt": "<datetime>",
  "expireTimeAt": "<datetime>"
}

APITokenInfo

Fields
Field Name Description
tokenName - String!
createTime - Date! Use createTimeAt argument instead (26.1.1)
expireTime - Date Use expireTimeAt argument instead (26.1.1)
createTimeAt - DateTime!
expireTimeAt - DateTime
Example
{
  "tokenName": "<string>",
  "createTime": "<date>",
  "expireTime": "<date>",
  "createTimeAt": "<datetime>",
  "expireTimeAt": "<datetime>"
}

Boolean

Description

The Boolean scalar type represents true or false.

Example
"<boolean>"

Date

Example
"<date>"

DateTime

Description

Date/Time

Example
"<datetime>"

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"<string>"