{"openapi":"3.0.3","info":{"title":"Contentstack Personalize Edge APIs","description":"","version":"0.1.0","license":{"name":""}},"servers":[{"url":"https://personalize-edge.contentstack.com","description":"North America"},{"url":"https://eu-personalize-edge.contentstack.com","description":"Europe"},{"url":"https://azure-na-personalize-edge.contentstack.com","description":"Azure - North America"},{"url":"https://azure-eu-personalize-edge.contentstack.com","description":"Azure - Europe"},{"url":"https://gcp-na-personalize-edge.contentstack.com","description":"GCP - North America"},{"url":"https://gcp-eu-personalize-edge.contentstack.com","description":"GCP - Europe"},{"url":"https://au-personalize-edge.contentstack.com","description":"Australia"}],"tags":[{"name":"User Attributes","description":"User attributes are key-value pairs that represent the characteristics, behaviors, or preferences of visitors interacting with your website or application. These attributes can be used to create distinct audience segments for targeted content delivery and personalized user experiences."},{"name":"Manifest","description":"Manifest is a list of all active experiences and the corresponding variants in those experiences activated for the current user."},{"name":"Events","description":"Events let you capture and monitor every interaction made by a user. In Contentstack Personalize, there are two types of events: Impressions and Conversions.\nImpressions: Impressions are a way to count how many times users see specific content on your website.\nConversions: A conversion is an event that signifies a positive user action, such as adding a product to the cart, making a purchase, or scrolling to the end of a page. Conversions are essential for measuring the success of your A/B tests."}],"components":{"schemas":{"CustomEvent":{"type":"object","required":["eventKey"],"properties":{"eventKey":{"type":"string","example":"Click"}}},"ImpressionEvent":{"type":"object","required":["experienceShortUid","variantShortUid"],"properties":{"experienceShortUid":{"type":"string","example":"0"},"variantShortUid":{"type":"string","example":"1"}}},"EventData":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/ImpressionEvent"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["IMPRESSION"]}}}]},{"allOf":[{"$ref":"#/components/schemas/CustomEvent"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["EVENT"]}}}]}],"discriminator":{"propertyName":"type"}},"ManifestExperience":{"type":"object","required":["shortUid"],"properties":{"activeVariantShortUid":{"type":"string","nullable":true},"shortUid":{"type":"string"}}},"Manifest":{"type":"object","required":["activeVariants","experiences"],"properties":{"activeVariants":{"type":"object","additionalProperties":{"type":"string","nullable":true}},"experiences":{"type":"array","items":{"$ref":"#/components/schemas/ManifestExperience"}}}}}},"paths":{"/manifest":{"get":{"responses":{"200":{"description":"Manifest fetched successfully","headers":{"x-cs-personalize-user-uid":{"schema":{"type":"string"},"description":"User UID to identify the specific user. If the API is called without passing an existing user identifier, a new User UID is generated and returned with this header."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Manifest"},"example":{"experiences":[{"activeVariantShortUid":"0","shortUid":"1"},{"activeVariantShortUid":"1","shortUid":"2"}]}}}},"400":{"description":"","content":{"application/json":{"schema":{},"examples":{"Live Attributes Header":{"summary":"Live Attributes header not JSON","value":{"error":"personalize.MANIFEST.LIVE_ATTRIBUTES_NOT_JSON","message":"Bad request"}},"Project UID Header":{"summary":"Project UID header not set","value":{"error":"personalize.MANIFEST.PROJECT_UID_HEADER_NOT_SET","message":"Bad request"}}}}}}},"operationId":"getManifest","tags":["Manifest"],"parameters":[{"name":"x-project-uid","in":"header","required":true,"description":"Enter the Project UID","schema":{"type":"string"}},{"name":"x-cs-personalize-user-uid","in":"header","required":false,"description":"Enter the Personalize User UID","schema":{"type":"string","nullable":true}},{"name":"x-forwarded-for","in":"header","required":false,"description":"Enter the user's IP Address. This is used to determine the user's location. If not provided, the IP address is automatically determined from the request.","schema":{"type":"string","nullable":true}},{"name":"user-agent","in":"header","required":false,"description":"Enter the user's User Agent string. This is used to determine the user's device and operating system.","schema":{"type":"string","nullable":true}},{"name":"referer","in":"header","required":false,"description":"Enter the Referrer URL. This is used to determine the Referrer.","schema":{"type":"string","nullable":true}},{"name":"x-page-url","in":"header","required":false,"description":"Enter the user's current page URL. This is used to determine the query parameters on the user's current page.","schema":{"type":"string","nullable":true}},{"name":"x-live-attributes","in":"header","required":false,"description":"Enter the custom attributes to be used as live attributes. This allows using the attributes directly when fetching the manifest for real-time variant evaluation.","schema":{"type":"string","nullable":true}},{"name":"tags[]","in":"query","required":false,"description":"Filter experiences by tag. Only experiences that have at least one matching tag are included in the response (OR semantics, case-insensitive). When omitted, all eligible experiences are returned. A maximum of 10 tag values may be provided.","schema":{"type":"array","items":{"type":"string"},"maxItems":10}}],"summary":"Get Manifest","description":"Get Manifest\n\nThe `Get Manifest` request fetches all the active variants for experiences in a project.\n\nActive variants are returned as a list of experiences in the Response body with the Experience Short UID and Active Variant Short UID for each item in the list.\n\nThe list also reflects the order of the priority for each of the experiences, the items in the response higher up in the list have the higher priority.\n\nIf you run the API call without the user UID, it automatically generates a random user UID, which you can use for other subsequent calls.\n\nNote: A variant will be null when the experience is disabled or when the user does not satisfy the criteria for any variant."}},"/user-attributes":{"patch":{"responses":{"204":{"description":"User Attributes added successfully","headers":{"x-cs-personalize-user-uid":{"schema":{"type":"string"},"description":"User UID to identify the specific user. If the API is called without passing an existing user identifier, a new User UID is generated and returned with this header."}}},"400":{"description":"","content":{"application/json":{"schema":{},"examples":{"Body not JSON":{"summary":"Body is not JSON","value":{"error":"personalize.USER_ATTRIBUTES.BODY_NOT_JSON","message":"Bad request"}},"No Body":{"summary":"Body not Found","value":{"error":"personalize.USER_ATTRIBUTES.NO_BODY","message":"Bad request"}},"Project UID Header":{"summary":"Project UID header not set","value":{"error":"personalize.USER_ATTRIBUTES.PROJECT_UID_HEADER_NOT_SET","message":"Bad request"}}}}}}},"operationId":"patchUser-attributes","tags":["User Attributes"],"parameters":[{"name":"x-cs-personalize-user-uid","in":"header","description":"Enter the Personalize user UID","required":false,"schema":{"type":"string","nullable":true}},{"name":"x-project-uid","in":"header","description":"Enter the Project UID","required":true,"schema":{"type":"string"}}],"summary":"Set and Update User Attributes","description":"Set and Update User Attributes\n\nThe `Set and Update User Attributes` request lets you create and update custom attributes in a project.\n\nAttributes created / updated with this API call needs to have a corresponding custom attribute created in the Attributes module with the same `key`.\n\nThe above request:\n- Creates new attributes for the user if they do not already exist.\n- Updates existing attributes with the provided values. In case of an attribute conflict (existing attribute has a value), and the new value takes precedence during the update.\n- Only the specified key:value pairs for the attributes will be updated, and the non-specified values remain unchanged.","requestBody":{"description":"Request Body","required":true,"content":{"application/json":{"schema":{},"example":{"age":"10"}}}}}},"/user-attributes/actions/merge":{"post":{"responses":{"204":{"description":"User Attributes merged successfully","headers":{"x-cs-personalize-user-uid":{"schema":{"type":"string"},"description":"User UID to identify the specific user. If the API is called without passing an existing user identifier, a new User UID is generated and returned with this header."}}},"400":{"description":"","content":{"application/json":{"schema":{},"examples":{"Body not JSON":{"summary":"Body is not JSON","value":{"error":"personalize.USER_ATTRIBUTES.BODY_NOT_JSON","message":"Bad request"}},"No Body":{"summary":"Body not Found","value":{"error":"personalize.USER_ATTRIBUTES.NO_BODY","message":"Bad request"}},"Project UID Header":{"summary":"Project UID header not set","value":{"error":"personalize.USER_ATTRIBUTES.PROJECT_UID_HEADER_NOT_SET","message":"Bad request"}},"Source User UID":{"summary":"Source User Uid not found","value":{"error":"personalize.USER_ATRRIBUTES.SOURCE_USER_UID_NOT_FOUND_IN_BODY","message":"Bad request"}},"Target User UID":{"summary":"Target User Uid not found","value":{"error":"personalize.USER_ATRRIBUTES.TARGET_USER_UID_NOT_FOUND_IN_BODY","message":"Bad request"}}}}}}},"operationId":"postUser-attributesActionsMerge","tags":["User Attributes"],"parameters":[{"name":"x-project-uid","in":"header","description":"Enter the Project UID","required":true,"schema":{"type":"string"}}],"summary":"Merge User Attributes","description":"Merge User Attributes\n\nThe `Merge User Attributes` request lets you merge attributes using the source (anonymous user) and target (custom user) UIDs in a project.\n\nYou would want to use this API request, when an anonymous user logs in and converts into a known user of your digital property, and merge the attribute details of the anonymous user (source) into the known user (target).\n\nNote: In case of conflict in attributes set against the source UID and target UID, the attribute value for the source UID is given precedence.","requestBody":{"description":"Request Body","required":true,"content":{"application/json":{"schema":{},"example":{"sourceUserUid":"x-user-id","targetUserUid":"y-user-id"}}}}}},"/events":{"post":{"responses":{"202":{"description":"Events tracked successfully","headers":{"x-cs-personalize-user-uid":{"schema":{"type":"string"},"description":"User UID to identify the specific user. If the API is called without passing an existing user identifier, a new User UID is generated and returned with this header."}}},"400":{"description":"","content":{"application/json":{"schema":{},"examples":{"Body not JSON":{"summary":"Body is not JSON","value":{"error":"personalize.EVENTS.INVALID_BODY","message":"Bad request"}},"No Body":{"summary":"Body not Found","value":{"error":"personalize.EVENTS.NO_BODY","message":"Bad request"}},"Project UID Header":{"summary":"Project UID header not set","value":{"error":"personalize.EVENTS.PROJECT_UID_HEADER_NOT_SET","message":"Bad request"}},"User UID Header":{"summary":"User UID header not set","value":{"error":"personalize.EVENTS.USER_UID_HEADER_NOT_SET","message":"Bad request"}}}}}}},"operationId":"postEvents","tags":["Events"],"parameters":[{"name":"x-cs-personalize-user-uid","in":"header","description":"Enter the Personalize User UID","required":true,"schema":{"type":"string"}},{"name":"x-project-uid","in":"header","description":"Enter the Project UID","required":true,"schema":{"type":"string"}}],"summary":"Track Events","description":"Track Events\n\nThe `Track Events` request lets you trigger events, and track either impressions for the experiences created in a project or conversions for your A/B Test experiences.\n\nFor Impressions, it accepts `experienceShortUid`, `variantShortUid` and `type` (i.e. `IMPRESSION`)\n\nFor Custom Event, it accepts `eventKey` and `type` (i.e. `EVENT`)\n\nNote: For Custom Events, the `eventKey` created in the Events module needs to be specified in the API request.","requestBody":{"description":"Request Body","required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventData"}}}}}}}}}