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

# Create maintenances



## OpenAPI

````yaml /openapi/main.json post /v1/crm/maintenances/
openapi: 3.0.3
info:
  title: Yume API — Основное
  version: 1.0.0
  description: Базовые сущности и бизнес-логика CRM.
servers:
  - url: https://api.yume.cloud
    description: Production
  - url: https://api.stage.yume.cloud
    description: Stage
security: []
paths:
  /v1/crm/maintenances/:
    post:
      tags:
        - maintenances
      summary: Create maintenances
      operationId: maintenances_create
      parameters:
        - $ref: '#/components/parameters/TenantId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BaseInventoryMaintenance'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BaseInventoryMaintenance'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BaseInventoryMaintenance'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseInventoryMaintenance'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    BaseInventoryMaintenance:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
        state:
          type: integer
          nullable: true
        interval:
          type: string
          nullable: true
        inventory:
          type: integer
        type:
          allOf:
            - $ref: '#/components/schemas/Type56bEnum'
          minimum: -32768
          maximum: 32767
        period_type:
          nullable: true
          minimum: -32768
          maximum: 32767
          oneOf:
            - $ref: '#/components/schemas/PeriodTypeEnum'
            - $ref: '#/components/schemas/NullEnum'
        maintenance_date:
          type: string
          format: date-time
          nullable: true
        distance_threshold:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
        time_threshold:
          type: string
          nullable: true
        responsible:
          type: integer
        total_distance:
          type: integer
          maximum: 9223372036854776000
          minimum: -9223372036854776000
          format: int64
          nullable: true
        distance:
          type: integer
          maximum: 9223372036854776000
          minimum: -9223372036854776000
          format: int64
          nullable: true
        comment:
          type: string
          readOnly: true
          nullable: true
        fact_maintenance_date:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        end_total_distance:
          type: integer
          readOnly: true
          nullable: true
      required:
        - comment
        - end_total_distance
        - fact_maintenance_date
        - id
        - inventory
        - name
        - responsible
        - type
    Type56bEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Разовое
        * `1` - Периодическое
    PeriodTypeEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - По интервалу
        * `1` - По пробегу
    NullEnum:
      enum:
        - null
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````