Docupilot generate API

The generate API from Docupilot — 7 operation(s) for generate.

OpenAPI Specification

docupilot-generate-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Docupilot accounts APIs ai generate API
  version: '1.0'
  description: Docupilot accounts APIs
  termsOfService: https://docupilot.app/terms-and-conditions/
  contact:
    name: Team Docupilot
    email: support@docupilot.app
tags:
- name: generate
paths:
  /dashboard/api/v2/templates/{id}/generate/:
    post:
      operationId: generate_document
      summary: Generate document from template
      parameters:
      - in: header
        name: X-Client
        schema:
          type: string
        description: Client Origin
      - in: header
        name: X-Workspace
        schema:
          type: string
        description: Workspace unique_key
        required: true
      - in: query
        name: download
        schema:
          type: string
          enum:
          - 'false'
          - file
          - 'true'
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this document.
        required: true
      - in: query
        name: includeUrl
        schema:
          type: boolean
      - in: query
        name: output_type
        schema:
          type: string
          enum:
          - docx
          - html
          - pdf
          - png
          - pptx
          - xlsx
      - in: query
        name: version
        schema:
          type: string
        description: Template version selector. Supports a numeric version id, `latest`, or `live`.
      tags:
      - generate
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: {}
      security:
      - OAuthAuthentication: []
      - SessionAuthentication: []
      - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateGenerateResponse'
          description: file_url is included when download=true or no delivery configuration exists;otherwise, only file_name is returned.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
          description: ''
  /dashboard/api/v2/templates/{id}/generate_test_data/:
    get:
      operationId: generate_test_data
      summary: Generates a test data used for testing template
      parameters:
      - in: header
        name: X-Workspace
        schema:
          type: string
        description: Workspace unique_key
        required: true
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this document.
        required: true
      tags:
      - generate
      security:
      - SessionAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
          description: ''
  /dashboard/api/v2/templates/{id}/test/:
    post:
      operationId: test_document_generation
      summary: Test document generation
      parameters:
      - in: header
        name: X-Workspace
        schema:
          type: string
        description: Workspace unique_key
        required: true
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this document.
        required: true
      - in: query
        name: output_type
        schema:
          type: string
          enum:
          - docx
          - html
          - pdf
          - png
          - pptx
          - xlsx
      - in: query
        name: version_id
        schema:
          type: string
        description: Template version selector. Supports a numeric version id, `latest`, or `live`.
      tags:
      - generate
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: {}
      security:
      - SessionAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateTestResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
          description: ''
  /dashboard/api/v2/templates/{id}/test_data/:
    get:
      operationId: get_test_data
      summary: Get test data used for testing template
      parameters:
      - in: header
        name: X-Workspace
        schema:
          type: string
        description: Workspace unique_key
        required: true
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this document.
        required: true
      tags:
      - generate
      security:
      - OAuthAuthentication: []
      - SessionAuthentication: []
      - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
          description: ''
  /dashboard/api/v2/templates/{template_id}/generate/bulk/sample_csv/:
    post:
      operationId: sample_csv
      summary: Generates a sample csv for the template using ai.
      parameters:
      - in: header
        name: X-Workspace
        schema:
          type: string
        description: Workspace unique_key
        required: true
      - in: query
        name: format
        schema:
          type: string
          enum:
          - json
          - octet-stream
      - in: path
        name: template_id
        schema:
          type: integer
          format: int32
        description: Template id
        required: true
      tags:
      - generate
      security:
      - SessionAuthentication: []
      responses:
        '200':
          content:
            text/csv:
              schema:
                type: string
                format: binary
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/NotFoundError'
          description: ''
  /dashboard/api/v2/templates/{template_id}/merge_links/:
    get:
      operationId: list_generation_links
      description: URL to create document will be {host}/{path}
      summary: Get document create link path
      parameters:
      - in: header
        name: X-Workspace
        schema:
          type: string
        description: Workspace unique_key
        required: true
      - in: path
        name: template_id
        schema:
          type: integer
          format: int32
        required: true
      tags:
      - generate
      security:
      - OAuthAuthentication: []
      - SessionAuthentication: []
      - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DocumentMergeLink'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
          description: ''
    post:
      operationId: create_template_merge_link
      summary: Create template merge link.
      parameters:
      - in: header
        name: X-Workspace
        schema:
          type: string
        description: Workspace unique_key
        required: true
      - in: path
        name: template_id
        schema:
          type: string
        required: true
      tags:
      - generate
      security:
      - OAuthAuthentication: []
      - SessionAuthentication: []
      - tokenAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentMergeLink'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
          description: ''
  /dashboard/api/v2/templates/{template_id}/merge_links/{id}/:
    delete:
      operationId: delete_template_merge_link
      description: Delete template merge link.
      parameters:
      - in: header
        name: X-Workspace
        schema:
          type: string
        description: Workspace unique_key
        required: true
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this document merge link.
        required: true
      - in: path
        name: template_id
        schema:
          type: string
        required: true
      tags:
      - generate
      security:
      - OAuthAuthentication: []
      - SessionAuthentication: []
      - tokenAuth: []
      responses:
        '204':
          description: No response body
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
          description: ''
components:
  schemas:
    UnauthenticatedError:
      type: object
      properties:
        detail:
          type: string
      required:
      - detail
      description: ''
    ValidationError:
      type: object
      properties:
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        non_field_errors:
          type: array
          items:
            type: string
      required:
      - errors
      - non_field_errors
      description: ''
    TemplateTestResponse:
      type: object
      properties:
        file_url:
          type: string
          format: uri
        file_name:
          type: string
      required:
      - file_name
      - file_url
      description: ''
    ForbiddenError:
      type: object
      properties:
        detail:
          type: string
      required:
      - detail
      description: ''
    NotFoundError:
      type: object
      properties:
        detail:
          type: string
      required:
      - detail
      description: ''
    TemplateGenerateResponse:
      type: object
      properties:
        file_url:
          type: string
          format: uri
        file_name:
          type: string
      required:
      - file_name
      - file_url
      description: ''
    DocumentMergeLink:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        path:
          type: string
          readOnly: true
      required:
      - id
      - path
      description: ''
  securitySchemes:
    OAuthAuthentication:
      type: http
      scheme: bearer
      description: OAuth2 Bearer Token Authentication
    SessionAuthentication:
      type: apiKey
      in: cookie
      name: sessionid
      description: browser based login takes care of this
externalDocs:
  description: Help docs on how to use API
  url: https://help.docupilot.app/developers/api-overview