Get the privileges you can assign to an API key

This is for:

System Administrator
In this article

A Coveo API key is granted a set of privileges which are only valid within the confines of a specific Coveo organization (see Manage privileges and Privilege reference).

You can use the Get all possible privileges for API keys in the selected organization call to retrieve the list of values which are assignable to the privileges parameter when you create an API Key (see Create an API key):

Request template

GET<MyOrganizationId>/privileges/apikeys HTTP/1.1
Accept: application/json
Authorization: Bearer <MyAccessToken>

In the request path:

In the Authorization HTTP header:

  • Replace MyAccessToken with 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).

    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 the list of all privileges which are individually assignable to any API key in the Coveo organization matching the organizationId you provide as a path argument.

The most important properties of an API key privilege are its targetDomain, owner, and type (see Valid Privilege owner, targetDomain, and type Combinations). You don’t need to specify the targetIds and global properties of the privileges you include in the privileges parameter when you create an API key.

Sample request

Getting all privileges which are assignable to an API key in a specific Coveo organization

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

Successful response - 200 OK

    "targetDomain": "AUTHENTICATION_EDITOR",
    "targetIds": [],
    "owner": "SEARCH_API",
    "global": false
    "type": "EDIT",
    "targetDomain": "ON_PREMISE_ADMINISTRATION",
    "targetIds": [],
    "owner": "PLATFORM",
    "global": false