openapi: 3.2.0 info: title: Real-time Customer Profile Computed attributes API description: "Use Real-time Customer Profile to drive coordinated, consistent and relevant experiences for your customers no matter where or when they interact with your brand. Profile provides a holistic view of each individual customer that combines data from multiple channels, including online, offline, CRM, and third-party data.\n- **Related documentation**:\n - [Real-time Customer Profile documentation](http://www.adobe.com/go/profile-overview-en)\n - [Profile API developer guide](http://www.adobe.com/go/profile-developer-guide-en)\n\n- **Visualize API calls with Postman (a free, third-party software)**:\n - [Real-time Customer Profile API Postman collection on GitHub](https://github.com/adobe/experience-platform-postman-samples/blob/master/apis/experience-platform/Real-time%20Customer%20Profile%20API.postman_collection.json)\n - [Video guide for creating the Postman environment](https://video.tv.adobe.com/v/28832)\n - [Steps for importing environments and collections in Postman](https://learning.getpostman.com/docs/postman/collection_runs/using_environments_in_collection_runs/)\n\n- **API paths**:\n - PLATFORM Gateway URL: https://platform.adobe.io/\n - Base path for this API: /data/core/ups\n - Base path for the computed attributes API: /data/core/ca\n - Example of a complete path: https://platform.adobe.io/data/core/ups/config/mergePolicies\n\n- **Required headers**:\n - All calls require the headers `Authorization`, `x-gw-ims-org-id`, and `x-api-key`. For more information on how to obtain these values, see the [authentication tutorial](http://www.adobe.com/go/platform-api-authentication-en).\n - All resources in Experience Platform are isolated to specific virtual sandboxes. All requests to Platform APIs require the header `x-sandbox-name` whose value is the all-lowercase name of the sandbox the operation will take place in (for example, \"prod\"). See the [sandboxes overview](https://adobe.com/go/sandbox-overview-en) for more information.\n - All requests with a payload in the request body (such as POST, PUT, and PATCH calls) must include the header `Content-Type`. Accepted values specific to each call are provided in the call parameters.\n\n- **API error handling**:\n - Refer to the Experience Platform API troubleshooting guide for [FAQs](https://experienceleague.adobe.com/docs/experience-platform/landing/troubleshooting.html#faq), [API status codes](https://experienceleague.adobe.com/docs/experience-platform/landing/troubleshooting.html#api-status-codes), and [request header errors](https://experienceleague.adobe.com/docs/experience-platform/landing/troubleshooting.html#request-header-errors).\n " version: '1.0' servers: - url: https://{environment}.adobe.io/data/core variables: environment: default: platform enum: - platform - platform-stage tags: - name: Computed attributes description: Computed attributes enable a field value to be automatically computed based on other values, calculations, and expressions. Computed attributes functionality is in **beta** and is **not** available to all users. Functionality is subject to change. For more information on using this set of endpoints, please read the [computed attributes endpoint guide](https://experienceleague.adobe.com/docs/experience-platform/profile/computed-attributes/api.html?lang=en#computed-attributes). paths: /ca/attributes: get: tags: - Computed attributes summary: List all computed attributes operationId: listComputedAttributes parameters: - $ref: '#/components/parameters/authorization' - $ref: '#/components/parameters/x-api-key' - $ref: '#/components/parameters/x-gw-ims-org-id' - $ref: '#/components/parameters/x-sandbox-name' - name: limit in: query description: A parameter that specifies the maximum number of items returned as part of the response. schema: type: string example: 20 - name: offset in: query description: A parameter that specifies the number of items to skip before returning the items. schema: type: string example: 5 - name: sortBy in: query description: A parameter that specifies the order in which the items are sorted. Possible values include `name`, `status`, `updateEpoch`, and `createEpoch`. You can choose whether to sort in ascending order or descending order by including or not including a `-` in front of the sort option. By default, the items will be sorted by `updateEpoch` in descending order. schema: type: string enum: - name - status - updateEpoch - createEpoch example: -name - name: property in: query description: A parameter that lets you filter on various computed attribute fields. Supported values include `name`, `createdEpoch`, `mergePolicy.value`, `updateEpoch`, and `status. More information about this query parameter can be found in the [computed attributes API guide](https://experienceleague.adobe.com/docs/experience-platform/profile/computed-attributes/api.html?lang=en#list). schema: type: string enum: - name - createdEpoch - mergePolicy.value - updateEpoch - status example: name=testingrelease responses: 200: x-summary: Success description: Returns a list of computed attributes content: application/json: schema: $ref: '#/components/schemas/listComputedAttributes' 500: x-summary: Internal server error description: An internal server issue occurred. content: {} 502: x-summary: Service unavailable description: The service is unavailable. content: {} post: tags: - Computed attributes summary: Create a computed attribute operationId: createComputedAttribute parameters: - $ref: '#/components/parameters/authorization' - $ref: '#/components/parameters/x-api-key' - $ref: '#/components/parameters/x-gw-ims-org-id' - $ref: '#/components/parameters/x-sandbox-name' requestBody: description: "A JSON object containing the details of the computed attribute being created.\n- **name:** The name of the computed attribute field, as a string. The name of the computed attribute can only be comprised of alphanumeric characters without any spaces or underscores. \n- **description:** A description of the computed attribute.\n- **displayName:** The display name for the computed attribute. This is the name that will be displayed when listing your computed attributes within the Adobe Experience Platform UI.\n- **expression:** An object containing information about the expression for the computed attribute.\n - **type**: The type of expression. Currently, only `PQL` is supported.\n - **format**: The format of the expression. Currently, only `pql/text` is supported.\n - **value**: The value of the query expression.\n- **keepCurrent:*** A boolean that determines whether or not the computed attribute's value is kept up-to-date with fast refresh.\n- **duration:** An object containing the duration of the lookback period for the computed attribute. The lookback period represents how far back can be looked back to compute the computed attribute.\n - **count:** A number that represents the duration for the lookback period. The possible values depend on the value of the `duration.unit` field.\n | Unit | Values |\n | ---- | ------ |\n | HOURS | 1 - 24 |\n | DAYS | 1 - 7 |\n | WEEKS | 1 - 4 |\n | MONTHS | 1 - 6 |\n - **unit:** A string that represents the unit of time that will be used for the lookback period. Possible values include: `HOURS`, `DAYS`, `WEEKS`, and `MONTHS`. \n- **status:** The status of the computed attribute. Possible values include `DRAFT` and `NEW`. " content: application/json: schema: $ref: '#/components/schemas/createComputedAttribute' required: true responses: 200: x-summary: Success description: Returns the details of the newly created computed attribute. content: application/json: schema: $ref: '#/components/schemas/computedAttributeResponse' 400: x-summary: Bad request description: "Bad Request. Common examples include:\n * \"Function with the same name already exists for the specified schema or definedOn\"\n * \"Could not lookup schema of the computed attribute for the provided path\"\n * \"Return schema of the expression is not same as the schema of the computed attribute in the XDM schema\"." content: {} 500: x-summary: Internal server error description: There was an internal server error. Try the request again in a few minutes, and contact Adobe Support if the problem persists. content: {} 503: x-summary: Service unavailable description: Service Unavailable content: {} x-codegen-request-body-name: body /ca/attributes/{ATTRIBUTE_ID}: get: tags: - Computed attributes summary: Retrieve a specific computed attribute operationId: retrieveComputedAttribute parameters: - name: ATTRIBUTE_ID in: path description: The unique, read-only ID of the computed attribute that is generated by the system when the attribute is created. required: true schema: type: string - $ref: '#/components/parameters/authorization' - $ref: '#/components/parameters/x-api-key' - $ref: '#/components/parameters/x-gw-ims-org-id' - $ref: '#/components/parameters/x-sandbox-name' responses: 200: x-summary: Success description: Returns the details of the computed attribute content: application/json: schema: $ref: '#/components/schemas/computedAttributeResponse' 404: x-summary: Not found description: The computed attribute was not found content: {} 500: x-summary: Internal server error description: There was an internal server error. Try the request again in a few minutes, and contact Adobe Support if the problem persists. content: {} 503: x-summary: Service unavailable description: Service Unavailable content: {} delete: tags: - Computed attributes summary: Delete a computed attribute operationId: deleteComputedAttribute parameters: - name: ATTRIBUTE_ID in: path description: The unique, read-only ID of the computed attribute that is generated by the system when the attribute is created. required: true schema: type: string - $ref: '#/components/parameters/authorization' - $ref: '#/components/parameters/x-api-key' - $ref: '#/components/parameters/x-gw-ims-org-id' - $ref: '#/components/parameters/x-sandbox-name' responses: 202: x-summary: Accepted description: Returns HTTP Status 202 (Accepted) and details of the computed attribute you deleted. content: application/json: schema: $ref: '#/components/schemas/computedAttributeResponse' 404: x-summary: Not found description: Computed attribute not found content: {} 422: x-summary: Cannot delete description: Cannot perform delete as some other functions are dependent on this function. content: {} 500: x-summary: Internal server error description: There was an internal server error. Try the request again in a few minutes, and contact Adobe Support if the problem persists. 503: x-summary: Service unavailable description: Service Unavailable content: {} patch: tags: - Computed attributes summary: Update a computed attribute operationId: updateComputedAttribute parameters: - name: ATTRIBUTE_ID in: path description: The unique, read-only ID of the computed attribute that is generated by the system when the attribute is created. required: true schema: type: string - $ref: '#/components/parameters/authorization' - $ref: '#/components/parameters/x-api-key' - $ref: '#/components/parameters/x-gw-ims-org-id' - $ref: '#/components/parameters/x-sandbox-name' requestBody: description: Add the key/value pairs of the items you want to update. content: application/json: schema: $ref: '#/components/schemas/updateComputedAttribute' required: true responses: 200: x-summary: Accepted description: Returns HTTP Status 200 (OK) with information about your newly updated computed attribute. content: application/json: schema: $ref: '#/components/schemas/computedAttributeResponse' 404: x-summary: Not found description: Computed attribute not found content: {} 500: x-summary: Internal server error description: There was an internal server error. Try the request again in a few minutes, and contact Adobe Support if the problem persists. content: {} 503: x-summary: Service unavailable description: Service Unavailable content: {} x-codegen-request-body-name: body components: parameters: authorization: name: Authorization in: header description: The access token which can be copied from your Experience Platform integration, prefixed with "Bearer ". For more information on how to obtain this value, visit the [authentication tutorial](http://www.adobe.com/go/platform-api-authentication-en). required: true schema: type: string x-api-key: name: x-api-key in: header description: The API key which can be copied from your Experience Platform integration. For more information on how to obtain this value, visit the [authentication tutorial](http://www.adobe.com/go/platform-api-authentication-en). required: true schema: type: string x-gw-ims-org-id: name: x-gw-ims-org-id in: header description: The Organization ID which can be copied from your Experience Platform integration. For more information on how to obtain this value, visit the [authentication tutorial](http://www.adobe.com/go/platform-api-authentication-en). required: true schema: type: string x-sandbox-name: name: x-sandbox-name in: header description: All resources in Experience Platform are isolated to specific virtual sandboxes. Requests to Platform APIs require a header that specifies the name of the sandbox in which the operation will take place. See the [sandboxes overview](https://adobe.com/go/sandbox-overview-en) for more information. required: true schema: type: string schemas: updateComputedAttribute: type: object properties: status: type: string example: DRAFT createComputedAttribute: required: - name - description - displayName - expression - duration - status type: object properties: name: type: string example: sampleComputedAttribute description: type: string example: A sample computed attribute displayName: type: string example: Sample Computed Attribute expression: type: object properties: type: type: string example: PQL format: type: string example: pql/text value: type: string example: xEvent[(commerce.checkouts.value > 0.0 or commerce.purchases.value > 1.0 or commerce.order.priceTotal >= 10.0) and (timestamp occurs <= 7 days before now)].sum(commerce.order.priceTotal) description: A valid Profile Query Language (PQL) expression. keepCurrent: type: boolean example: false description: A boolean that determines whether or not the value should be kept up-to-date using fast refresh. duration: type: object properties: count: type: number example: 3 unit: type: string example: MONTHS enum: - HOURS - DAYS - WEEKS - MONTHS status: type: string example: DRAFT enum: - DRAFT - NEW listComputedAttributes: type: object properties: _page: type: object properties: totalCount: type: integer example: 1 pageSize: type: integer example: 1 children: type: array items: $ref: '#/components/schemas/computedAttributeResponse' _links: type: object properties: next: type: object properties: {} computedAttributeResponse: type: object properties: id: type: string example: 2afcf410-450e-4a39-984d-2de99ab58877 type: type: string example: ComputedAttribute name: type: string example: sampleComputedAttribute displayName: type: string example: Sample Computed Attribute description: type: string example: Sample description for a computed attribute imsOrgId: type: string example: '{ORG_ID}' sandbox: type: object properties: sandboxId: type: string example: ff0f6870-c46d-11e9-8ca3-036939a64204 sandboxName: type: string example: prod type: type: string example: production isDefault: type: boolean example: true path: type: string example: '{TENANT_ID}/ComputedAttributes' positionPath: type: array items: type: string example: - '{TENANT_ID}' - ComputedAttributes keepCurrent: type: boolean example: false expression: type: object properties: type: type: string example: PQL format: type: string example: pql/text value: type: string example: xEvent[(commerce.checkouts.value > 0.0 or commerce.purchases.value > 1.0 or commerce.order.priceTotal >= 10.0) and (timestamp occurs <= 7 days before now)].sum(commerce.order.priceTotal) description: A valid Profile Query Language (PQL) expression. mergeFunction: type: object properties: value: type: string example: SUM status: type: string example: DRAFT schema: type: object properties: name: type: string example: _xdm.context.profile lastEvaluationTs: type: string example: '2023-08-27T00:14:55.028' returnSchema: type: object properties: meta:xdmType: type: string example: number definedOn: type: array items: type: object properties: meta:resourceType: type: string example: unions meta:containerId: type: string example: tenant $ref: type: string example: https://ns.adobe.com/xdm/context/profile__union createEpoch: type: integer example: 1572555223 updateEpoch: type: integer example: 1572555225 createdBy: type: string example: '{USER_ID}'