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

# Get a questionnaire with its result

> Includes the protocol version, answers, calls, notes, a patient summary, and the score.



## OpenAPI

````yaml /openapi/openapi-olivia-en.yaml get /v1/protocol-runs/{runId}
openapi: 3.1.0
info:
  title: OlivIA API
  version: 0.1.0
  description: >
    OlivIA external API — Omniloy's clinical voice follow-up platform. It lets
    an external system (EHR/HIS, CRM, or your own backend):

    - Follow-up (outbound calls): enroll patients in a protocol so OlivIA calls
    them to complete a questionnaire.

    - Triage (inbound calls): results of triage calls are read through these
    same read endpoints.

    - Read results: questionnaires (protocol runs), answers, score, calls,
    transcript, and recording.

    Authentication uses a personal API key as a bearer token (`Authorization:
    Bearer oc_sk_...`). All routes are under the `/v1` prefix and responses wrap
    the payload in `data`.
servers:
  - url: https://{your-prod-endpoint}
    description: Production
    variables:
      your-prod-endpoint:
        default: your-prod-endpoint
        description: Replace this value with the real host before trying a request.
  - url: https://{your-dev-endpoint}
    description: Staging
    variables:
      your-dev-endpoint:
        default: your-dev-endpoint
        description: Replace this value with your staging host.
security:
  - bearerAuth: []
tags:
  - name: Protocols
    description: Read and archive protocols.
  - name: Enrollments
    description: Enroll patients and read enrollments (outbound follow-up).
  - name: Protocol Runs
    description: Protocol runs (questionnaire executions) and their results.
  - name: Calls
    description: Call detail, transcript, and recording.
paths:
  /v1/protocol-runs/{runId}:
    get:
      tags:
        - Protocol Runs
      summary: Get a questionnaire with its result
      description: >-
        Includes the protocol version, answers, calls, notes, a patient summary,
        and the score.
      operationId: get-protocol-run
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Protocol run with answers, calls, notes, and score
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProtocolRunResponse'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    ProtocolRunResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ProtocolRun'
    ProtocolRun:
      type: object
      properties:
        id:
          type: string
          format: uuid
        org_id:
          type: string
          format: uuid
        enrollment_id:
          type: string
          format: uuid
        protocol_version_id:
          type: string
          format: uuid
        sequence_number:
          type: integer
        scheduled_at:
          type: string
          format: date-time
          nullable: true
        started_at:
          type: string
          format: date-time
          nullable: true
        ended_at:
          type: string
          format: date-time
          nullable: true
        questionnaire_status:
          type: string
          enum:
            - pending
            - in_progress
            - completed
            - rejected
            - call_failed
            - wrong_number
            - no_answer
            - unresolved
            - cancelled
        language:
          type: string
        reviewed_at:
          type: string
          format: date-time
          nullable: true
        review_note:
          type: string
          nullable: true
        score:
          type: number
          nullable: true
        score_class:
          type: string
          nullable: true
        origin:
          type: string
          enum:
            - dispatcher_scheduled
            - manual
            - voice_initiated
            - external_api
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: oc_sk_ API key

````