younifyd
Menu

Token V3

Create search token

POST/rest/search/v3/token

Use it in a workflow

  1. Add a step and choose the Coveo connector.
  2. Pick the Token V3 action (under Search).
  3. Fill in the fields below, then reference the result from later steps as {{tokenV3.response.data}}.

Request

Query parameters

organizationIdstring

The unique identifier of the target Coveo Cloud organization. Specifying a value for this parameter is only necessary when you are authenticating the API call with an OAuth2 token.

Request body

Enter the body as JSON in the step's Body field.

allowedDictionaryFieldKeysobject

The [dictionary field](https://docs.coveo.com/en/2036/) keys to allow access to when authenticating a query with this search token. This value controls which fields may be specified in the `fieldAliases` parameter of the query. The top-level keys of the parameter are the names of the dictionary fields to which to allow access. The values are arrays of field sub-keys to authorize. Specific sub-key values may be provided to restrict access to only those keys, for example `\"allowedDictionaryFieldKeys\": { \"price\": [\"storea\", \"storeb\"] }`. The special value `*` may be given to authorize all sub-keys of a field. **Note:** By default no fields are allowed. **Note:** This cannot be used at the same time as `dictionaryFieldContext`. **Example:** Suppose that in your index, the `@price` and `@size` dictionary fields contain different values for their `storea` and `storeb` keys. If the token has `\"allowedDictionaryFieldKeys\": { \"price\": [\"*\"] }`, a query can include `\"fieldAliases\": { \"price_a\": \"price.storea\" }`, but `\"fieldAliases\": { \"size_a\": \"size.storea\" }` won’t work unless `size` is also included in the token.

canSeeUserProfileOfarray<string>

The `username` and/or `visitorId` values whose corresponding usage analytics-recorded user profiles can be accessed using the search token. **Note:** This property is meant to be used when generating search tokens for users requiring contextual information about other users to improve search relevance (e.g., support agents using an insight panel).

commerceobject
catalogIdstring
filterstring
operationstring
dictionaryFieldContextobject

The [dictionary field](https://docs.coveo.com/en/2036/) context to enforce when authenticating a query with this search token. This value will override the `dictionaryFieldContext` parameter of the query itself. A dictionary field context is a key-value store where each pair corresponds to the name of a dictionary field to query, along with the key to target within that field. For example, suppose that in your index, the `@price` dictionary field contains different values for its `storeA` and `storeB` keys. Including `"dictionaryFieldContext": { "price": "storeA" }` when creating a search token means that, for any query made with that search token, any part of the query expression that targets the `@price` field will in fact only query the `storeA` values of that field. **Note:** This cannot be used at the same time as `allowedDictionaryFieldKeys`.

filterstring

The filter query expression to apply when authenticating a query with this search token. This expression will be merged with the constant part of the query expression (`cq`) using an `AND` operator. The filter can also be used in query pipeline condition statements (e.g., `when $constantQuery contains \"@source==KnowledgeBase\"`).

licenseDefinitionKeystring

**Internal:** This property is exposed for internal use by the Coveo for Salesforce integration.

pipelinestring

The name of the query pipeline to use when authenticating a query with this search token. This query pipeline will take precedence over the possible output of all other query pipeline routing mechanisms when using this search token (see [Query Pipeline Routing Mechanisms and Rules](https://docs.coveo.com/en/1666/)).

salesforceCommunityUrlstring

**Internal:** This property is exposed for internal use by the Coveo for Salesforce integration.

salesforceFallbackToAdminboolean

**Internal:** This property is exposed for internal use by the Coveo for Salesforce integration.

salesforceOrganizationIdstring

**Internal:** The ID of Salesforce organization, used to differentiate Salesforce organizations linked to the same Coveo organization.

salesforceUserstring

**Internal:** This property is exposed for internal use by the Coveo for Salesforce integration.

scopeinteger (int32)

This property is exposed for backward compatibility reasons only.

searchHubstring

The name of the search hub to enforce when authenticating a query with this search token. This value will override the `searchhub` parameter of the query itself, and will be passed as the `originLevel1` property value when logging usage analytics search events. The search hub can also be used in query pipeline condition statements (e.g., `when $searchhub is \"CommunityHub\"`).

superUserTokenstring

This property is exposed for backward compatibility reasons only.

userDisplayNamestring

The `userDisplayName` to pass when logging usage analytics search events. This information is leveraged in the **Analytics** section of the Coveo Cloud administration console.

userGroupsarray<string>

The `userGroups` to pass when logging usage analytics search events. This information is leveraged in the **Analytics** section of the Coveo Cloud administration console. User groups can be also be used in query pipeline condition statements (e.g., `when $groups contains \"Employees\"`).

userIdsarray<object>required

The security identities to impersonate when authenticating a query with this search token.

authCookiestringrequired
infosobjectrequired

Additional custom information about the security identity to impersonate.

namestringrequired

The name of the security identity to impersonate. This value can also be used in query pipeline condition statements (e.g., `when $identity is \"asmith@example.com\"`)

passwordstringrequired

This parameter is exposed for backward compatibility reasons only.

providerstringrequired

The security identity provider containing the security identity to impersonate.

typestringrequired

The type of the security identity to impersonate. **Default:** `User`

One ofUserGroupVirtualGroupUnknown

usertypestring

**Internal:** This property is exposed for internal use by the Coveo for Salesforce integration.

validForinteger (int32)

The number of milliseconds the search token will remain valid for once it has been created. **Minimum value:** `900000` (i.e., 15 minutes) **Maximum/default:** `86400000` (i.e., 24 hours)

Default 86400000

json
{
  "userIds": [
    {
      "authCookie": "",
      "infos": {},
      "name": "asmith@example.com",
      "password": "string",
      "provider": "Email Security Provider",
      "type": "User"
    }
  ],
  "allowedDictionaryFieldKeys": {
    "price": [
      "*"
    ],
    "size": [
      "storea",
      "storeb"
    ]
  },
  "canSeeUserProfileOf": [
    "bjones@acme.com",
    "dmoore@acme.com"
  ],
  "commerce": {
    "catalogId": "string",
    "filter": "string",
    "operation": "string"
  },
  "dictionaryFieldContext": {},
  "filter": "@source==KnowledgeBase",
  "licenseDefinitionKey": "string",
  "pipeline": "InternalSearch",
  "salesforceCommunityUrl": "string",
  "salesforceFallbackToAdmin": false,
  "salesforceOrganizationId": "00Df23090018W5bEAG",
  "salesforceUser": "string"
}

Response

Returns 200 with an object. Read it in later steps with {{tokenV3.response.data.<field>}}.

tokenstring
json
{
  "token": "string"
}

Need more? See the Coveo guide for connection setup and behaviour shared by every action.

Was this page helpful?