openapi: 3.2.0 info: title: AJO Customer Loyalty Metadata Challenges API description: APIs for managing AJO Customer Loyalty.

**Related documentation:** See [Loyalty challenges](https://experienceleague.adobe.com/docs/journey-optimizer/using/loyalty-challenges/get-started.html) in Journey Optimizer documentation.

**Required headers:** All calls require the headers Authorization, x-gw-ims-org-id, and x-api-key. For more information, see the [authentication tutorial](https://developer.adobe.com/journey-optimizer-apis/references/authentication). contact: url: http://adobe.com version: 0.1.0 servers: - url: http://localhost:8081 description: Local - url: https://loyalty-metadata-service-stage2.corp.ethos12-stage-va7.ethos.adobe.net description: Stage - url: https://platform.adobe.io/ajo description: Prod tags: - name: Challenges description: Manage the creation, updating, deleting, and retrieval of Challenges paths: /loyalty/metadata/challenges/{challengeId}: get: tags: - Challenges summary: Retrieve a Challenge by its challengeId operationId: readOne_1 parameters: - name: x-request-id in: header required: false schema: type: string - name: x-api-key in: header required: true schema: type: string - name: x-gw-ims-org-id in: header required: true schema: type: string - name: x-sandbox-id in: header required: false schema: type: string - name: x-sandbox-name in: header required: true schema: type: string - name: Authorization in: header required: true schema: type: string - name: challengeId in: path description: Challenge to retrieve required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/Challenge' '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Challenge not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '409': description: Conflict content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '422': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' put: tags: - Challenges summary: Replace an existing challenge by overwriting operationId: update_1 parameters: - name: x-request-id in: header required: false schema: type: string - name: x-api-key in: header required: true schema: type: string - name: x-gw-ims-org-id in: header required: true schema: type: string - name: x-sandbox-id in: header required: false schema: type: string - name: x-sandbox-name in: header required: true schema: type: string - name: Authorization in: header required: true schema: type: string - name: challengeId in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/Challenge' required: true responses: '200': description: Success '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Challenge not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '409': description: Cannot modify a published challenge content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '422': description: Validation error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' delete: tags: - Challenges summary: Delete a challenge and its associated journey description: Deletes the challenge from MongoDB. If a journey is linked, it will be automatically deleted from AJO. operationId: delete_1 parameters: - name: x-request-id in: header required: false schema: type: string - name: x-api-key in: header required: true schema: type: string - name: x-gw-ims-org-id in: header required: true schema: type: string - name: x-sandbox-id in: header required: false schema: type: string - name: x-sandbox-name in: header required: true schema: type: string - name: Authorization in: header required: true schema: type: string - name: challengeId in: path required: true schema: type: string responses: '200': description: Success '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Challenge not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '409': description: Conflict content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '422': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' patch: tags: - Challenges summary: Patch an existing challenge by root keys if present operationId: patch_1 parameters: - name: x-request-id in: header required: false schema: type: string - name: x-api-key in: header required: true schema: type: string - name: x-gw-ims-org-id in: header required: true schema: type: string - name: x-sandbox-id in: header required: false schema: type: string - name: x-sandbox-name in: header required: true schema: type: string - name: Authorization in: header required: true schema: type: string - name: challengeId in: path required: true schema: type: string requestBody: content: application/json: schema: type: object additionalProperties: type: object required: true responses: '200': description: Success '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Challenge not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '409': description: Cannot modify a published challenge content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '422': description: Validation error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' /loyalty/metadata/challenges: get: tags: - Challenges summary: Retrieve all Challenges with filtering and sorting operationId: readMany_1 parameters: - name: x-request-id in: header required: false schema: type: string - name: x-api-key in: header required: true schema: type: string - name: x-gw-ims-org-id in: header required: true schema: type: string - name: x-sandbox-id in: header required: false schema: type: string - name: x-sandbox-name in: header required: true schema: type: string - name: Authorization in: header required: true schema: type: string - name: limit in: query description: Specifies a positive integer as a hint as to the maximum number of items that should be returned for a given request. required: false schema: type: integer format: int32 default: 25 - name: start in: query description: Specifies where a sub-set list of items should begin required: false schema: type: string - name: orderby in: query description: Specifies the comma-separated list of properties by which the resource should be sorted required: false schema: type: string default: -creationDate - name: property in: query description: One or more of the comma-separated list of properties. MUST all match for an item to match that is multiple filters MUST be AND-ed required: false schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/ChallengeList' '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Challenge not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '409': description: Conflict content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '422': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' post: tags: - Challenges summary: Create a Challenge operationId: create_1 parameters: - name: x-request-id in: header required: false schema: type: string - name: x-api-key in: header required: true schema: type: string - name: x-gw-ims-org-id in: header required: true schema: type: string - name: x-sandbox-id in: header required: false schema: type: string - name: x-sandbox-name in: header required: true schema: type: string - name: Authorization in: header required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/Challenge' required: true responses: '200': description: Success headers: x-resource-id: description: id of the newly created Challenge style: simple Location: description: URI of the newly created Challenge style: simple content: application/json: schema: $ref: '#/components/schemas/Challenge' '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Referenced task template not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '409': description: Conflict content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '422': description: Validation error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' /loyalty/metadata/challenges/{challengeId}/unpublish: post: tags: - Challenges summary: Unpublish a Challenge and make it unavailable to your customers operationId: unPublish parameters: - name: x-request-id in: header required: false schema: type: string - name: x-api-key in: header required: true schema: type: string - name: x-gw-ims-org-id in: header required: true schema: type: string - name: x-sandbox-id in: header required: false schema: type: string - name: x-sandbox-name in: header required: true schema: type: string - name: Authorization in: header required: true schema: type: string - name: challengeId in: path required: true schema: type: string responses: '200': description: Success '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Challenge not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '409': description: Conflict content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '422': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' /loyalty/metadata/challenges/{challengeId}/publish: post: tags: - Challenges summary: Publish a Challenge and make it available to your customers operationId: publish parameters: - name: x-request-id in: header required: false schema: type: string - name: x-api-key in: header required: true schema: type: string - name: x-gw-ims-org-id in: header required: true schema: type: string - name: x-sandbox-id in: header required: false schema: type: string - name: x-sandbox-name in: header required: true schema: type: string - name: Authorization in: header required: true schema: type: string - name: challengeId in: path required: true schema: type: string - name: dry-run in: query description: When provided and is 'true', the challenge is merely checked for correctness and determines whether it can be published required: false schema: type: boolean responses: '200': description: Success '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Challenge or configuration not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '409': description: Conflict content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '422': description: Validation error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' /loyalty/metadata/challenges/{challengeId}/duplicate: post: tags: - Challenges summary: Duplicate a challenge including journey metadata and campaigns operationId: duplicate parameters: - name: x-request-id in: header required: false schema: type: string - name: x-api-key in: header required: true schema: type: string - name: x-gw-ims-org-id in: header required: true schema: type: string - name: x-sandbox-id in: header required: false schema: type: string - name: x-sandbox-name in: header required: true schema: type: string - name: Authorization in: header required: true schema: type: string - name: challengeId in: path required: true schema: type: string responses: '200': description: Challenge duplicated successfully content: application/json: schema: $ref: '#/components/schemas/Challenge' '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Source challenge not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '409': description: Conflict content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '422': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' /loyalty/metadata/challenges/{challengeId}/archive: post: tags: - Challenges summary: Archive a Challenge. Once in this state, the challenge can only be deleted. operationId: archive parameters: - name: x-request-id in: header required: false schema: type: string - name: x-api-key in: header required: true schema: type: string - name: x-gw-ims-org-id in: header required: true schema: type: string - name: x-sandbox-id in: header required: false schema: type: string - name: x-sandbox-name in: header required: true schema: type: string - name: Authorization in: header required: true schema: type: string - name: challengeId in: path required: true schema: type: string responses: '200': description: Success '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Challenge not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '409': description: Conflict content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '422': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' /loyalty/metadata/challenges/initialize: post: tags: - Challenges summary: Initialize shell journey & challenges operationId: initialize parameters: - name: x-request-id in: header required: false schema: type: string - name: x-api-key in: header required: true schema: type: string - name: x-gw-ims-org-id in: header required: true schema: type: string - name: x-sandbox-id in: header required: false schema: type: string - name: x-sandbox-name in: header required: true schema: type: string - name: Authorization in: header required: true schema: type: string requestBody: content: application/json: schema: type: object additionalProperties: type: string responses: '200': description: Success content: application/json: schema: type: object additionalProperties: type: string '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Challenge not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '409': description: Challenge is already associated with a journey content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '422': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' components: schemas: ContentPhaseConfig: type: object description: Message sequence for a journey phase properties: messages: type: array description: Ordered list of messages for this phase items: $ref: '#/components/schemas/MessageConfig' Daypart: type: object properties: startMinute: type: integer format: int32 endMinute: type: integer format: int32 Reward: type: object properties: endpoint: type: string definition: type: string rewardValue: type: string ProblemDetail: type: object properties: type: type: string format: uri title: type: string status: type: integer format: int32 detail: type: string instance: type: string format: uri properties: type: object additionalProperties: type: object ChallengeList: type: object properties: challengeList: type: array items: $ref: '#/components/schemas/Challenge' Variables: type: object properties: include: $ref: '#/components/schemas/IncludeExclude' exclude: $ref: '#/components/schemas/IncludeExclude' goal: type: number format: double type: type: string singleTrans: type: boolean spendMin: type: number format: float qtyMin: type: number format: float maxTrans: type: integer format: int32 AudienceQualificationConfig: type: object description: Audience configuration for journey targeting properties: segmentName: type: string description: Human-readable segment name (optional, for documentation) example: High-Value Mobile Users segmentId: type: string description: Adobe Experience Platform segment/audience UUID example: 88e4300a-c762-4cd6-8bd0-c0c02ba9afcf pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ required: - segmentId Challenge: type: object properties: get_id: type: string imsOrgId: type: string sandboxId: type: string name: type: string desc: type: string startDate: type: string format: date-time endDate: type: string format: date-time signupEventName: type: string dependsOn: type: array items: $ref: '#/components/schemas/DependsOn' tasks: type: array items: oneOf: - $ref: '#/components/schemas/PurchaseTask' creationDate: type: string format: date-time lastModifiedDate: type: string format: date-time state: type: string enum: - draft - published - archived tasksToComplete: type: integer format: int32 schemaVersion: type: integer format: int32 publishedVersion: type: integer format: int32 active: type: boolean autoSignupWhenEventApplied: type: boolean linkedJourneyContainerId: type: string linkedJourneyVersionId: type: string eventTemplates: $ref: '#/components/schemas/EventTemplatesConfig' dirtyJourneyState: type: boolean singleTrans: type: boolean dayPart: $ref: '#/components/schemas/Daypart' personalized: type: boolean pickYourTask: type: boolean reward: $ref: '#/components/schemas/Reward' personalizedAttributes: $ref: '#/components/schemas/PersonalizedAttributes' kvpCustom: type: object additionalProperties: type: string uiStash: type: string createdBy: type: string lastModifiedBy: type: string journeyMetadata: $ref: '#/components/schemas/JourneyMetadata' milestones: $ref: '#/components/schemas/Milestone' audienceId: type: string p13nDatasetId: type: string taskTemplates: type: array items: $ref: '#/components/schemas/TaskTemplate' Milestone: type: object properties: contiguous: type: boolean interval: type: string enum: - none - task - daily - weekly - monthly - annually completions: type: array items: $ref: '#/components/schemas/MilestoneReward' PurchaseTask: allOf: - $ref: '#/components/schemas/Task' IncludeExclude: type: object properties: values_csv: type: string valuesSet: type: array items: type: string uniqueItems: true PersonalizedAttributes: type: object properties: desc: type: boolean dayPart: type: boolean reward: type: boolean milestones: type: boolean allTasks: type: boolean MetadataConfig: type: object description: Journey metadata for context and challenge linking properties: creationStatus: type: string description: 'Journey creation status: ''inProgress'' (building) or ''created'' (journey exists)' example: inProgress challengeId: type: string description: Associated challenge UUID (required - journey must be linked to a challenge) example: 507f1f77-bcf8-6cd7-9943-9011abcd1234 pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ journeyName: type: string description: Journey name displayed in Adobe Journey Optimizer UI example: Holiday Challenge Journey taskNames: type: object additionalProperties: type: string description: Task names by index (used for event naming) example: '0': Complete 5 transactions '1': Spend $100 numberOfTasks: type: integer format: int32 required: - challengeId - journeyName JourneyMetadata: type: object description: Journey configuration for challenge journeys properties: metadata: $ref: '#/components/schemas/MetadataConfig' description: Core journey metadata including challenge ID and journey name audienceQualification: $ref: '#/components/schemas/AudienceQualificationConfig' description: Adobe Experience Platform audience/segment configuration eventTemplateDetails: type: array description: Event template definitions for journey events items: $ref: '#/components/schemas/EventTemplateDetail' content: $ref: '#/components/schemas/ContentConfig' description: Content phases with message sequences required: - audienceQualification - content - metadata EventTemplatesConfig: type: object properties: signupEventTemplateId: type: string taskCompleteEventTemplateId: type: string challengeCompleteEventTemplateId: type: string PersonalizedTaskAttributes: type: object properties: desc: type: boolean name: type: boolean include_csv: type: boolean exclude_csv: type: boolean qtyMin: type: boolean spendMin: type: boolean multiDayDays: type: boolean streak: type: boolean maxRepeat: type: boolean reward: type: boolean ContentConfig: type: object description: Content phases for journey messaging properties: launch: $ref: '#/components/schemas/ContentPhaseConfig' description: 'Launch phase messages (initial engagement). Example: welcome email, onboarding content card.' inProgress: $ref: '#/components/schemas/ContentPhaseConfig' description: 'In-progress phase messages (during challenge). Example: reminder push, progress update email.' end: $ref: '#/components/schemas/ContentPhaseConfig' description: 'End phase messages (completion confirmation). Example: congratulations email, reward notification.' Schedule: type: object properties: duration: type: string enum: - task - daily maxRepeat: type: integer format: int32 MessageConfig: type: object description: Message configuration for a journey node properties: type: type: string description: Message type determining the node type enum: - contentCard - email - push - inapp - wait example: email pattern: ^(contentCard|email|push|inapp|wait)$ surfaceId: type: string description: Delivery surface ID (required for contentCard, email, push) example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 messageId: type: string description: Pre-created message ID from Inline Message Service (required for contentCard, email, push) example: b2c3d4e5-f6a7-8901-bcde-f12345678901 actionUID: type: string description: Unique action ID for the message node. Required for campaign message types (contentCard, email, push, inapp). Generated by UI when creating inline campaign. example: c1d2e3f4-a5b6-7890-cdef-1234567890ab name: type: string description: Human-readable message name (displayed in journey UI) example: Welcome Email description: type: string description: Optional message description example: Sent when user signs up for challenge shouldRepeat: type: boolean description: Whether this message should repeat (for recurring journeys) example: false delay: type: string description: Wait duration for 'wait' type nodes (ISO-8601 duration format) example: PT30M pattern: ^P(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d+)?S)?)?$ required: - name - type DependsOn: type: object properties: challengeId: type: string TaskTemplate: type: object properties: templateTaskId: type: string overrides: type: object additionalProperties: type: object EventTemplateDetail: type: object description: Event definition for journey progression properties: eventType: type: string description: Event type identifier (e.g., signup, task_complete, challenge_complete) example: signup name: type: string description: Human-readable event name example: ChallengeSignupEvent description: type: string description: Event description example: Triggered when user opts into the challenge namespaceId: type: string description: Identity namespace for profile matching example: LOYALTYID required: - eventType - name Task: type: object discriminator: propertyName: taskType properties: get_id: type: string imsOrgId: type: string sandboxId: type: string creationDate: type: string format: date-time lastModifiedDate: type: string format: date-time createdBy: type: string lastModifiedBy: type: string taskType: type: string enum: - purchase taskId: type: string taskName: type: string desc: type: string variables: $ref: '#/components/schemas/Variables' startDate: type: string format: date-time endDate: type: string format: date-time dependsOnTaskName: type: array items: type: string schedule: $ref: '#/components/schemas/Schedule' personalizedTaskAttributes: $ref: '#/components/schemas/PersonalizedTaskAttributes' reward: $ref: '#/components/schemas/Reward' uiStash: type: string taskClass: type: string MilestoneReward: type: object properties: count: type: integer format: int32 rewardValue: type: string