Welcome to the new Golem Cloud Docs! 👋
Documentation
Token

Token API

The token API is only available for Golem Cloud.

The token API allows creating custom access tokens for the Golem Cloud REST API to be used by tools and services.

Get all tokens

PathMethodProtected
/v2/accounts/{account_id}/tokensGETYes

Gets all created tokens of an account. The format of each element is the same as the data object in the oauth2 endpoint's response.

Example Response JSON

[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "accountId": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "expiresAt": "2019-08-24T14:15:22Z"
  }
]

Create new token

PathMethodProtected
/v2/accounts/{account_id}/tokensPOSTYes

Creates a new token with a given expiration date. The response not only contains the token data but also the secret which can be passed as a bearer token to the Authorization header to the Golem Cloud REST API.

Example Request JSON

{
  "expiresAt": "2019-08-24T14:15:22Z"
}

Example Response JSON

{
  "data": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "accountId": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "expiresAt": "2019-08-24T14:15:22Z"
  },
  "secret": {
    "value": "a860a344-d7b2-406e-828e-8d442f23f344"
  }
}

Get a specific token

PathMethodProtected
/v2/accounts/{account_id}/tokens/{token_id}GETYes

Gets information about a token given by it's identifier. The JSON is the same as the data object in the oauth2 endpoint's response.

Example Response JSON

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "accountId": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "expiresAt": "2019-08-24T14:15:22Z"
}

Delete a token

PathMethodProtected
/v2/accounts/{account_id}/tokens/{token_id}DELETEYes

Deletes a previously created token given by it's identifier.

Example Response JSON

{}

Token API Errors

Status CodeDescriptionBody
400Invalid request, returning with a list of issues detected in the request{"errors":["string"]}
401Unauthorized{"error":"string"}
404Token not found{"error":"string"}
500Internal server error{"error":"string"}