Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel2
maxLevel2
outlinefalse
typeflat
separatorbrackets
printabletrue

...

Endpoints and methods

Description

Status
colourYellow
titleGET
 /v2/accounts/{accountName}/tokens see below

Get a list of all the tokens for the provided account.

Status
colourYellow
titleGET
/v2/accounts/{accountName}/tokens/{tokenId} see below

Returns all the information of a single token, including the actual token.

Status
colourGreen
titlePOST
/v2/accounts/{accountName}/tokens see below

Create a new token.

Status
colourBlue
titlePUT
/v2/accounts/{accountName}/tokens/{tokenId}/enable see below

Enable a token.

Status
colourBlue
titlePUT
/v2/accounts/{accountName}/tokens/{tokenId}/disable see below

Disable a token.

Status
colourBlue
titlePUT
/v2/accounts/{accountName}/tokens/{tokenId}/rename see below

Change the name associated with a token.

Status
colourRed
titleDELETE
/v2/accounts/{accountName}/tokens/{tokenId} see below

Delete a token.

Endpoints and methods

Anchor

...

getList

...

getList
GET /v2/accounts/{accountName}/tokens

Lists all the tokens for the provided account. This endpoint returns the information about the tokens and their IDs, but NOT the tokens themselves for security.

Expand
titleRequest

Path parameters

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

accountName required

string

The name of the account.

Find below a request example:

Code Block
https://api-us.devo.com/xxx/v2/accounts/sampleAccount/tokens
Expand
titleResponse

Code

Description

200

Successful response. List of tokens retrieved.

Code Block
[
  {
    "name": "a",
    "id": 1,
    "scope": "table://*.** level://admin",
    "owner": "web-testing+auto-admin@devo.com",
    "user": "web-testing+auto-admin@devo.com",
    "audience": "apiv2-admin aggregations apiv2",
    "token_type": "Bearer",
    "active": true,
    "expiration": "2024-11-26T14:38:18.000+0000",
    "account": "sampleAccount",
    "created": "2024-11-25T14:38:18.000+0000",
    "updated": "2024-11-25T14:38:18.000+0000",
    "expires_in_seconds": 86400
  },
  {
    "name": "b",
    "id": 2,
    "scope": "table://*.** level://admin",
    "owner": "web-testing+auto-admin@devo.com",
    "user": "web-testing+auto-admin@devo.com",
    "audience": "apiv2-admin aggregations apiv2",
    "token_type": "Bearer",
    "active": true,
    "expiration": "2024-11-26T14:38:18.000+0000",
    "account": "sampleAccount",
    "created": "2024-11-25T14:38:18.000+0000",
    "updated": "2024-11-25T14:38:18.000+0000",
    "expires_in_seconds": 86400
  }
]

4xx

Bad request.

Code Block
{
  "error": {
    "code": 4xx,
    "message": "string"
  }
}

...

Anchor

...

getToken

...

getToken
GET /v2/accounts/{accountName}/tokens/{tokenId}

Returns the full information on a single token, identified by its ID. The response to this request includes the actual token.

Expand
titleRequest

Path parameters

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

accountName required

string

The name of the account.

tokenId required

string

The ID of the token.

Find below a request example:

Code Block
https://api-us.devo.com/xxx/v2/accounts/sampleAccount/tokens/3
Expand
titleResponse

Code

Description

200

Successful response. Token retrieved.

Code Block
{
  "name": "test",
  "id": 3,
  "scope": "table://*.** level://admin",
  "owner": "web-testing+auto-admin@devo.com",
  "user": "web-testing+auto-admin@devo.com",
  "audience": "apiv2-admin aggregations apiv2",
  "token_type": "Bearer",
  "active": true,
  "expiration": "2024-11-26T14:38:18.000+0000",
  "token": "31089320378051f1a2ee17c14028f056",
  "account": "sampleAccount",
  "created": "2024-11-25T14:38:18.000+0000",
  "updated": "2024-11-25T14:38:18.000+0000",
  "expires_in_seconds": 86400
}

4xx

Bad request.

Code Block
{
  "error": {
    "code": 4xx,
    "message": "string"
  }
}

...

Anchor

...

createToken

...

createToken
POST/v2/accounts/{accountName}/tokens

Creates a new token.

Expand
titleRequest

Path parameters

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

accountName required

string

The name of the account.

Payload:

Code Block
{
  "name": "string",
  "owner": "email",
  "user": "email",
  "audience": "string",
  "scopes": "string",
  "expiresInSeconds": 86400
}
  • name is optional, and defaults to 'Unnamed' when not present.

  • user is optional and only required when a user is creating a token on behalf of another user. The credentials are resolved for the value of this field (which defaults to the owner when not present).

  • audience is required (samples: apiv2, apiv2-admin, alerts, aggregations, http).

  • scopes is optional and defaults to 'default' when not present.

  • expiresInSeconds is optional and defaults to 86400 when not present. Use the value -1 to create a permanent token.

Find below a request example:

Code Block
https://api-us.devo.com/xxx/v2/accounts/sampleAccount/tokens

...

Info

Creating a token returns the location header with the URI where the resource can be located.

...

Anchor

...

enableToken

...

enableToken
PUT/v2/accounts/{accountName}/tokens/{tokenId}/enable

Enable token by ID

Expand
titleRequest

Path parameters

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

accountName required

string

The name of the account.

tokenId required

string

The ID of the token.

Find below a request example:

Code Block
https://api-us.devo.com/xxx/v2/accounts/sampleAccount/tokens/3/enable
Expand
titleResponse

Code

Description

200

Successful response. Token enabled.

4xx

Bad request.

Code Block
{
  "error": {
    "code": 4xx,
    "message": "string"
  }
}

...

Anchor
path11
path11
PUT/v2/accounts/{accountName}/tokens/{tokenId}/disable

...

Expand
titleRequest

Path parameters

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

accountName required

string

The name of the account.

tokenId required

string

The ID of the token.

Find below a request example:

Code Block
https://api-us.devo.com/xxx/v2/accounts/sampleAccount/tokens/3/disable
Expand
titleResponse

Code

Description

200

Successful response. Token disabled.

4xx

Bad request.

Code Block
{
  "error": {
    "code": 4xx,
    "message": "string"
  }
}

...

Anchor

...

renameToken

...

renameToken
PUT/v2/accounts/{accountName}/tokens/{tokenId}/rename

Enable token by ID

Expand
titleRequest

Path parameters

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

accountName required

string

The name of the account.

tokenId required

string

The ID of the token.

Payload:

Code Block
{
  "value": "your new token name"
}

If the new name is empty or null, the service will still return OK, but the token name will remain unchanged.

Find below a request example:

Code Block
https://api-us.devo.com/xxx/v2/accounts/sampleAccount/tokens/3/rename
Expand
titleResponse

Code

Description

200

Successful response. Token renamed.

4xx

Bad request.

Code Block
{
  "error": {
    "code": 4xx,
    "message": "string"
  }
}

...

Anchor

...

deleteToken

...

deleteToken
DELETE/v2/accounts/{accountName}/tokens/{tokenId}

Deletes a token from an account.

...

Expand
titleRequest

Path parameters

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

accountName required

string

The name of the account.

tokenId required

string

The ID of the token.

Find below a request example:

Code Block
https://api-us.devo.com/xxx/v2/accounts/sampleAccount/tokens/3

...