openapi: 3.0.1 info: title: Coveo Activity Activities Context Mapping Configurations API description: API for Coveo Platform termsOfService: https://www.coveo.com/en/support/terms-agreements contact: name: Coveo url: https://connect.coveo.com/s/discussions version: 1.0.0 servers: - url: https://platform.cloud.coveo.com description: Coveo public API endpoint security: - oauth2: - full tags: - name: Context Mapping Configurations paths: /rest/organizations/{organizationId}/commerce/v2/tracking-ids/{trackingId}/context-mappings/{key}: get: tags: - Context Mapping Configurations summary: Get Context Mapping description: 'Gets a specific context mapping by key.

**Required privilege:** Merchandising Hub - View

Privilege required ``` {"owner":"COMMERCE","targetDomain":"MERCHANDISING_HUB","type":"VIEW","targetId":"*"} ```
' operationId: get parameters: - name: organizationId in: path description: The unique identifier of the target [organization](https://docs.coveo.com/en/185/).
**Example:** `acmecorporation8tp8wu3` required: true schema: type: string - name: trackingId in: path description: The unique identifier of the tracking target. required: true schema: type: string - name: key in: path description: The context mapping key required: true schema: type: string responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/ContextMappingModel' x-pretty-name: get x-required-privilege: owner: COMMERCE targetDomain: MERCHANDISING_HUB type: VIEW targetId: '*' x-required-privileges: - owner: COMMERCE targetDomain: MERCHANDISING_HUB type: VIEW targetId: '*' x-ui-operation-id: /rest/organizations/paramId/commerce/v2/tracking-ids/paramId/context-mappings/paramId_get put: tags: - Context Mapping Configurations summary: Update Context Mapping description: 'Updates an existing context mapping by key

**Required privilege:** Merchandising Hub - Edit

Privilege required ``` {"owner":"COMMERCE","targetDomain":"MERCHANDISING_HUB","type":"EDIT","targetId":"{trackingId}"} ```
' operationId: update parameters: - name: organizationId in: path description: The unique identifier of the target [organization](https://docs.coveo.com/en/185/).
**Example:** `acmecorporation8tp8wu3` required: true schema: type: string - name: trackingId in: path description: The unique identifier of the tracking target. required: true schema: type: string - name: key in: path description: The context mapping key required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/ContextMappingModel' required: true responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/ContextMappingModel' x-pretty-name: update x-required-privilege: owner: COMMERCE targetDomain: MERCHANDISING_HUB type: EDIT targetId: '{trackingId}' x-required-privileges: - owner: COMMERCE targetDomain: MERCHANDISING_HUB type: EDIT targetId: '{trackingId}' x-ui-operation-id: /rest/organizations/paramId/commerce/v2/tracking-ids/paramId/context-mappings/paramId_put delete: tags: - Context Mapping Configurations summary: Delete Context Mapping description: 'Deletes a specific context mapping by key.

**Required privilege:** Merchandising Hub - Edit

Privilege required ``` {"owner":"COMMERCE","targetDomain":"MERCHANDISING_HUB","type":"EDIT","targetId":"{trackingId}"} ```
' operationId: delete parameters: - name: organizationId in: path description: The unique identifier of the target [organization](https://docs.coveo.com/en/185/).
**Example:** `acmecorporation8tp8wu3` required: true schema: type: string - name: trackingId in: path description: The unique identifier of the tracking target. required: true schema: type: string - name: key in: path description: The context mapping key required: true schema: type: string responses: '204': description: No Content x-pretty-name: delete x-required-privilege: owner: COMMERCE targetDomain: MERCHANDISING_HUB type: EDIT targetId: '{trackingId}' x-required-privileges: - owner: COMMERCE targetDomain: MERCHANDISING_HUB type: EDIT targetId: '{trackingId}' x-ui-operation-id: /rest/organizations/paramId/commerce/v2/tracking-ids/paramId/context-mappings/paramId_delete /rest/organizations/{organizationId}/commerce/v2/tracking-ids/{trackingId}/context-mappings: get: tags: - Context Mapping Configurations summary: List Context Mappings description: 'Lists all context mapping configurations.

**Required privilege:** Merchandising Hub - View

Privilege required ``` {"owner":"COMMERCE","targetDomain":"MERCHANDISING_HUB","type":"VIEW","targetId":"*"} ```
' operationId: list parameters: - name: organizationId in: path description: The unique identifier of the target [organization](https://docs.coveo.com/en/185/).
**Example:** `acmecorporation8tp8wu3` required: true schema: type: string - name: trackingId in: path description: The unique identifier of the tracking target. required: true schema: type: string responses: '200': description: OK content: '*/*': schema: type: array items: $ref: '#/components/schemas/ContextMappingModel' x-pretty-name: list x-required-privilege: owner: COMMERCE targetDomain: MERCHANDISING_HUB type: VIEW targetId: '*' x-required-privileges: - owner: COMMERCE targetDomain: MERCHANDISING_HUB type: VIEW targetId: '*' x-ui-operation-id: /rest/organizations/paramId/commerce/v2/tracking-ids/paramId/context-mappings_get post: tags: - Context Mapping Configurations summary: Creates a Context Mapping description: 'Creates a context mapping for a specific key.

**Required privilege:** Merchandising Hub - Edit

Privilege required ``` {"owner":"COMMERCE","targetDomain":"MERCHANDISING_HUB","type":"EDIT","targetId":"{trackingId}"} ```
' operationId: create_2 parameters: - name: organizationId in: path description: The unique identifier of the target [organization](https://docs.coveo.com/en/185/).
**Example:** `acmecorporation8tp8wu3` required: true schema: type: string - name: trackingId in: path description: The unique identifier of the tracking target. required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/ContextMappingModel' required: true responses: '201': description: Created content: '*/*': schema: $ref: '#/components/schemas/ContextMappingModel' x-pretty-name: create x-required-privilege: owner: COMMERCE targetDomain: MERCHANDISING_HUB type: EDIT targetId: '{trackingId}' x-required-privileges: - owner: COMMERCE targetDomain: MERCHANDISING_HUB type: EDIT targetId: '{trackingId}' x-ui-operation-id: /rest/organizations/paramId/commerce/v2/tracking-ids/paramId/context-mappings_post components: schemas: MappingDestination: required: - attribute type: object properties: attribute: type: string description: The destination type where context mapping values can be applied example: QUERY_PIPELINE_CONTEXT enum: - QUERY_PIPELINE_CONTEXT - ML_CONTEXT - FIELD_ALIASES fieldAlias: type: string description: The field alias template used when attribute is FIELD_ALIASES. Must resolve to a field name pattern. example: price_{{contextValue}} fieldSource: type: string description: The field source template used when attribute is FIELD_ALIASES. Must resolve to 'field.subkey' pattern. example: price.{{contextValue}} description: The list of destinations where this context mapping should be applied. example: - attribute: QUERY_PIPELINE_CONTEXT - attribute: FIELD_ALIASES ContextMappingModel: required: - destinations - key - type type: object properties: key: pattern: ^[a-zA-Z]\w{0,63}$ type: string description: A unique key for the context mapping. Must start with a letter and contain only letters, numbers, and underscores. example: user_segment type: type: string description: The data type for context mapping values example: STRING enum: - BOOLEAN - STRING - NUMBER - PRODUCT_LIST destinations: minItems: 1 type: array description: The list of destinations where this context mapping should be applied. example: - attribute: QUERY_PIPELINE_CONTEXT - attribute: FIELD_ALIASES items: $ref: '#/components/schemas/MappingDestination' description: The context mapping configuration to create securitySchemes: oauth2: type: oauth2 flows: authorizationCode: authorizationUrl: https://platform.cloud.coveo.com/oauth/authorize tokenUrl: https://platform.cloud.coveo.com/oauth/token scopes: full: required