> ## 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.

# Create a new seat type

> Creates a new seat type and associates it with a specific hall.
The price and color defined here will apply to all seats of this type within that particular hall.
This is a protected endpoint. Access is restricted to users with `admin` or `manager` roles.




## OpenAPI

````yaml api-reference/openapi.json post /api/seat-types
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/seat-types:
    post:
      tags:
        - 'Admin: Seat Types'
      summary: Create a new seat type
      description: >
        Creates a new seat type and associates it with a specific hall.

        The price and color defined here will apply to all seats of this type
        within that particular hall.

        This is a protected endpoint. Access is restricted to users with `admin`
        or `manager` roles.
      operationId: createSeatType
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSeatTypeRequest'
      responses:
        '201':
          description: The seat type was successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeatType'
        '400':
          description: Validation error. Incorrect or missing data in the request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '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:
    CreateSeatTypeRequest:
      type: object
      required:
        - name
        - price
        - seat_color
        - hall_id
      properties:
        name:
          type: string
          description: Seat type name
        price:
          type: string
          description: Cost of place. Passed as a string to preserve precision
          example: '99.90'
        seat_color:
          $ref: '#/components/schemas/HexColor'
        hall_id:
          type: integer
          format: int64
          description: Unique hall ID
    SeatType:
      type: object
      required:
        - seat_type_id
        - name
        - price
        - seat_color
        - hall_id
      properties:
        seat_type_id:
          type: integer
          format: int64
          description: Unique seat type ID
        name:
          type: string
          description: Seat type name
        price:
          type: string
          description: Cost of place. Passed as a string to preserve precision
          example: '99.90'
        seat_color:
          $ref: '#/components/schemas/HexColor'
        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
    HexColor:
      type: string
      description: Color in 6-digit or 3-digit HEX format, starting with '#'
      pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
      example: '#4A90E2'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````