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<MyOrganizationId>/apiKeys HTTP/1.1
Accept: application/json
Authorization: Bearer <MyAccessToken>

In the request path:

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).

    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 find the apiKeyId:

  1. In the response body, use the displayName or description parameter values to find the API key for which you want to get the apiKeyId.

  2. Copy for the id property value of the API key.

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

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

Successful response - 200 OK

    "id": "wduuqg3ip2c3i3gpopapxhcgxe", // This is the `apiKeyId` of the `My Source API Key` API key.
    "value": "**********-****-****-****-********1b3e",
    "organizationId": "mycoveocloudv2organization",
    "displayName": "My Source API Key",
    "description": "An API key to edit and view sources.",