# Update codebreaker campaign

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/management/games/codebreaker/campaigns/{id}:
    put:
      summary: Update codebreaker campaign
      deprecated: false
      description: Update codebreaker campaign
      tags:
        - API Reference/Management API/Games/Codebreaker
      parameters:
        - name: id
          in: path
          description: ''
          required: true
          schema:
            type: integer
        - 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-Loyalty-Club-Slug
          in: header
          description: LoyaltyClub for API context. [Details](doc-342138)
          required: false
          example: '{{LOYALTY_CLUB_SLUG}}'
          schema:
            type: string
            default: '{{LOYALTY_CLUB_SLUG}}'
        - 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}}'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                campaign:
                  properties:
                    name:
                      type: string
                    starts_at:
                      type: string
                      x-apidog-mock: '{{$date.timestamp|format(''yyyy-MM-dd'')}}'
                    ends_at:
                      type: string
                      x-apidog-mock: '{{$date.timestamp|format(''yyyy-MM-dd'')}}'
                    status:
                      type: string
                      enum:
                        - draft
                        - active
                        - inactive
                      x-apidog-enum:
                        - value: draft
                          name: ''
                          description: ''
                        - value: active
                          name: ''
                          description: ''
                        - value: inactive
                          name: ''
                          description: ''
                    code_length:
                      type: integer
                      maximum: 32
                      minimum: 3
                    member_frequency:
                      type: integer
                      minimum: 100
                      multipleOf: 100
                    webpage_url:
                      type: string
                      x-apidog-mock: '{{$internet.url}}'
                    bee_json:
                      type: object
                      properties: {}
                      x-apidog-orders: []
                    codes:
                      type: array
                      items:
                        type: string
                        pattern: ^[0-9]+
                  x-apidog-refs: {}
                  x-apidog-orders:
                    - name
                    - starts_at
                    - ends_at
                    - status
                    - code_length
                    - member_frequency
                    - webpage_url
                    - bee_json
                    - codes
                  required:
                    - name
                    - starts_at
                    - ends_at
                    - status
                    - code_length
                    - member_frequency
                    - webpage_url
                    - bee_json
                    - codes
                  $ref: '#/components/schemas/CodebreakerCampaignPayload'
              x-apidog-orders:
                - campaign
              required:
                - campaign
              x-apidog-ignore-properties: []
            example:
              campaign:
                name: Holidays
                starts_at: '2025-11-06T10:24:25.247Z'
                ends_at: '2025-11-06T10:24:25.249Z'
                status: active
                code_length: 4
                member_frequency: 300
                bee_json: {}
                codes:
                  - '2536'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  campaign:
                    $ref: '#/components/schemas/CodebreakerGameFull'
                required:
                  - campaign
                x-apidog-orders:
                  - campaign
                x-apidog-ignore-properties: []
              example:
                campaign:
                  id: 70
                  name: Jeanne Feil
                  starts_at: '2025-10-07T13:00:00.721Z'
                  ends_at: '2025-10-07T17:00:00.721Z'
                  status: active
                  code_length: 30
                  member_frequency: 50608600
                  webpage_url: https://far-off-luck.info
                  bee_json: {}
                  html: non nisi
                  codes:
                    - '0425531020'
                  thumbnail: null
          headers: {}
          x-apidog-name: OK
        '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: ''
        '422':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    examples:
                      - Invalid parameters
                    const: Invalid parameters
                  details:
                    type: object
                    properties: {}
                    x-apidog-orders: []
                    description: 'See: [Params Validation](doc-341637)'
                    additionalProperties: true
                    x-apidog-ignore-properties: []
                required:
                  - error
                  - details
                x-apidog-orders:
                  - error
                  - details
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: ''
      security: []
      x-apidog-folder: API Reference/Management API/Games/Codebreaker
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/346351/apis/api-3940116-run
components:
  schemas:
    CodebreakerCampaignPayload:
      type: object
      properties:
        name:
          type: string
        starts_at: &ref_0
          description: timestamp in ISO format
          x-apidog-mock: '{{$date.timestamp|formatISO}}'
          $ref: '#/components/schemas/date_time'
        ends_at: *ref_0
        status:
          type: string
          enum:
            - draft
            - active
            - inactive
          x-apidog-enum:
            - value: draft
              name: ''
              description: ''
            - value: active
              name: ''
              description: ''
            - value: inactive
              name: ''
              description: ''
          description: 'enum: published, unpublished, draft'
        code_length:
          type: integer
          maximum: 32
          minimum: 3
          description: max 31
        member_frequency:
          type: integer
          minimum: 100
          multipleOf: 100
          description: multiples of hundreds ig. 100, 200 ...
        bee_json:
          type: object
          properties: {}
          x-apidog-orders: []
          x-apidog-ignore-properties: []
        codes:
          type: array
          items:
            type: string
            pattern: ^[0-9]+
            description: length according to code_length, accept only numbers
          description: numeric codes
      x-apidog-refs: {}
      x-apidog-orders:
        - name
        - starts_at
        - ends_at
        - status
        - code_length
        - member_frequency
        - bee_json
        - codes
      required:
        - name
        - starts_at
        - ends_at
        - status
        - code_length
        - member_frequency
        - bee_json
        - codes
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    date_time:
      type: string
      format: date-time
      examples:
        - '2022-11-09T16:25:58.099512Z'
      x-apidog-folder: ''
    CodebreakerGameFull:
      type: object
      x-apidog-refs: {}
      x-apidog-orders:
        - id
        - name
        - starts_at
        - ends_at
        - status
        - code_length
        - member_frequency
        - webpage_url
        - bee_json
        - html
        - codes
        - thumbnail
      properties:
        id:
          type: integer
        name:
          type: string
        starts_at: *ref_0
        ends_at: *ref_0
        status:
          type: string
          enum:
            - draft
            - active
            - inactive
          x-apidog-enum:
            - value: draft
              name: ''
              description: ''
            - value: active
              name: ''
              description: ''
            - value: inactive
              name: ''
              description: ''
        code_length:
          type: integer
          maximum: 32
          minimum: 3
        member_frequency:
          type: integer
          minimum: 100
          multipleOf: 100
        webpage_url:
          type: string
          x-apidog-mock: '{{$internet.url}}'
        bee_json:
          type: object
          properties: {}
          x-apidog-orders: []
          x-apidog-ignore-properties: []
        html:
          type: string
        codes:
          type: array
          items:
            type: string
            pattern: ^[0-9]+
        thumbnail:
          $ref: '#/components/schemas/File'
      required:
        - id
        - name
        - starts_at
        - ends_at
        - status
        - code_length
        - member_frequency
        - webpage_url
        - bee_json
        - html
        - codes
        - thumbnail
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    File:
      type: object
      properties:
        url:
          type: string
          format: uri
          readOnly: true
          examples:
            - https://example.com/image.png
        identifier:
          type: string
          description: Only present when parent record has many files
          examples:
            - '1'
        mime_type:
          type: string
          examples:
            - image/jpeg
          readOnly: true
          description: Only present in certain circumstances
          nullable: true
        created_at:
          type: string
          format: date-time
          examples:
            - '2022-11-09T15:46:00.252860Z'
        updated_at:
          type: string
          format: date-time
          readOnly: true
          examples:
            - '2022-11-09T15:46:00.252860Z'
        image_details:
          type: object
          properties:
            width:
              type: integer
              minimum: 1
            height:
              type: integer
              minimum: 1
          x-apidog-orders:
            - width
            - height
          x-apidog-ignore-properties: []
          nullable: true
      x-apidog-orders:
        - url
        - identifier
        - mime_type
        - created_at
        - updated_at
        - image_details
      required:
        - url
        - created_at
        - updated_at
      readOnly: true
      x-apidog-ignore-properties: []
      nullable: true
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.mpc.dev.placewise.com
    description: Staging
security: []

```