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

# Create a template from a file upload

> Upload a PDF, DOC, or DOCX file to create a new template. The file must be under 40MB.



## OpenAPI

````yaml /api-reference/openapi.json post /templates
openapi: 3.0.0
info:
  title: Formable API
  version: 1.0.0
  description: External API for redlining and e-signatures.
servers:
  - url: https://api.formabledocs.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Templates
    description: Upload documents and generate editor URLs.
  - name: Signature Requests
    description: Send documents for e-signature and retrieve signed results.
  - name: Redlining
    description: Create and manage collaborative redline negotiations.
  - name: Billing
    description: Retrieve usage information.
  - name: Health
    description: Service health checks.
paths:
  /templates:
    post:
      tags:
        - Templates
      summary: Create a template from a file upload
      description: >-
        Upload a PDF, DOC, or DOCX file to create a new template. The file must
        be under 40MB.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
                - filename
              properties:
                file:
                  type: string
                  format: binary
                  description: The PDF, DOC, or DOCX file to upload (max 40MB)
                filename:
                  type: string
                  description: The name of the file including extension
                  example: document.docx
                signer_roles:
                  type: string
                  description: >-
                    Optional. JSON array of ordered signer roles, sent as a
                    single multipart string. Each item needs a non-empty name
                    and a non-negative integer order (0-based).
                  example: '[{"name":"Client","order":0},{"name":"Witness","order":1}]'
                  x-default: '[{"name":"Client","order":0},{"name":"Witness","order":1}]'
      responses:
        '200':
          description: Template created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  templateId:
                    type: string
                    description: The unique identifier of the created template
                    example: abc123xyz
                  editTemplateAccess:
                    type: object
                    description: Template editing access information
                    properties:
                      editUrl:
                        type: string
                        format: uri
                        description: URL to access the template editor
                        example: https://app.formabledocs.com/template-setup/abc123xyz
                      expiresAt:
                        type: string
                        format: date-time
                        description: >-
                          ISO 8601 timestamp when the edit access expires (1 day
                          from creation by default)
                        example: '2024-01-16T10:30:00.000Z'
        '400':
          description: Bad request - unsupported file type or invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: File and filename are required
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '413':
          description: File size exceeds 40MB limit
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: File size exceeds maximum allowed size
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Internal server error
      security:
        - bearerAuth: []
components:
  responses:
    UnauthorizedError:
      description: Unauthorized - missing or invalid bearer token
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Auth token not valid
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````