Get the apiKeyId

This is for:

System Administrator
In this article

The apiKeyId is a required parameter in any Coveo REST API operation that interacts with a single specific API key.

Use the Get all API keys for this organization operation to find the apiKeyId of an API key in a specific Coveo organization.

Request template

GET https://platform.cloud.coveo.com/rest/organizations/<MyOrganizationId>/apikeys HTTP/1.1

Accept: application/json
Authorization: Bearer <MyAccessToken>

In the request path, replace <MyOrganizationId> with your organization ID.

In the Authorization HTTP header, replace <MyAccessToken> with an access token (API key or OAuth2 token) that grants you the privilege to view API keys in the target organization. See Get your Coveo access token and Get the privileges of an access token.

Note

It’s impossible to authenticate this call using an API key, since an API key can’t have the privilege to edit or view other API keys.

The body of a successful response contains information about all API keys in the target Coveo organization, if not already done.

To get the apiKeyId, check the response body for the displayName or description of the desired API key. The apiKeyId is located under the id property of that API key object.

Note

The only time you can get the full unmasked value property of an API key is when you initially create that key.

Sample request

Getting information about all API keys in a specific Coveo organization

GET https://platform.cloud.coveo.com/rest/organizations/mycoveocloudv2organizationg8tp8wu3/apikeys HTTP/1.1

Accept: application/json
Authorization: Bearer **********-****-****-****-************

Successful response - 200 OK

[
  {
    "id": "wduuqg3ip2c3i3gpopapxhcgxe", 1
    "value": "**********-****-****-****-********1b3e",
    "organizationId": "mycoveocloudv2organization",
    "displayName": "My Source API Key",
    "description": "An API key to edit and view sources.",
    ...
  },
  ...
]
1 The apiKeyId of the My Source API Key API key.