# Create game

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/games-admin:
    post:
      summary: Create game
      deprecated: false
      description: ''
      operationId: createGame
      tags:
        - API Reference/Management API/Games/Games
        - Games
      parameters:
        - 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: 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}}'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GamePayload'
            example:
              name: Yvette Yost
              type: scratchcard
              audience_id: 89
              start_date: '2022-11-09T16:25:58.099512Z'
              end_date: '2022-11-09T16:25:58.099512Z'
              attempts: 64521406
              chance_to_win: 87.94158955875308
              day_start_time: '08:00:00'
              prize_limit: 36807434
              redeem_before_new_ticket: false
              show_prizes: false
              support_email: Scarlett_Gulgowski-Davis@yahoo.com
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Game'
          headers: {}
          x-apidog-name: ''
        '422':
          description: Invalid Parameters
          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/Games
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/346351/apis/api-4509158-run
components:
  schemas:
    GamePayload:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
          enum:
            - scratchcard
            - wof
        audience_id:
          type: integer
        start_date: &ref_0
          $ref: '#/components/schemas/date_time'
        end_date: *ref_0
        attempts:
          type: integer
          minimum: 0
        chance_to_win:
          type: number
          minimum: 0
          maximum: 100
        day_start_time:
          type: string
          pattern: ^[0-9]{2}:[0-9]{2}:[0-9]{2}
        prize_limit:
          type: integer
          minimum: 0
        redeem_before_new_ticket:
          type: boolean
        show_prizes:
          type: boolean
        support_email:
          type: string
        allow_grantable_tickets:
          type: boolean
          description: allow grantable tickets
          default: false
      required:
        - name
        - type
        - attempts
        - chance_to_win
        - day_start_time
        - redeem_before_new_ticket
        - show_prizes
      x-apidog-orders:
        - name
        - type
        - audience_id
        - start_date
        - end_date
        - attempts
        - chance_to_win
        - day_start_time
        - prize_limit
        - redeem_before_new_ticket
        - show_prizes
        - support_email
        - allow_grantable_tickets
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    date_time:
      type: string
      format: date-time
      examples:
        - '2022-11-09T16:25:58.099512Z'
      x-apidog-folder: ''
    Game:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        type:
          type: string
          enum:
            - scratchcard
            - wof
        active:
          type: boolean
        setup_finished:
          type: boolean
        audience_id:
          type: integer
        start_date:
          type: string
          format: date-time
        end_date:
          type: string
          format: date-time
        attempts:
          type: integer
        chance_to_win:
          type: number
        day_start_time:
          type: string
        prize_limit:
          type: integer
        redeem_before_new_ticket:
          type: boolean
        show_prizes:
          type: boolean
        support_email:
          type: string
        allow_grantable_tickets:
          type: boolean
      x-apidog-orders:
        - id
        - name
        - type
        - active
        - setup_finished
        - audience_id
        - start_date
        - end_date
        - attempts
        - chance_to_win
        - day_start_time
        - prize_limit
        - redeem_before_new_ticket
        - show_prizes
        - support_email
        - allow_grantable_tickets
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    bearerAuth:
      type: bearer
      scheme: bearer
servers:
  - url: https://api.mpc.dev.placewise.com
    description: Staging
security: []

```