> ## Documentation Index
> Fetch the complete documentation index at: https://help.lobyco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Activate challenge



## OpenAPI

````yaml openapi/challenge-v3.json PUT /v3/cards/{id}/activate
openapi: 3.0.4
info:
  title: Challenges.Api V3
  version: v3
servers:
  - url: https://{host}/challenge
    description: Your Lobyco environment
    variables:
      host:
        default: your-environment.lobyco.net
        description: >-
          The API host for your Lobyco environment. Replace it with the host you
          were given — this placeholder does not resolve.
security:
  - Bearer: []
paths:
  /v3/cards/{id}/activate:
    put:
      tags:
        - Cards
      summary: Activate challenge
      parameters:
        - name: memberId
          in: header
          required: true
          schema:
            type: string
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Challenge.Api.DTO.MobileApp.BasicCardInfo'
        '400':
          description: >-
            Error name "CardNotFound": Returned if challenge with specified id
            does not exist


            Also returned when activityId or memberId are not specified. Format
            of the body is not guaranteed in this case.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/LoopFoundation.Commons.Contracts.WebServiceError
        '404':
          description: >-
            Error name "ActivationForUnavailableActivity": Returned if card is
            not found or member does not have access to it


            Error name "ActivityActivationLimitReached": Returned if card is
            already completed
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/LoopFoundation.Commons.Contracts.WebServiceError
components:
  schemas:
    Challenge.Api.DTO.MobileApp.BasicCardInfo:
      required:
        - hideInList
      type: object
      properties:
        isActive:
          type: boolean
          description: >-
            Specifies if the card can accumulate progress. True after manual
            activation, or automatically for preactivated challenges.
        currentProgress:
          type: number
          description: >-
            Progress accumulated for the specific instance of challenge. Can be
            integer when calculation types are ProductCount and StoreVisit, or a
            float value otherwise.
          format: double
        cardsActivatedCount:
          type: integer
          description: >-
            Amount of cards that user has activated in the given challenge.
            Includes current card, if it was activated.
          format: int32
        closedAt:
          type: string
          description: >-
            Populated only if the card was already completed. Such cards no
            longer accumulate progress, so user can see what they already
            completed. Closed cards are returned until their challenge expires.
          format: date-time
          nullable: true
        cardId:
          type: string
          description: >-
            Id of the specific card. If challenge is renewable, this id will be
            different on each of the cards, while ActivityId will be the same.
            Will be null, if card is not activated.
          nullable: true
        hideInList:
          type: boolean
          description: Configuration to make the challenge card invisible.
        currentTier:
          type: integer
          description: >-
            The highest tier reached on this card. Null for non-tiered
            challenges or when no tier has been reached yet.
          format: int32
          nullable: true
        cardDetails:
          $ref: '#/components/schemas/Challenge.Api.DTO.MobileApp.CardDetails'
      additionalProperties: false
    LoopFoundation.Commons.Contracts.WebServiceError:
      required:
        - message
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
        message:
          minLength: 1
          type: string
        details:
          nullable: true
      additionalProperties: false
    Challenge.Api.DTO.MobileApp.CardDetails:
      required:
        - activityId
        - campaignId
        - details
        - endDate
        - imageUrl
        - requiredProgress
        - startDate
        - termsAndConditions
        - title
      type: object
      properties:
        campaignId:
          type: string
          description: Obsolete, use ActivityId instead
          format: uuid
        activityId:
          type: string
          description: >-
            Id of the full challenge. Will be the same for all cards relating to
            the same offer.
          format: uuid
        title:
          maxLength: 250
          minLength: 1
          type: string
          description: Title to be shown of challenge list
        requiredProgress:
          type: number
          description: Progress required to finish challenge.
          format: double
        startDate:
          type: string
          description: >-
            Date when challenge becomes available and progress can be
            accumulated
          format: date-time
        endDate:
          type: string
          description: >-
            Date when challenge stops being available and progress can no longer
            be accumulated
          format: date-time
        activationLimit:
          type: integer
          description: >-
            How many times cards in the challenge can be renewed. Null for
            unlimited
          format: int32
          nullable: true
        imageUrl:
          minLength: 1
          type: string
          description: Image for challenge, always populated
        backgroundImageUrl:
          type: string
          description: >-
            Optional background image. Can be null or empty, if no specific
            image was uploaded in the admin tool
          nullable: true
        chainIds:
          type: array
          items:
            type: string
          description: >-
            Chain ids where challenge progress can be accumulated. Mutually
            exclusive with StoreIds
          nullable: true
        storeIds:
          type: array
          items:
            type: string
          description: >-
            Store ids where challenge progress can be accumulated. Mutually
            exclusive with ChainIds
          nullable: true
        details:
          minLength: 1
          type: string
          description: Free-text details. Maximum length not limited
        termsAndConditions:
          minLength: 1
          type: string
          description: Free-text terms and conditions. Maximum length not limited
        rewardType:
          $ref: '#/components/schemas/DomainModel.Models.RewardType'
        progressCalculationType:
          $ref: >-
            #/components/schemas/Challenge.Api.DTO.MobileApp.CardProgressCalculationType
        isSinglePurchase:
          type: boolean
          description: >-
            Specifies if progress can be accumulated over multiple purchases, or
            enough progress to complete challenge should be present in 1
            purchase.
        completionLabel:
          type: string
          description: >-
            Optional label to be shown when challenge is completed instead of
            title. If not present, title should be used instead
          nullable: true
        completedCardsLabel:
          type: string
          description: Optional label to show amount of completed cards
          nullable: true
        completedCardsCount:
          type: integer
          description: Amount of completed cards
          format: int32
        progressLabel:
          type: string
          description: >-
            Optional label to show on card, instead of default "Buy 3 to get an
            offer" label. If not specified, default label from the app should be
            used
          nullable: true
        unitOfMeasure:
          $ref: '#/components/schemas/DomainModel.Models.UnitOfMeasure'
        couponRewards:
          type: array
          items:
            $ref: '#/components/schemas/Challenge.Api.DTO.MobileApp.CardCouponReward'
          description: >-
            Coupon rewards for the challenge. Empty array for lottery or
            non-coupon challenges.
          nullable: true
        bonusRewards:
          type: array
          items:
            $ref: '#/components/schemas/Challenge.Api.DTO.MobileApp.CardBonusReward'
          description: >-
            Bonus rewards for the challenge. Empty array for lottery or
            non-bonus challenges.
          nullable: true
        customRewards:
          type: array
          items:
            $ref: '#/components/schemas/Challenge.Api.DTO.MobileApp.CardCustomReward'
          description: >-
            Custom rewards for the challenge. Empty array for lottery or
            non-custom challenges.
          nullable: true
        tags:
          type: array
          items:
            type: string
          description: Challenge optional tags used for alternative segmentation
          nullable: true
      additionalProperties: false
    DomainModel.Models.RewardType:
      enum:
        - Coupon
        - Bonus
        - Custom
        - LotteryTicket
        - Multiple
      type: string
    Challenge.Api.DTO.MobileApp.CardProgressCalculationType:
      enum:
        - ProductCount
        - PurchaseAmount
        - StoreVisit
        - PaymentMethod
        - Complex
      type: string
    DomainModel.Models.UnitOfMeasure:
      enum:
        - Item
        - Litre
        - Gram
        - Kilogram
      type: string
    Challenge.Api.DTO.MobileApp.CardCouponReward:
      type: object
      properties:
        offerId:
          type: string
          description: Offer id of the coupon reward
          nullable: true
      additionalProperties: false
    Challenge.Api.DTO.MobileApp.CardBonusReward:
      type: object
      properties:
        bonusAmount:
          type: number
          description: Bonus amount to be granted
          format: double
          nullable: true
      additionalProperties: false
    Challenge.Api.DTO.MobileApp.CardCustomReward:
      type: object
      properties:
        name:
          type: string
          description: Reward name
          nullable: true
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        Opaque Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      name: Authorization
      in: header

````