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

# Create Template



## OpenAPI

````yaml /api-reference/openapi.json post /api/export-templates
openapi: 3.1.0
info:
  title: Blindsight API
  version: 0.1.0
servers: []
security: []
paths:
  /api/export-templates:
    post:
      tags:
        - export-templates
      summary: Create Template
      operationId: create_template_api_export_templates_post
      parameters:
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
        - name: blindsight_session
          in: cookie
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Blindsight Session
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportTemplateCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportTemplateRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ExportTemplateCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        format:
          type: string
          enum:
            - xml
            - json
            - csv
          title: Format
          default: xml
        definition:
          $ref: '#/components/schemas/ExportTemplateDefinition'
      additionalProperties: false
      type: object
      required:
        - name
        - definition
      title: ExportTemplateCreate
    ExportTemplateRead:
      properties:
        uuid:
          type: string
          title: Uuid
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        format:
          type: string
          title: Format
        definition:
          type: object
          title: Definition
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - uuid
        - name
        - format
        - definition
        - created_at
        - updated_at
      title: ExportTemplateRead
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ExportTemplateDefinition:
      properties:
        format:
          type: string
          enum:
            - xml
            - json
            - csv
          title: Format
        root_tag:
          type: string
          title: Root Tag
          default: report
        sections:
          items:
            $ref: '#/components/schemas/ExportTemplateSectionSchema'
          type: array
          title: Sections
      type: object
      required:
        - format
        - sections
      title: ExportTemplateDefinition
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ExportTemplateSectionSchema:
      properties:
        id:
          type: string
          title: Id
        source:
          type: string
          enum:
            - dataset
            - scans
            - results
            - actions
          title: Source
        repeat:
          type: boolean
          title: Repeat
          default: false
        tag:
          type: string
          title: Tag
        fields:
          items:
            $ref: '#/components/schemas/ExportTemplateFieldSchema'
          type: array
          title: Fields
        scan_scope:
          type: string
          enum:
            - all_scans
            - selected_scans
          title: Scan Scope
          default: all_scans
        max_rows:
          anyOf:
            - type: integer
              maximum: 100000
              minimum: 1
            - type: 'null'
          title: Max Rows
      type: object
      required:
        - id
        - source
        - tag
        - fields
      title: ExportTemplateSectionSchema
    ExportTemplateFieldSchema:
      properties:
        key:
          type: string
          title: Key
        label:
          type: string
          title: Label
        visible:
          type: boolean
          title: Visible
          default: true
      type: object
      required:
        - key
        - label
      title: ExportTemplateFieldSchema
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````