Skip to end of metadata
Go to start of metadata

In this topic:

An API key is a Coveo Cloud V2 platform access token that can have a certain set of privileges which are only valid within the confines of a single Coveo Cloud V2 organization. Anyone can use a given API key to successfully authenticate calls to any of the Coveo Cloud V2 platform REST API operations for which this key grants the required privileges.

Use the Create a new api key for this organization operation to create an API key with certain privileges in a specific Coveo Cloud V2 organization.

Request template

In the request path:

In the Authorization HTTP header:

In the request body:

  • Replace <MyAPIKeyDescription> by a string indicating for whom, when, and for what purpose you are creating the API key.

  • Replace <MyAPIKeyDisplayName> by an adequate name, summarizing the API key purpose.

    Best Practice:

    Although optional, specifying relevant values for the displayName and description properties will greatly help whoever manages API keys in the target Coveo Cloud V2 organization.

  • Set the enabled property to true  in the request body when you want the new API key to work right away; set it to false otherwise.

  • For each privilege you include in the privileges array:

The body of a successful response (201 Created) contains information about the API key you just created.

  • You can use the id property to later edit or delete the API key. You can always get this value back once the API key has been created (see Getting the apiKeyId).
  • The value property contains the API key itself.

    Warning:

    The API key creation call response body is your unique occasion to get the API key value. It is not possible to get it again.

    If you fail to get the value, delete the lost key, and create a new one (see Deleting an API Key).

Sample Request

Request example - Creating an API key to view and edit sources
Successful response - 201 Created
  • No labels