> ## 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.

# List questionnaires

> Lists all questionnaires available for the authenticated API key. Supports filtering by `status`.



## OpenAPI

````yaml /openapi/openapi-maria-en.yaml get /api/v1/questionnaires
openapi: 3.1.0
info:
  title: marIA API
  version: 1.0.0
  description: >
    marIA is Omniloy's voice agent that handles incoming patient calls at
    hospitals and clinics.

    - Voice / Telephony: the patient calls and marIA answers, manages
    appointments with the EHR/HIS, answers FAQs and escalates to a human when
    necessary.

    - WhatsApp Notifications: appointment confirmations and reminders via
    approved template.

    - Centers and services: consultation and management of centers, specialties
    and coverages configured in marIA.

    - FAQ Knowledge Base: documents that feed the agent's knowledge about
    centers and services.

    - Outbound calls and questionnaires: outbound scheduling and follow up
    questionnaires.

    - EHR/HIS integration via webhooks: marIA ⇄ Hospital for benefits, slots and
    appointments.

    - Webhook management: registration and configuration of endpoints to receive
    events from marIA.

    Top-level webhooks notify events (e.g. call status, appointments) signed
    with `webhookHmac`.
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 the request.
  - url: https://{your-dev-endpoint}
    description: Staging
    variables:
      your-dev-endpoint:
        default: your-dev-endpoint
        description: Replace this value with the staging or development host.
security: []
tags:
  - name: Health
    description: Service status and availability.
  - name: Centers
    description: Medical centers with their services and coverages configured in marIA.
  - name: WhatsApp Notifications
    description: Sending appointment confirmations and reminders via WhatsApp template.
  - name: FAQ
    description: >-
      FAQ documents so the agent can answer questions about centers and
      services.
  - name: Webhooks - Appointments
    description: Appointment events integrated with the EHR/HIS.
  - name: Webhooks - Voice
    description: Telephony events (call status, escalation, answers and transcripts).
  - name: Voice Calls
    description: Inbound and outbound calls registered in MarIA Core.
  - name: Voice Answers
    description: Access and filtering of answers captured during calls.
  - name: Voice Transcripts
    description: Access to transcripts and recording links.
  - name: Content - Questionnaires
    description: Questionnaire definitions for outbound calls.
  - name: Questionnaire Instances
    description: Questionnaire instance status, review state, and results.
  - name: Scheduling - Time Ranges
    description: Reusable time ranges for scheduling calls.
  - name: Gestión de webhooks
    description: Webhook configuration and management; endpoints for integrators.
paths:
  /api/v1/questionnaires:
    get:
      tags:
        - Content - Questionnaires
      summary: List questionnaires
      description: >-
        Lists all questionnaires available for the authenticated API key.
        Supports filtering by `status`.
      operationId: list-questionnaires
      parameters:
        - name: status
          in: query
          schema:
            type: string
            enum:
              - draft
              - active
              - archived
      responses:
        '200':
          description: Questionnaire list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuestionnaireListEnvelopeDto'
      security:
        - apiKeyAuth: []
components:
  schemas:
    QuestionnaireListEnvelopeDto:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: array
          items:
            $ref: '#/components/schemas/QuestionnaireCoreDto'
    QuestionnaireCoreDto:
      allOf:
        - $ref: '#/components/schemas/QuestionnaireCoreInputDto'
        - type: object
          properties:
            id:
              type: string
              format: uuid
            status:
              type: string
              enum:
                - draft
                - active
                - archived
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            questions:
              type: array
              items:
                $ref: '#/components/schemas/QuestionnaireQuestionDto'
            templateVariables:
              type: array
              items:
                $ref: '#/components/schemas/TemplateVariableDto'
            edges:
              type: array
              items:
                $ref: '#/components/schemas/QuestionnaireEdgeDto'
            scoreClasses:
              type: array
              items:
                $ref: '#/components/schemas/ScoreClassDto'
            protocolActions:
              type: array
              items:
                $ref: '#/components/schemas/ProtocolActionDto'
    QuestionnaireCoreInputDto:
      type: object
      properties:
        title:
          $ref: '#/components/schemas/LocalizedTextDto'
        description:
          $ref: '#/components/schemas/LocalizedTextDto'
        defaultLanguage:
          type: string
          example: en
        version:
          type: number
          nullable: true
        externalId:
          type: string
          nullable: true
        metadata:
          type: object
          additionalProperties: true
        templateVariables:
          type: array
          items:
            $ref: '#/components/schemas/TemplateVariableDto'
        questions:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/QuestionnaireQuestionInputDto'
        edges:
          type: array
          items:
            $ref: '#/components/schemas/QuestionnaireEdgeDto'
        scoreClasses:
          type: array
          items:
            $ref: '#/components/schemas/ScoreClassDto'
        webhooks:
          type: object
          additionalProperties:
            type: string
            format: uuid
          description: Map of questionnaire event to webhookId.
        scheduling:
          $ref: '#/components/schemas/QuestionnaireSchedulingDto'
        protocolActions:
          type: array
          items:
            $ref: '#/components/schemas/ProtocolActionDto'
      required:
        - title
        - questions
    QuestionnaireQuestionDto:
      allOf:
        - $ref: '#/components/schemas/QuestionnaireQuestionInputDto'
        - type: object
          properties:
            id:
              type: string
              format: uuid
            questionnaireId:
              type: string
              format: uuid
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
    TemplateVariableDto:
      type: object
      required:
        - key
        - label
        - type
        - required
      properties:
        key:
          type: string
        label:
          type: string
        type:
          type: string
          enum:
            - text
            - number
            - date
            - time
        required:
          type: boolean
    QuestionnaireEdgeDto:
      type: object
      properties:
        id:
          type: string
        questionnaireId:
          type: string
        sourceQuestionId:
          type: string
          nullable: true
        targetQuestionId:
          type: string
          nullable: true
        conditionOperator:
          type: string
          nullable: true
          enum:
            - equals
            - not_equals
            - greater_than
            - less_than
            - greater_or_equal
            - less_or_equal
            - contains
            - not_contains
        conditionValue:
          type: string
          nullable: true
        edgeOrder:
          type: number
        label:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ScoreClassDto:
      type: object
      required:
        - min
        - max
        - level
        - label
      properties:
        min:
          type: number
        max:
          type: number
        level:
          type: number
        label:
          type: string
    ProtocolActionDto:
      type: object
      required:
        - type
        - title
        - displayOrder
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - text
            - single_select
            - multiple_choice
        title:
          type: string
        options:
          type: array
          nullable: true
          items:
            type: object
            properties:
              label:
                type: string
              value:
                type: string
        displayOrder:
          type: number
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    LocalizedTextDto:
      type: object
      additionalProperties:
        type: string
      example:
        es: Seguimiento postconsulta
        en: Post-visit follow up
    QuestionnaireQuestionInputDto:
      type: object
      properties:
        id:
          type: string
          description: Optional client-side ID used to remap edges.
        questionText:
          $ref: '#/components/schemas/LocalizedTextDto'
        questionType:
          type: string
          enum:
            - text
            - numeric
            - boolean
            - multiple_choice
            - single_select
            - rating
            - date
        clarificationText:
          $ref: '#/components/schemas/LocalizedTextDto'
        externalId:
          type: string
          description: Question ID in an external system.
        options:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              label:
                $ref: '#/components/schemas/LocalizedTextDto'
              score:
                type: number
        isRequired:
          type: boolean
          default: true
        displayOrder:
          type: number
        metadata:
          type: object
          additionalProperties: true
      required:
        - questionText
        - questionType
    QuestionnaireSchedulingDto:
      type: object
      properties:
        startDate:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
        endDate:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
        frequency:
          type: object
          properties:
            every:
              type: integer
              minimum: 1
            unit:
              type: string
              enum:
                - hours
                - days
                - weeks
                - months
        timeSlots:
          type: array
          items:
            type: object
            required:
              - key
              - label
              - startTime
              - endTime
            properties:
              key:
                type: string
              label:
                type: string
              startTime:
                type: string
                pattern: ^\d{2}:\d{2}$
              endTime:
                type: string
                pattern: ^\d{2}:\d{2}$
        allowedDaysOfWeek:
          type: array
          items:
            type: integer
            minimum: 0
            maximum: 6
        maxInstances:
          type: integer
          minimum: 1
        maxRetries:
          type: integer
          minimum: 0
        retryWindow:
          type: object
          properties:
            every:
              type: integer
              minimum: 1
            unit:
              type: string
              enum:
                - hours
                - days
                - weeks
                - months
        frequencyOverrides:
          type: array
          nullable: true
          items:
            type: object
            required:
              - every
              - unit
              - scoreLevel
            properties:
              every:
                type: integer
                minimum: 1
              unit:
                type: string
                enum:
                  - hours
                  - days
                  - weeks
                  - months
              scoreLevel:
                type: integer
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API Key provided by Omniloy. The same key is used for inbound and
        outbound calls.

````