Skip to Content
Projects API Tokens

Get details of a specific project API token.

GET
/projects/{project_id}/tokens/{token_id}

Path Parameters

project_id*integer

The ID of the project.

Range1 <= value
token_id*string

The ID of the token.

Header Parameters

Accept*string

application/json

Authorization*string

Bearer {{access_token}}

Content-Type*string

application/json

Response Body

Ok

application/json
  1. response
id*string

Unique identifier of the Token

name*string

Name of the Token

type*ApiTokenType

The types of API Tokens.

Value in"personal_access_token""project_api_token"
token*|

The plain text value of the Token. The API token value is only displayed/returned once when the token is generated. Users must keep it in a safe place, as it cannot be retrieved again at a later time.

status*ApiTokenStatus

The possible status of API tokens.

Value in"active""expired""revoked"
role*|null
project*|null
last_used_at*|

Last time the Token was used

expires_at*string

Expiration date of the Token

revoked_at*|

Revocation date of the Token

updated_at*string

Last time the Token was updated

created_at*string

Creation date of the Token

Example Request
curl -X GET 'https://api.devopness.com/projects/123/tokens/2ab973e1-9528-4d67-aff0-209d74975830' \  -H 'Accept: application/json' \  -H 'Authorization: Bearer <your_api_token>' \  -H 'Content-Type: application/json'
Example Response
{  "id": "e70e75cb-7922-47d2-a071-54b7d7ede4be",  "name": "My Token",  "type": "personal_access_token",  "token": null,  "status": "active",  "role": {    "id": 45678,    "name": "admin",    "description": "Has total access to resources",    "is_predefined": false,    "permissions": [      "application:read",      "application:create",      "server:read"    ],    "organization": {      "id": 16523,      "name": "My Organization",      "url_slug": "MyOrganization",      "resource_summary": [        {          "resource_type": "environment",          "resource_type_plural": "environments",          "resource_type_human_readable": "Environment",          "resource_type_human_readable_plural": "Environments",          "summary": {            "count": 1          }        }      ],      "owner": {        "id": 1,        "name": "string",        "email": "user@example.com",        "url_slug": "someone",        "language": "en",        "active": true,        "created_at": "2019-09-25T15:50:48.000000Z",        "updated_at": "2019-09-25T13:52:04.000000Z"      },      "created_at": "2019-09-25T15:50:48.000000Z",      "updated_at": "2019-09-25T13:52:04.000000Z"    },    "created_by_user": {      "id": 1,      "name": "string",      "email": "user@example.com",      "url_slug": "someone",      "language": "en",      "active": true,      "created_at": "2019-09-25T15:50:48.000000Z",      "updated_at": "2019-09-25T13:52:04.000000Z"    },    "created_at": "2019-09-25T13:22:37.000000Z",    "updated_at": "2019-09-25T13:22:37.000000Z"  },  "project": {    "id": 45678,    "user_id": 984123,    "name": "my project",    "logo_url": "https://example.com/projects-beautiful-logo.png",    "resource_summary": [      {        "resource_type": "environment",        "resource_type_plural": "environments",        "resource_type_human_readable": "Environment",        "resource_type_human_readable_plural": "Environments",        "summary": {          "count": 1        }      }    ],    "os_users": [      {        "name": "devopness"      }    ],    "organization": {      "id": 16523,      "name": "My Organization",      "url_slug": "MyOrganization",      "resource_summary": [        {          "resource_type": "environment",          "resource_type_plural": "environments",          "resource_type_human_readable": "Environment",          "resource_type_human_readable_plural": "Environments",          "summary": {            "count": 1          }        }      ],      "owner": {        "id": 1,        "name": "string",        "email": "user@example.com",        "url_slug": "someone",        "language": "en",        "active": true,        "created_at": "2019-09-25T15:50:48.000000Z",        "updated_at": "2019-09-25T13:52:04.000000Z"      },      "created_at": "2019-09-25T15:50:48.000000Z",      "updated_at": "2019-09-25T13:52:04.000000Z"    },    "created_by_user": {      "id": 1,      "name": "string",      "email": "user@example.com",      "url_slug": "someone",      "language": "en",      "active": true,      "created_at": "2019-09-25T15:50:48.000000Z",      "updated_at": "2019-09-25T13:52:04.000000Z"    },    "used_credits": 123,    "created_at": "2022-09-26T15:30:31.000000Z",    "updated_at": "2022-09-26T15:30:58.000000Z"  },  "last_used_at": "2023-01-01T00:00:00Z",  "expires_at": "2023-12-31T23:59:59Z",  "revoked_at": null,  "updated_at": "2023-01-01T00:00:00Z",  "created_at": "2023-01-01T00:00:00Z"}