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

# Mass creation of seats in hall

> Creates multiple new seats in a specific hall in a single transaction.
The request body should be an array of seat objects to create. The server will process them in a single batch.
This is a protected endpoint. Access is restricted to users with `admin` or `manager` roles.




## OpenAPI

````yaml api-reference/openapi.json post /api/halls/{hall_id}/seats
openapi: 3.0.0
info:
  title: Tandem IT API
  version: 1.0.0
  description: API for tandem it backend
servers:
  - url: https://tandem.hlofiys.xyz
    description: Production server
security: []
tags:
  - name: Documentation
    description: API documentation endpoint
paths:
  /api/halls/{hall_id}/seats:
    parameters:
      - name: hall_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
    post:
      tags:
        - 'Admin: Seats'
      summary: Mass creation of seats in hall
      description: >
        Creates multiple new seats in a specific hall in a single transaction.

        The request body should be an array of seat objects to create. The
        server will process them in a single batch.

        This is a protected endpoint. Access is restricted to users with `admin`
        or `manager` roles.
      operationId: createSeats
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CreateSeatRequest'
      responses:
        '201':
          description: >-
            Seat have been successfully created. An array of created seat
            objects with their new IDs is returned
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Seat'
              examples:
                successExample:
                  summary: An example of creating two seats
                  value:
                    - seat_id: 150
                      row_label: A
                      seat_label: '1'
                      x_coordinate: 10.5
                      y_coordinate: 20
                      seat_type_id: 1
                      hall_id: 1
                    - seat_id: 151
                      row_label: A
                      seat_label: '2'
                      x_coordinate: 25.5
                      y_coordinate: 20
                      seat_type_id: 1
                      hall_id: 1
        '400':
          description: >
            Validation error. Incorrect or missing data in the request body.


            **Note on array validation:** The `errors` object keys will follow
            the format `seats[index].field_name`, where `index` is the
            zero-based position of the problematic object in the input array.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                validationErrorExample:
                  summary: >-
                    An example of a validation error for multiple objects in the
                    array
                  value:
                    message: Validation failed
                    errors:
                      seats[1].row_label: The row_label field is required.
                      seats[2].seat_type_id: A valid seat_type_id is required.
        '401':
          description: >-
            Unauthorized. Authentication credentials were not provided or are
            invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Access denied. The user does not have permission to perform this
            action
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict. A seat type with this data already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateSeatRequest:
      type: object
      required:
        - row_label
        - seat_label
        - x_coordinate
        - y_coordinate
        - seat_type_id
      properties:
        row_label:
          type: string
          description: Row label (e.g. '1', 'A', 'Parterre')
          example: '12'
        seat_label:
          type: string
          description: Place label in a row (for example, '5', '10', 'VIP 1')
          example: '7'
        x_coordinate:
          type: number
          format: double
          description: X coordinate to display on the diagram
          default: 0
        y_coordinate:
          type: number
          format: double
          description: Y coordinate to display on the diagram
          default: 0
        seat_type_id:
          type: integer
          format: int64
          description: Unique seat type ID
    Seat:
      type: object
      required:
        - seat_id
        - row_label
        - seat_label
        - x_coordinate
        - y_coordinate
        - seat_type_id
        - hall_id
      properties:
        seat_id:
          type: integer
          format: int64
          description: Unique seat ID
        row_label:
          type: string
          description: Row label (e.g. '1', 'A', 'Parterre')
          example: '12'
        seat_label:
          type: string
          description: Place label in a row (for example, '5', '10', 'VIP 1')
          example: '7'
        x_coordinate:
          type: number
          format: double
          description: X coordinate to display on the diagram
          default: 0
        y_coordinate:
          type: number
          format: double
          description: Y coordinate to display on the diagram
          default: 0
        seat_type_id:
          type: integer
          format: int64
          description: Unique seat type ID
        hall_id:
          type: integer
          format: int64
          description: Unique hall ID
    ValidationError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          example: Validation failed
        errors:
          type: object
          description: A map of field names to their respective error messages.
          additionalProperties:
            type: string
          example:
            name: The name field is required.
            price: The price must be a valid number.
            hall_id: A valid hall_id is required.
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````