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

# Workflow



## OpenAPI

````yaml /openapi.json post /v2/scribe/open-api/workflows/session
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/workflows/session:
    post:
      tags:
        - Scribe Open API
      summary: Workflow
      operationId: scribe_api_session_workflow
      parameters:
        - 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/SessionWorkflow'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionWorkflowRead'
        '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:
    SessionWorkflow:
      properties:
        patient:
          $ref: '#/components/schemas/PatientCreate'
        session:
          $ref: '#/components/schemas/SessionCreate'
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
      additionalProperties: false
      type: object
      required:
        - patient
        - session
      title: SessionWorkflow
    SessionWorkflowRead:
      properties:
        patient:
          $ref: '#/components/schemas/PatientRead'
        session:
          $ref: '#/components/schemas/SessionRead'
        resumed:
          type: boolean
          title: Resumed
      additionalProperties: false
      type: object
      required:
        - patient
        - session
        - resumed
      title: SessionWorkflowRead
    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
    PatientCreate:
      properties:
        external_patient_id:
          type: string
          maxLength: 255
          minLength: 1
          title: External Patient Id
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        pronouns:
          anyOf:
            - type: string
            - type: 'null'
          title: Pronouns
        additional_context:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Additional Context
        restricted_identifiers:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Restricted Identifiers
      additionalProperties: false
      type: object
      required:
        - external_patient_id
        - name
      title: PatientCreate
    SessionCreate:
      properties:
        external_session_id:
          type: string
          maxLength: 255
          minLength: 1
          title: External Session Id
        patient_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Id
        title:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Title
        background_context:
          anyOf:
            - type: string
              maxLength: 100000
            - type: 'null'
          title: Background Context
        input_languages:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 3
            - type: 'null'
          title: Input Languages
        output_language_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Output Language Code
        template_ids:
          items:
            type: string
          type: array
          maxItems: 20
          title: Template Ids
      additionalProperties: false
      type: object
      required:
        - external_session_id
      title: SessionCreate
    PatientRead:
      properties:
        id:
          type: string
          title: Id
        external_patient_id:
          type: string
          title: External Patient Id
        name:
          type: string
          title: Name
        pronouns:
          anyOf:
            - type: string
            - type: 'null'
          title: Pronouns
        additional_context:
          anyOf:
            - type: string
            - type: 'null'
          title: Additional Context
        restricted_identifiers:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Restricted Identifiers
      type: object
      required:
        - id
        - external_patient_id
        - name
      title: PatientRead
    SessionRead:
      properties:
        id:
          type: string
          title: Id
        external_session_id:
          type: string
          title: External Session Id
        patient_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Id
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        status:
          type: string
          title: Status
        background_context:
          anyOf:
            - type: string
            - type: 'null'
          title: Background Context
        input_languages:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Input Languages
        output_language_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Output Language Code
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - external_session_id
        - patient_id
        - title
        - status
        - created_at
      title: SessionRead
    ApiErrorDetail:
      type: object
      properties:
        field:
          type: string
        code:
          type: string
      required:
        - code
  securitySchemes:
    ScribeApiJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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