# Restore Edition

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/management/attendance_challenge/editions/{id}/restore:
    put:
      summary: Restore Edition
      deprecated: false
      description: ''
      tags:
        - API Reference/Management API/AttendanceChallenge/Editions
      parameters:
        - name: id
          in: path
          description: ID of the record
          required: true
          example: 1
          schema:
            type: integer
            minimum: 1
        - name: Content-Type
          in: header
          description: '[Details](doc-341635)'
          required: true
          example: application/json
          schema:
            type: string
            default: application/json
            const: application/json
        - name: X-User-Agent
          in: header
          description: Arbitrary identifier of your client. [Details](doc-341635)
          required: true
          example: '{{X_USER_AGENT}}'
          schema:
            type: string
            default: '{{X_USER_AGENT}}'
        - name: X-Product-Name
          in: header
          description: API Product for API context. [Details](doc-341635)
          required: true
          example: '{{PRODUCT_NAME}}'
          schema:
            type: string
            default: '{{PRODUCT_NAME}}'
        - name: X-Customer
          in: header
          description: Customer for API context.  [Details](doc-342139)
          required: false
          example: '{{CUSTOMER_ID}}'
          schema:
            type: string
            default: '{{CUSTOMER_ID}}'
        - name: Authorization
          in: header
          description: '[Member](doc-342129) or [User](doc-342130) Authorization.'
          required: false
          example: Bearer {{_OAUTH_TOKEN}}
          schema:
            type: string
            default: Bearer {{_OAUTH_TOKEN}}
        - name: X-Client-Authorization
          in: header
          description: '[Token](doc-342128) Authorization.'
          example: '{{API_TOKEN}}'
          schema:
            type: string
            default: '{{API_TOKEN}}'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  edition:
                    $ref: '#/components/schemas/Edition'
                x-apidog-orders:
                  - edition
                required:
                  - edition
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Success
        '404':
          description: ''
          content:
            application/json:
              schema:
                title: ''
                type: object
                properties:
                  error:
                    type: string
                    examples:
                      - Record not found
                x-apidog-orders:
                  - error
                required:
                  - error
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Record Not Found
      security: []
      x-apidog-folder: API Reference/Management API/AttendanceChallenge/Editions
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/346351/apis/api-4351910-run
components:
  schemas:
    Edition:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/id1'
        start_date: &ref_1
          type: string
          description: The month determining the start of the Edition
          format: regex
          minLength: 1
          pattern: ^(0[1-9]|1[0-2])-\d{4}$
          examples:
            - 2026-04
        end_date: &ref_2
          type: string
          description: The month determining the end of the Edition
          format: regex
          minLength: 1
          pattern: ^(0[1-9]|1[0-2])-\d{4}$
          examples:
            - 2026-11
        stages:
          type: array
          items:
            type: object
            properties:
              date: &ref_3
                type: string
                description: The month of the Edition
                minLength: 1
                pattern: ^(0[1-9]|1[0-2])-\d{4}$
                examples:
                  - 2026-05
              starts_at: &ref_4
                type: string
                format: date-time
                examples:
                  - '2026-04-01T00:00:00.000000+02:00'
                readOnly: true
                description: >-
                  The actual time (reflecting the Customer's timezone and start
                  hour of the Edition) when the Edition starts.
              ends_at: &ref_5
                type: string
                format: date-time
                examples:
                  - '2026-11-31T23:59:59.999999+01:00'
                readOnly: true
                description: >-
                  The actual time (reflecting the Customer's timezone and start
                  hour of the Edition) when the Edition ends.
              extra_period_ends_at: &ref_6
                type: string
                format: date-time
                examples:
                  - '2026-12-10T23:59:59.999999+01:00'
                readOnly: true
                description: >-
                  The time (reflecting the Customer's timezone and start hour of
                  the Edition) when the extra period ends.
            x-apidog-orders: &ref_7
              - date
              - starts_at
              - ends_at
              - extra_period_ends_at
            required:
              - date
            x-apidog-ignore-properties: []
          description: Stages (names of months). Enumerated.
          minItems: 1
          uniqueItems: true
          readOnly: true
        starts_at: &ref_8
          type: string
          format: date-time
          examples:
            - '2026-04-01T00:00:00.000000+02:00'
          readOnly: true
          description: >-
            The actual time (reflecting the Customer's timezone and start hour
            of the Edition) when the Edition starts.
        ends_at: &ref_9
          type: string
          format: date-time
          examples:
            - '2026-11-31T23:59:59.999999+01:00'
          readOnly: true
          description: >-
            The actual time (reflecting the Customer's timezone, start hour of
            the Edition and the extra days) when the Edition ends.
        nominal_ends_at: &ref_10
          type: string
          format: date-time
          examples:
            - '2026-11-31T23:59:59.999999+01:00'
          readOnly: true
          description: >-
            The actual nominal (end of month) time (reflecting the Customer's
            timezone, start hour of the Edition) when the Edition ends.
        stages_streak_goal: &ref_11
          type: integer
          minimum: 1
          examples:
            - 3
          description: >-
            Number of subsequently completed stages required for member to get a
            reward
        monthly_attendances_goal: &ref_12
          type: integer
          description: >-
            Number of the attendances completed during a stage required to have
            this stage completed by a member
          minimum: 1
          examples:
            - 8
        daily_value_goal: &ref_13
          type: number
          description: >-
            Total amount money on scanned (and verified) receipts made by member
            on a single day to mark the day as completed
          minimum: 0.01
          examples:
            - 100
        entries_limit: &ref_14
          type: integer
          description: >-
            Maximum number of entries of a single member to the Edition. When
            null, there is no limit.
          minimum: 1
          default: 1
          examples:
            - 2
          nullable: true
        first_stage_reward_id:
          description: >-
            ID of MPC exclusive Offer granted to Member when he completes his
            first stage of the Edition 
          examples: &ref_15
            - 5513
          anyOf:
            - &ref_16
              $ref: '#/components/schemas/id'
              description: >-
                ID of MPC exclusive Offer granted to Member when he completes
                histfirst stage of the Edition 
            - &ref_17
              type: 'null'
        first_stage_reward_name: &ref_18
          type: string
          readOnly: true
          description: Name of MPC exclusive Offer
        streak_reward_value: &ref_19
          type: integer
          description: Amount of money granted to Member after completing the streak
          examples:
            - 150
          minimum: 1
        title: &ref_0
          $ref: '#/components/schemas/LocalizedContent'
        rules: *ref_0
        onboarding_description: *ref_0
        bee_email_json:
          type: object
          properties: {}
          x-apidog-orders: []
          description: >-
            Bee JSON template for email messages sent within the Edition. It
            should contain `{{content}}` merge tag for dynamic content.

            See: [Templating System](doc-354486)
          x-apidog-ignore-properties: []
        active:
          type: boolean
          default: true
          description: If false, the Edition is not visible on public endpoints
        start_hour:
          type: integer
          default: 0
          minimum: 0
          examples:
            - 9
          description: >-
            Determines the hour of the day at which the each stage (and
            therefore, Edition) starts and ends
          nullable: true
        extra_days:
          type: integer
          description: >-
            The number of additional days after end of the month that allow to
            fulfill daily goals from the previous month
          default: 0
          minimum: 0
          examples:
            - 10
          maximum: 30
          nullable: true
        slots_total:
          type: integer
          minimum: 1
          examples:
            - 100
          description: Number of members that can participate in the Edition
        slots_taken:
          type: integer
          examples:
            - 95
          minimum: 0
          readOnly: true
          description: 'Current number of members that participate in the Edition. '
        excluded_store_ids:
          type: array
          items:
            type: integer
            examples:
              - 553
            minimum: 1
          description: >-
            ID of MPC
            [Stores](https://api.developer.placewise.com/doc-341692.md) that are
            be excluded from the challenge
        created_at:
          $ref: '#/components/schemas/date_time.created_at'
        updated_at:
          $ref: '#/components/schemas/date_time.updated_at'
        archived_at:
          anyOf:
            - $ref: '#/components/schemas/date_time.archived_at'
            - type: 'null'
        simulation_offset:
          type: integer
          description: (Internal) Minutes to speed up the course of the Edition
          minimum: 1
          examples:
            - 3600
        current_time:
          type: string
          format: date-time
          examples:
            - '2026-12-10T23:59:59.999999+01:00'
          readOnly: true
          description: >-
            (Internal) Current time for the Edition taking the simulation offset
            into consideration. 
      x-apidog-orders:
        - id
        - 01KV63N0K1HDN8EPJE32Q6YK56
        - title
        - rules
        - onboarding_description
        - bee_email_json
        - active
        - start_hour
        - extra_days
        - slots_total
        - slots_taken
        - excluded_store_ids
        - created_at
        - updated_at
        - archived_at
        - simulation_offset
        - current_time
      required:
        - id
        - start_date
        - end_date
        - stages
        - starts_at
        - ends_at
        - stages_streak_goal
        - monthly_attendances_goal
        - daily_value_goal
        - entries_limit
        - first_stage_reward_id
        - first_stage_reward_name
        - streak_reward_value
        - rules
        - onboarding_description
        - bee_email_json
        - active
        - start_hour
        - slots_total
        - slots_taken
        - excluded_store_ids
        - created_at
        - updated_at
        - archived_at
      x-apidog-refs:
        01KV63N0K1HDN8EPJE32Q6YK56:
          $ref: '#/components/schemas/Edition%20Core'
      x-apidog-ignore-properties:
        - start_date
        - end_date
        - stages
        - starts_at
        - ends_at
        - nominal_ends_at
        - stages_streak_goal
        - monthly_attendances_goal
        - daily_value_goal
        - entries_limit
        - first_stage_reward_id
        - first_stage_reward_name
        - streak_reward_value
      x-apidog-folder: ''
    date_time.archived_at:
      type: string
      description: Time of the record archivization
      format: date-time
      examples:
        - '2022-11-15T16:25:58.099512Z'
      readOnly: true
      nullable: true
      x-apidog-folder: ''
    date_time.updated_at:
      type: string
      description: Time of the last record update
      format: date-time
      examples:
        - '2022-11-15T16:25:58.099512Z'
      readOnly: true
      x-apidog-folder: ''
    date_time.created_at:
      type: string
      description: Time of record creation
      format: date-time
      examples:
        - '2022-11-05T16:25:58.099512Z'
      readOnly: true
      x-apidog-folder: ''
    LocalizedContent:
      type: object
      properties: {}
      x-apidog-orders: []
      title: ''
      examples:
        - en: Text
      additionalProperties:
        type: string
        description: >-
          The actual set of languages depends on LC configuration. See:
          [Localization](doc-341959)
        examples:
          - Tekst
        nullable: true
      x-apidog-ignore-properties: []
      nullable: true
      x-apidog-folder: ''
    id:
      type: integer
      title: ''
      description: Identifier
      examples:
        - 1
      minimum: 1
      x-apidog-folder: ''
    id1:
      type: integer
      description: Primary identifier of the record
      format: uint64
      readOnly: true
      examples:
        - 1
      x-apidog-folder: ''
    Edition Core:
      type: object
      properties:
        start_date: *ref_1
        end_date: *ref_2
        stages:
          type: array
          items:
            type: object
            properties:
              date: *ref_3
              starts_at: *ref_4
              ends_at: *ref_5
              extra_period_ends_at: *ref_6
            x-apidog-orders: *ref_7
            required:
              - date
            x-apidog-ignore-properties: []
          description: Stages (names of months). Enumerated.
          minItems: 1
          uniqueItems: true
          readOnly: true
        starts_at: *ref_8
        ends_at: *ref_9
        nominal_ends_at: *ref_10
        stages_streak_goal: *ref_11
        monthly_attendances_goal: *ref_12
        daily_value_goal: *ref_13
        entries_limit: *ref_14
        first_stage_reward_id:
          description: >-
            ID of MPC exclusive Offer granted to Member when he completes his
            first stage of the Edition 
          examples: *ref_15
          anyOf:
            - *ref_16
            - *ref_17
        first_stage_reward_name: *ref_18
        streak_reward_value: *ref_19
      x-apidog-orders:
        - start_date
        - end_date
        - stages
        - starts_at
        - ends_at
        - nominal_ends_at
        - stages_streak_goal
        - monthly_attendances_goal
        - daily_value_goal
        - entries_limit
        - first_stage_reward_id
        - first_stage_reward_name
        - streak_reward_value
      required:
        - start_date
        - end_date
        - stages
        - starts_at
        - ends_at
        - stages_streak_goal
        - monthly_attendances_goal
        - daily_value_goal
        - entries_limit
        - first_stage_reward_id
        - first_stage_reward_name
        - streak_reward_value
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.mpc.dev.placewise.com
    description: Staging
security: []

```