CentralCSP
APIAPI Keys

Get an API key

Returns one key's details, without its secret.

Requires the admin role on the workspace and the api_keys plan feature.

GET
/v1/workspaces/{workspaceId}/api-keys/{apiKeyId}

Authorization

headerAuthorizationBearer <JWT>

An OpenID Connect access token from signing in to CentralCSP, acting as the signed-in user.

Path Parameters

workspaceId*string

The workspace's id.

apiKeyId*string

The API key's id. Not the secret.

Response Body

An API key.

application/json
  1. response
id*string

Unique identifier of the key.

workspaceId*string

The only workspace this key can reach.

name*string

Display name.

prefix*string

First characters of the key, enough to tell keys apart in a list.

createdBy*string

The user this key acts as when it makes requests.

createdByUser*|

Profile of the user who created the key.

allowedIps*array<string>|

IP addresses and CIDR ranges the key may be used from, or null when it works from anywhere.

expiresAt*|

When the key stops working, or null when it never does.

lastUsedAt*|

When the key was last used, or null if never. Can lag by up to a minute.

createdAt*string

When the key was created.

Formatdate-time
updatedAt*string

When the key was last changed.

Formatdate-time
Example Request
curl -X GET 'https://api.centralcsp.com/v1/workspaces/01936b7a-6f2e-7c31-9a4d-2f8e1c5b7d90/api-keys/01936b7a-6f2e-7c31-9a4d-2f8e1c5b7d90'
Example Response
{  "id": "string",  "workspaceId": "string",  "name": "CI pipeline",  "prefix": "ccsp_a1",  "createdBy": "string",  "createdByUser": {    "id": "string",    "email": "string",    "firstName": "string",    "lastName": "string",    "picture": "string"  },  "allowedIps": [    "string"  ],  "expiresAt": "2019-08-24T14:15:22Z",  "lastUsedAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}