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



## OpenAPI

````yaml /openapi/document.json post /v2/documents/templates/
openapi: 3.0.3
info:
  title: Yume API — Документы
  version: 1.0.0
  description: Шаблоны и генерация документов.
servers:
  - url: https://api.yume.cloud
    description: Production
  - url: https://api.stage.yume.cloud
    description: Stage
security: []
paths:
  /v2/documents/templates/:
    post:
      tags:
        - templates
      summary: Create templates
      operationId: templates_create
      parameters:
        - $ref: '#/components/parameters/TenantId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateV2Detail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TemplateV2Detail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TemplateV2Detail'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateV2Detail'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    TemplateV2Detail:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          title: Название
          maxLength: 255
        content_type:
          $ref: '#/components/schemas/ContentTypeEnum'
        filter: {}
        created_by:
          type: integer
          nullable: true
        points:
          type: array
          items:
            type: integer
            maximum: 2147483647
            minimum: -2147483648
          title: Точки привязки
        status:
          allOf:
            - $ref: '#/components/schemas/StatusF8bEnum'
          title: Статус
        order:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
          title: Порядок
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Создан
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Обновлен
        format:
          allOf:
            - $ref: '#/components/schemas/FormatEnum'
          title: Формат
        width:
          type: string
          format: decimal
          pattern: ^-?\d{0,4}(?:\.\d{0,2})?$
        height:
          type: string
          format: decimal
          pattern: ^-?\d{0,4}(?:\.\d{0,2})?$
        margin_left:
          type: string
          format: decimal
          pattern: ^-?\d{0,4}(?:\.\d{0,2})?$
        margin_right:
          type: string
          format: decimal
          pattern: ^-?\d{0,4}(?:\.\d{0,2})?$
        margin_top:
          type: string
          format: decimal
          pattern: ^-?\d{0,4}(?:\.\d{0,2})?$
        margin_bottom:
          type: string
          format: decimal
          pattern: ^-?\d{0,4}(?:\.\d{0,2})?$
        scale:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
        content:
          type: string
      required:
        - content
        - content_type
        - created_at
        - id
        - name
        - updated_at
    ContentTypeEnum:
      enum:
        - client
        - orderrequest
      type: string
      description: |-
        * `client` - client
        * `orderrequest` - orderrequest
    StatusF8bEnum:
      enum:
        - active
        - disabled
      type: string
      description: |-
        * `active` - Обязательный
        * `disabled` - Необязательный
    FormatEnum:
      enum:
        - Letter
        - Tabloid
        - Legal
        - Statement
        - Executive
        - Folio
        - A3
        - A4
        - A5
        - B4
        - B5
        - Custom
      type: string
      description: |-
        * `Letter` - Letter (21,6 x 27,9 см)
        * `Tabloid` - Tabloid (27,9 x 43,2 см)
        * `Legal` - Legal (21,6 x 35,6 см)
        * `Statement` - Statement (14,0 x 21,6 см)
        * `Executive` - Executive (18,4 x 26,7 см)
        * `Folio` - Folio (21,6 x 33,0 см)
        * `A3` - A3 (29,7 x 42,0 см)
        * `A4` - A4 (21,0 x 29,7 см)
        * `A5` - A5 (14,8 x 21,0 см)
        * `B4` - B4 (25,0 x 35,3 см)
        * `B5` - B5 (17,6 x 25,0 см)
        * `Custom` - Другой размер
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````