Evrim templates API

The templates API from Evrim — 3 operation(s) for templates.

OpenAPI Specification

evrim-templates-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Evrim answers templates API
  version: 0.5.18
  description: Data when and how you want it.
tags:
- name: templates
paths:
  /prod/v0/templates/:
    get:
      operationId: templates_list
      parameters:
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - in: query
        name: name
        schema:
          type: string
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - name: search
        required: false
        in: query
        description: A search term.
        schema:
          type: string
      tags:
      - templates
      security:
      - knoxApiToken: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTemplateList'
          description: ''
    post:
      operationId: templates_create
      tags:
      - templates
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Template'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Template'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Template'
        required: true
      security:
      - knoxApiToken: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
          description: ''
  /prod/v0/templates/{id}/:
    get:
      operationId: templates_retrieve
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this template.
        required: true
      tags:
      - templates
      security:
      - knoxApiToken: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
          description: ''
    put:
      operationId: templates_update
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this template.
        required: true
      tags:
      - templates
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Template'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Template'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Template'
        required: true
      security:
      - knoxApiToken: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
          description: ''
    patch:
      operationId: templates_partial_update
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this template.
        required: true
      tags:
      - templates
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedTemplate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedTemplate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedTemplate'
      security:
      - knoxApiToken: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
          description: ''
    delete:
      operationId: templates_destroy
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this template.
        required: true
      tags:
      - templates
      security:
      - knoxApiToken: []
      responses:
        '204':
          description: No response body
  /prod/v0/templates/{template_id}/profiles/:
    get:
      operationId: templates_profiles_list
      parameters:
      - in: query
        name: include_answers
        schema:
          type: boolean
          default: true
        description: Include answers in the response
      - in: query
        name: include_fields
        schema:
          type: boolean
          default: true
        description: Include fields in the response
      - in: query
        name: include_snapshots
        schema:
          type: boolean
          default: true
        description: Include snapshots in the response
      - in: path
        name: template_id
        schema:
          type: integer
        description: Template id
        required: true
      - in: query
        name: to_records
        schema:
          type: boolean
          default: false
        description: Transform the snapshot fields into a list of records
      tags:
      - templates
      security:
      - knoxApiToken: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Profile'
          description: ''
components:
  schemas:
    Template:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
        fields:
          type: array
          items:
            $ref: '#/components/schemas/Field'
        questions:
          type: array
          items:
            type: string
            maxLength: 255
      required:
      - fields
      - id
      - name
    Snapshot:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        status:
          type: string
          readOnly: true
          maxLength: 1
        answers:
          type: array
          items:
            $ref: '#/components/schemas/Answer'
          readOnly: true
        fields:
          type: array
          items:
            $ref: '#/components/schemas/CreatedField'
          readOnly: true
        reports:
          type: array
          items:
            $ref: '#/components/schemas/Report'
          readOnly: true
      required:
      - answers
      - fields
      - id
      - reports
      - status
    Field:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          maxLength: 255
        description:
          type: string
          maxLength: 255
        type:
          type: string
          maxLength: 3
        rel_template_id:
          type: integer
          writeOnly: true
          nullable: true
        rel_template:
          type: integer
          readOnly: true
          nullable: true
        enum_values:
          type: array
          items:
            type: string
            maxLength: 255
        enum_many:
          type: boolean
        sources:
          type: array
          items:
            type: string
            maxLength: 255
          nullable: true
        directed:
          type: boolean
          default: false
        keyword_search:
          type: boolean
          default: true
        raw_documents:
          type: boolean
          default: false
      required:
      - description
      - name
      - rel_template
      - type
    Outline:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        profile_id:
          type: integer
          writeOnly: true
        report_title:
          type: string
          writeOnly: true
          maxLength: 255
        section_titles:
          type: array
          items:
            type: string
            maxLength: 255
          writeOnly: true
        outline:
          nullable: true
        perspective:
          type: string
          maxLength: 255
      required:
      - id
      - perspective
      - profile_id
      - report_title
      - section_titles
    PaginatedTemplateList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=400&limit=100
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=200&limit=100
        results:
          type: array
          items:
            $ref: '#/components/schemas/Template'
    PatchedTemplate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
        fields:
          type: array
          items:
            $ref: '#/components/schemas/Field'
        questions:
          type: array
          items:
            type: string
            maxLength: 255
    Report:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        profile_id:
          type: integer
          writeOnly: true
        outline_id:
          type: integer
          writeOnly: true
        outline:
          allOf:
          - $ref: '#/components/schemas/Outline'
          readOnly: true
        report:
          readOnly: true
      required:
      - id
      - outline
      - outline_id
      - profile_id
      - report
    CreatedField:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          writeOnly: true
          maxLength: 255
        specification:
          type: string
          writeOnly: true
          maxLength: 255
        source_entity_type:
          type: string
          writeOnly: true
          nullable: true
          maxLength: 255
        description:
          type: string
          writeOnly: true
          maxLength: 255
        type:
          type: string
          writeOnly: true
          maxLength: 3
        enum_values:
          type: array
          items:
            type: string
            maxLength: 255
          writeOnly: true
        enum_many:
          type: boolean
          writeOnly: true
        rel_template:
          allOf:
          - $ref: '#/components/schemas/Template'
          writeOnly: true
        field:
          allOf:
          - $ref: '#/components/schemas/Field'
          readOnly: true
        status:
          type: string
          readOnly: true
          maxLength: 1
        value:
          readOnly: true
        sources:
          type: array
          items:
            type: string
            maxLength: 255
          writeOnly: true
          nullable: true
        directed_source:
          type: string
          writeOnly: true
          nullable: true
          maxLength: 255
        keyword_search:
          type: boolean
          nullable: true
        raw_documents:
          type: boolean
          nullable: true
      required:
      - description
      - field
      - id
      - name
      - specification
      - status
      - type
      - value
    Profile:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        template_id:
          type: integer
          writeOnly: true
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        specification:
          type: string
          maxLength: 510
        source_map:
          writeOnly: true
        source:
          type: string
          writeOnly: true
          maxLength: 255
        template:
          allOf:
          - $ref: '#/components/schemas/Template'
          readOnly: true
        snapshots:
          type: array
          items:
            $ref: '#/components/schemas/Snapshot'
          readOnly: true
      required:
      - id
      - snapshots
      - specification
      - template
      - template_id
    Answer:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        answer:
          readOnly: true
        question:
          type: string
          readOnly: true
          maxLength: 510
        source:
          type: string
          nullable: true
          maxLength: 510
      required:
      - answer
      - id
      - question
    Tag:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
      required:
      - id
      - name
  securitySchemes:
    knoxApiToken:
      type: http
      scheme: bearer