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

# Structured Response



## OpenAPI

````yaml /openapi.json post /v2/scribe/open-api/sessions/{session_id}/structured-responses
openapi: 3.1.0
info:
  title: Cortexa Scribe Open API
  description: >-
    Authorized EHR access to Cortexa Scribe. All clinical resources are scoped
    to a partner grant.
  version: 2.0.0
servers:
  - url: https://sandbox.api.cortexanote.com
security: []
paths:
  /v2/scribe/open-api/sessions/{session_id}/structured-responses:
    post:
      tags:
        - Scribe Open API
      summary: Structured Response
      operationId: scribe_api_structured_response_create
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            title: Session Id
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 128
            title: Idempotency-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StructuredTemplate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructuredResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '422':
          description: Business rule violation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      security:
        - ScribeApiJWT: []
components:
  schemas:
    StructuredTemplate:
      properties:
        template:
          type: string
          maxLength: 20000
          title: Template
          default: ''
        questions:
          items:
            $ref: '#/components/schemas/FormQuestion'
          type: array
          maxItems: 100
          minItems: 1
          title: Questions
        summaryRequired:
          type: boolean
          title: Summaryrequired
          default: false
        metadata:
          items:
            type: string
          type: array
          maxItems: 50
          title: Metadata
      additionalProperties: false
      type: object
      required:
        - questions
      title: StructuredTemplate
    StructuredResult:
      properties:
        id:
          type: string
          title: Id
        document_id:
          type: string
          title: Document Id
        document_version:
          type: integer
          title: Document Version
        content:
          anyOf:
            - type: string
            - type: 'null'
          title: Content
        questionAnswers:
          items:
            $ref: '#/components/schemas/AnsweredQuestion'
          type: array
          title: Questionanswers
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
      additionalProperties: false
      type: object
      required:
        - id
        - document_id
        - document_version
        - content
        - questionAnswers
        - summary
      title: StructuredResult
    ApiErrorResponse:
      type: object
      properties:
        message:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiErrorDetail'
        context:
          type: object
          additionalProperties:
            type: string
          description: Explicitly public context for handling business errors.
      required:
        - message
        - errors
    FormQuestion:
      properties:
        questionId:
          type: string
          maxLength: 128
          minLength: 1
          title: Questionid
        question:
          type: string
          maxLength: 2000
          minLength: 1
          title: Question
        description:
          type: string
          maxLength: 4000
          title: Description
          default: ''
        answerType:
          type: string
          enum:
            - SingleResponse
            - MultipleResponse
            - TextArea
            - DateResponse
          title: Answertype
        answerOptions:
          items:
            $ref: '#/components/schemas/AnswerOption'
          type: array
          maxItems: 100
          title: Answeroptions
        dateFormat:
          type: string
          enum:
            - D MMM YYYY
            - DD/MM/YYYY
            - MM/DD/YYYY
            - MMMM DD YYYY
            - MMM DD YYYY
            - YYYY/MM/DD
          title: Dateformat
          default: YYYY/MM/DD
        repeatable:
          type: boolean
          title: Repeatable
          default: false
        childQuestions:
          items:
            $ref: '#/components/schemas/FormQuestion'
          type: array
          maxItems: 100
          title: Childquestions
      additionalProperties: false
      type: object
      required:
        - questionId
        - question
        - answerType
      title: FormQuestion
    AnsweredQuestion:
      properties:
        questionId:
          type: string
          maxLength: 128
          minLength: 1
          title: Questionid
        question:
          type: string
          maxLength: 2000
          minLength: 1
          title: Question
        description:
          type: string
          maxLength: 4000
          title: Description
          default: ''
        answerType:
          type: string
          enum:
            - SingleResponse
            - MultipleResponse
            - TextArea
            - DateResponse
          title: Answertype
        answerOptions:
          items:
            $ref: '#/components/schemas/AnswerOption'
          type: array
          maxItems: 100
          title: Answeroptions
        dateFormat:
          type: string
          enum:
            - D MMM YYYY
            - DD/MM/YYYY
            - MM/DD/YYYY
            - MMMM DD YYYY
            - MMM DD YYYY
            - YYYY/MM/DD
          title: Dateformat
          default: YYYY/MM/DD
        repeatable:
          type: boolean
          title: Repeatable
          default: false
        childQuestions:
          items:
            $ref: '#/components/schemas/AnsweredQuestion'
          type: array
          title: Childquestions
        answer:
          items:
            $ref: '#/components/schemas/QuestionAnswer'
          type: array
          title: Answer
      additionalProperties: false
      type: object
      required:
        - questionId
        - question
        - answerType
      title: AnsweredQuestion
    ApiErrorDetail:
      type: object
      properties:
        field:
          type: string
        code:
          type: string
      required:
        - code
    AnswerOption:
      properties:
        value:
          type: string
          maxLength: 1000
          minLength: 1
          title: Value
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      additionalProperties: false
      type: object
      required:
        - value
      title: AnswerOption
    QuestionAnswer:
      properties:
        value:
          anyOf:
            - type: string
            - type: 'null'
          title: Value
      additionalProperties: false
      type: object
      title: QuestionAnswer
  securitySchemes:
    ScribeApiJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.