Listen Labs Public API

The Public API from Listen Labs — 9 operation(s) for public.

OpenAPI Specification

listen-labs-public-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Listen Labs API — Study Data Public API
  version: 1.0.0
  description: 'Retrieve studies, responses, transcripts, and questions from Listen Labs. Authenticate with an `x-api-key` header (contact support@listenlabs.ai to request a key). Each API key is scoped to a single organization.


    Endpoints for creating and launching studies are described in a separate spec: https://docs.listenlabs.ai/api-v2/openapi.yaml


    Full documentation: https://docs.listenlabs.ai'
servers:
- url: https://listenlabs.ai
  description: Production
security:
- ApiKeyAuth: []
tags:
- name: Public
paths:
  /api/public/list_surveys:
    get:
      operationId: listStudies
      summary: List Studies
      description: Lists all studies in the API key's organization.
      responses:
        '200':
          description: A list of studies.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Study'
        '401':
          $ref: '#/components/responses/Unauthorized'
      tags:
      - Public
  /api/public/responses/{link_id}:
    get:
      operationId: getResponses
      summary: Get Responses
      description: Lists all responses for a given study.
      parameters:
      - name: link_id
        in: path
        required: true
        description: The link ID of the study. You can find this in the study URL (e.g. in `https://listenlabs.ai/s/abc123` the link ID is `abc123`) or via the List Studies endpoint.
        schema:
          type: string
      - name: page
        in: query
        description: The page number for pagination.
        schema:
          type: integer
          default: 0
      - name: per_page
        in: query
        description: Number of responses to return per page.
        schema:
          type: integer
          default: 1000
      - name: updated_since
        in: query
        description: ISO 8601 date string to filter responses updated after this date (e.g. `2023-08-18T11:51:54.649916Z`).
        schema:
          type: string
          format: date-time
      - name: include_in_progress
        in: query
        description: Whether to include responses whose analysis is still in progress.
        schema:
          type: boolean
          default: true
      responses:
        '200':
          description: A list of responses for the given study.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ResponseSummary'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      tags:
      - Public
  /api/public/responses/{link_id}/{response_id}:
    get:
      operationId: getSingleResponse
      summary: Get Single Response
      description: Retrieves a single response for a specific study, including the full interview transcript with audio/video links where available.
      parameters:
      - name: link_id
        in: path
        required: true
        description: The link ID of the study.
        schema:
          type: string
      - name: response_id
        in: path
        required: true
        description: The unique ID of the specific response to retrieve.
        schema:
          type: string
      responses:
        '200':
          description: The response with its full transcript.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseDetail'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      tags:
      - Public
  /api/public/studies/{study_id}/questions:
    get:
      operationId: getStudyQuestions
      summary: Get Study Questions
      description: Retrieves all questions for a specific study, from the study's latest revision.
      parameters:
      - name: study_id
        in: path
        required: true
        description: The link ID of the study to retrieve questions for. You can find it in the study URL or via the List Studies endpoint.
        schema:
          type: string
      responses:
        '200':
          description: The study's questions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  questions:
                    type: array
                    items:
                      $ref: '#/components/schemas/Question'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      tags:
      - Public
  /api/public/v1/studies/create:
    post:
      operationId: createStudy
      summary: Create a study (draft) from a guide
      description: Validates the guide and creates a draft study in the API key's org.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateStudyRequest'
      responses:
        '201':
          description: Draft created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateResponse'
        '400':
          description: 'Invalid JSON, request body, or study guide. Codes: `invalid_json`, `invalid_request_body`, `invalid_study_guide`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                invalidJson:
                  value:
                    error: Invalid JSON body
                    code: invalid_json
                invalidRequestBody:
                  value:
                    error: Invalid request body
                    code: invalid_request_body
                    issues:
                    - code: invalid_type
                      expected: string
                      received: undefined
                      path:
                      - title
                      message: Required
                invalidStudyGuide:
                  value:
                    error: 'Invalid study guide: conditional references unknown item externalId ''q2'''
                    code: invalid_study_guide
        '401':
          $ref: '#/components/responses/Unauthorized_2'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          description: 'The draft was modified concurrently; retry. Codes: `concurrent_modification`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                concurrentModification:
                  value:
                    error: Study was modified concurrently; please retry
                    code: concurrent_modification
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
      - Public
  /api/public/v1/responses/{linkId}:
    get:
      operationId: listResponses
      summary: List responses for a study
      description: Paginated responses with answers and summaries.
      parameters:
      - name: linkId
        in: path
        required: true
        description: The editable link ID used in the response URL.
        schema:
          type: string
      - name: page
        in: query
        schema:
          type: integer
          minimum: 0
          default: 0
      - name: perPage
        in: query
        schema:
          type: integer
          minimum: 1
          default: 1000
      - name: updatedSince
        in: query
        description: Only responses updated at or after this timestamp.
        schema:
          type: string
          format: date-time
      - name: includeInProgress
        in: query
        schema:
          type: boolean
          default: true
      responses:
        '200':
          description: Responses
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResponsesResponse'
        '400':
          description: 'One or more query parameters are invalid. Codes: `bad_request`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalidPage:
                  value:
                    error: page must be an integer of at least 0
                    code: bad_request
                invalidUpdatedSince:
                  value:
                    error: updatedSince must be an ISO 8601 timestamp
                    code: bad_request
        '401':
          $ref: '#/components/responses/Unauthorized_2'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: 'The study is not in the key''s organization. Codes: `study_not_found`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                studyNotFound:
                  value:
                    error: Study not found
                    code: study_not_found
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
      - Public
  /api/public/v1/responses/{linkId}/{responseId}:
    get:
      operationId: getSingleResponse
      summary: Get one response by UUID or readable ID
      description: Response transcript, URL parameters, and summaries.
      parameters:
      - name: linkId
        in: path
        required: true
        description: The editable link ID used in the response URL.
        schema:
          type: string
      - name: responseId
        in: path
        required: true
        description: Response UUID or positive readable numeric ID.
        schema:
          oneOf:
          - type: string
            format: uuid
          - type: string
            pattern: ^[1-9][0-9]*$
      responses:
        '200':
          description: Response details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSingleResponseResponse'
        '400':
          description: 'The response identifier is invalid. Codes: `bad_request`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalidResponseId:
                  value:
                    error: responseId must be a UUID or a positive readable ID
                    code: bad_request
        '401':
          $ref: '#/components/responses/Unauthorized_2'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: 'Study or response not found. Codes: `study_not_found`, `response_not_found`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                studyNotFound:
                  value:
                    error: Study not found
                    code: study_not_found
                responseNotFound:
                  value:
                    error: Response not found
                    code: response_not_found
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
      - Public
  /api/public/v1/studies/{studyId}/launch:
    post:
      operationId: launchStudy
      summary: Launch a draft and return the self-recruit link
      description: 'Publishes the draft and opens its self-recruit link. Requires the key''s user to have StartRecruitment on the study. Project responses bill to the launch wallet: pass walletId, or omit the body to auto-select the organization''s wallet when it has exactly one.'
      parameters:
      - name: studyId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LaunchRequest'
      responses:
        '200':
          description: Launched
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LaunchResponse'
        '400':
          description: 'Invalid body, the organization has multiple wallets and walletId was omitted, or the wallet cannot fund the launch (insufficient balance or grant limit). Codes: `invalid_json`, `invalid_request_body`, `wallet_required`, `insufficient_credits`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                invalidJson:
                  value:
                    error: Invalid JSON body
                    code: invalid_json
                invalidRequestBody:
                  value:
                    error: Invalid request body
                    code: invalid_request_body
                    issues:
                    - code: invalid_type
                      expected: string
                      received: number
                      path:
                      - walletId
                      message: Expected string, received number
                walletRequired:
                  value:
                    error: Multiple wallets are available to this organization; pass walletId in the request body (see GET /api/public/v1/wallets)
                    code: wallet_required
                insufficientCredits:
                  value:
                    error: Insufficient balance
                    code: insufficient_credits
        '401':
          $ref: '#/components/responses/Unauthorized_2'
        '403':
          description: 'No permission to launch this study, or no access to the specified wallet. Codes: `launch_permission_denied`, `wallet_access_denied`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                launchPermissionDenied:
                  value:
                    error: No permission to launch this study
                    code: launch_permission_denied
                walletAccessDenied:
                  value:
                    error: No access to the specified wallet
                    code: wallet_access_denied
        '404':
          description: 'Study not found in the key''s org. Codes: `study_not_found`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                studyNotFound:
                  value:
                    error: Study not found
                    code: study_not_found
        '409':
          description: 'The study is busy (an update is in flight) or the publish raced a concurrent edit. Codes: `study_busy`, `conflict`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                studyBusy:
                  value:
                    error: Study is currently being updated. Try again in a moment.
                    code: study_busy
                publishRace:
                  value:
                    error: Revision is no longer a dev revision. Please refresh and try again.
                    code: conflict
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
      - Public
  /api/public/v1/wallets:
    get:
      operationId: listWallets
      summary: List the organization's wallets with balances
      description: Wallets granted to the API key's organization, each with recruitment and project credit balances. Use a wallet's walletId when launching a study.
      responses:
        '200':
          description: Wallets
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized_2'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
      - Public
components:
  schemas:
    Question:
      type: object
      required:
      - id
      - text
      - is_screener
      - type
      - question_number
      properties:
        id:
          type: string
          description: Unique identifier for the question. Matches the `discussion_guide_question_id` field in the response endpoints.
        text:
          type: string
          description: The question text shown to participants.
        is_screener:
          type: boolean
          description: Whether this question is part of the screening section.
        type:
          type: string
          enum:
          - open_ended
          - multiple_choice
          - ranking
          - statement
          description: The question type.
        question_number:
          type: number
          description: The human-readable question number for display purposes.
        concepts:
          type: array
          description: Concept objects attached to this question (empty if the question is not part of a concept test block).
          items:
            $ref: '#/components/schemas/Concept'
        is_multi_select:
          type: boolean
          description: 'Multiple choice only: whether the participant can select multiple options.'
        options:
          type: array
          items:
            type: string
          description: 'Multiple choice and ranking only: the list of answer options or items to rank.'
    Concept_2:
      type: object
      properties:
        externalId:
          type: string
          minLength: 1
          description: Stable identifier for this concept. Auto-generated when omitted. Unique within the payload.
        nickname:
          type: string
          minLength: 1
        content:
          type: object
          properties:
            title:
              type: string
            description:
              type: string
              nullable: true
            media:
              type: array
              items:
                $ref: '#/components/schemas/ConceptMedia'
            embed:
              type: object
              properties:
                url:
                  type: string
                  format: uri
              required:
              - url
              additionalProperties: false
              nullable: true
          required:
          - title
          additionalProperties: false
        conditional:
          allOf:
          - $ref: '#/components/schemas/Conditional'
          nullable: true
          description: Shows this concept only to participants matching the criteria, e.g. gate each concept on a screener answer. selectedTemplateOptions criteria must reference an item in a block before the concept block.
      required:
      - nickname
      - content
      additionalProperties: false
    TranscriptRow:
      type: object
      properties:
        moderator:
          type: string
          description: The message from the assistant/moderator.
        user:
          type: string
          description: The response from the user.
        discussion_guide_question_id:
          type: string
          description: The discussion guide question ID for this row. Matches the `id` field from the Get Study Questions endpoint.
        concept_id:
          type: string
          nullable: true
          description: The concept ID for this row. Null if the question isn't concept-specific.
        answer_id:
          type: string
          nullable: true
          description: The answer ID for this question. Matches the `answer_id` in the list endpoint's `answers_array`. Null for non-question rows (e.g. intro messages).
        response_index:
          type: number
          description: The zero-based index of this row in the conversation history.
        is_followup:
          type: boolean
          description: Whether this row is a follow-up to the same question as the previous row.
        audio:
          type: string
          nullable: true
          description: A signed URL to the audio recording of the user's response, if available. Valid for 1 hour. Null if no audio recording exists.
        video:
          type: object
          nullable: true
          description: Video playback information, if available. Null if no video recording exists.
          properties:
            stream_url:
              type: string
              description: HLS stream URL for the video recording.
            mp4_url:
              type: string
              description: Direct MP4 download URL for the video recording.
        question_uuid:
          type: string
          deprecated: true
          description: Deprecated. Use `discussion_guide_question_id` instead.
    Media:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        url:
          type: string
          format: uri
        type:
          type: string
          enum:
          - image
          - video
        widthPercentage:
          type: number
        forceWatching:
          type: boolean
      required:
      - name
      - url
      - type
      additionalProperties: false
    LaunchRequest:
      type: object
      properties:
        walletId:
          type: string
          format: uuid
          description: Wallet to bill this study from; must be granted to the API key's organization (see GET /api/public/v1/wallets). Omit to auto-select the organization's wallet when it has exactly one.
      additionalProperties: false
      description: Optional body; omit it entirely to auto-select the wallet.
    RankingItem:
      type: object
      properties:
        externalId:
          type: string
          minLength: 1
          description: Stable identifier for this item. Auto-generated when omitted; set it only when a conditional (questionId) or carryForwardFrom references it. Unique within the payload.
        text:
          type: string
          minLength: 1
        conditional:
          allOf:
          - $ref: '#/components/schemas/Conditional'
          nullable: true
        media:
          type: array
          items:
            $ref: '#/components/schemas/Media'
          nullable: true
        embed:
          allOf:
          - $ref: '#/components/schemas/Embed'
          nullable: true
        type:
          type: string
          enum:
          - ranking
        options:
          type: array
          items:
            $ref: '#/components/schemas/Option'
          minItems: 1
          description: Required unless carryForwardFrom is set; carry-forward questions rank the source's selected options.
        randomizeOptionOrder:
          type: boolean
          nullable: true
        carryForwardFrom:
          type: string
          nullable: true
          description: externalId of an earlier multi-select multiple_choice item; this question ranks only the options the participant selected there.
      required:
      - text
      - type
      additionalProperties: false
    WelcomeMessage:
      type: object
      properties:
        title:
          type: string
        message:
          type: string
      additionalProperties: false
    Concept:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the concept.
        title:
          type: string
          description: The concept title.
        description:
          type: string
          description: The concept description.
        media:
          type: array
          description: Media attachments.
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                - image
                - video
                description: The media type.
              name:
                type: string
                description: The file name of the media.
              url:
                type: string
                description: The URL of the media file.
        embed_url:
          type: string
          nullable: true
          description: An optional embed URL for the concept (e.g. a Figma or prototype link).
    Embed:
      type: object
      properties:
        url:
          type: string
          format: uri
        proxyUrl:
          type: string
          format: uri
      required:
      - url
      additionalProperties: false
    MaxDiffItem:
      type: object
      properties:
        externalId:
          type: string
          minLength: 1
          description: Stable identifier for this item. Auto-generated when omitted; set it only when a conditional (questionId) or carryForwardFrom references it. Unique within the payload.
        text:
          type: string
          minLength: 1
        conditional:
          allOf:
          - $ref: '#/components/schemas/Conditional'
          nullable: true
        media:
          type: array
          items:
            $ref: '#/components/schemas/Media'
          nullable: true
        embed:
          allOf:
          - $ref: '#/components/schemas/Embed'
          nullable: true
        type:
          type: string
          enum:
          - max_diff
        options:
          type: array
          items:
            $ref: '#/components/schemas/Option'
          minItems: 2
          description: The items being compared.
        metric:
          type: string
          nullable: true
        itemsPerScreen:
          anyOf:
          - type: number
            enum:
            - 3
          - type: number
            enum:
            - 4
          - type: number
            enum:
            - 5
          nullable: true
      required:
      - text
      - type
      - options
      additionalProperties: false
    Config:
      type: object
      properties:
        interviewMode:
          type: string
          enum:
          - text
          - audio
          - audio_text
          - audio_screen
          - video
          - video_screen
        questionLanguage:
          type: string
          enum:
          - en
          - en-medical
          - fr
          - de
          - de-CH
          - it
          - pt
          - es
          - zh
          - zh-TW
          - zh-HK
          - af
          - sq
          - am
          - ar
          - hy
          - as
          - ast
          - az
          - ba
          - eu
          - be
          - bn
          - bs
          - br
          - bg
          - my
          - ca
          - ceb
          - ny
          - hr
          - cs
          - da
          - nl
          - et
          - fo
          - fi
          - nl-BE
          - ff
          - gl
          - lg
          - ka
          - el
          - gu
          - ht
          - ha
          - haw
          - he
          - hi
          - hu
          - is
          - ig
          - id
          - ga
          - ja
          - jw
          - kea
          - kn
          - kk
          - km
          - ko
          - ku
          - ky
          - lo
          - la
          - lv
          - ln
          - lt
          - luo
          - lb
          - mk
          - mg
          - ms
          - ml
          - mt
          - mi
          - mr
          - mn
          - ne
          - nso
          - 'no'
          - nn
          - oc
          - or
          - pa
          - ps
          - fa
          - pl
          - ro
          - ru
          - sa
          - sr
          - sn
          - sd
          - si
          - sk
          - sl
          - so
          - su
          - sw
          - sv
          - tl
          - tg
          - ta
          - tt
          - te
          - th
          - bo
          - tr
          - tk
          - uk
          - umb
          - ur
          - uz
          - vi
          - cy
          - wo
          - xh
          - yi
          - yo
          - zu
          description: Language code the questions are written in (e.g. en, de).
        availableLanguages:
          type: array
          items:
            $ref: '#/components/schemas/Config/properties/questionLanguage'
          nullable: true
          description: Translation target codes. null/omitted = English only.
        targetPlatforms:
          type: array
          items:
            type: string
            enum:
            - ios
            - android
            - desktop
      additionalProperties: false
    GetSingleResponseResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        readableId:
          type: integer
          exclusiveMinimum: true
          minimum: 0
        linkId:
          type: string
        urlParams:
          type: object
          additionalProperties:
            type: string
          description: Visible URL parameters.
        tagline:
          type: string
          nullable: true
          description: Generated tagline.
        bulletSummary:
          type: array
          items:
            type: string
          description: Generated summary bullets.
        transcript:
          type: array
          items:
            $ref: '#/components/schemas/SingleResponseTranscriptItem'
      additionalProperties: false
    Item:
      oneOf:
      - $ref: '#/components/schemas/OpenEndedItem'
      - $ref: '#/components/schemas/MultipleChoiceItem'
      - $ref: '#/components/schemas/RankingItem'
      - $ref: '#/components/schemas/MatrixItem'
      - $ref: '#/components/schemas/MaxDiffItem'
      - $ref: '#/components/schemas/StatementItem'
      discriminator:
        propertyName: type
        mapping:
          open_ended: '#/components/schemas/OpenEndedItem'
          multiple_choice: '#/components/schemas/MultipleChoiceItem'
          ranking: '#/components/schemas/RankingItem'
          matrix: '#/components/schemas/MatrixItem'
          max_diff: '#/components/schemas/MaxDiffItem'
          statement: '#/components/schemas/StatementItem'
    Study:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Permanent unique identifier for the study.
        link_id:
          type: string
          description: The link ID of the study. Editable in study settings, so it might change.
        title:
          type: string
          description: The title of the study.
        created_at:
          type: string
          format: date-time
          description: UTC timestamp of when the study was created.
        desc:
          type: string
          description: A description of the study, e.g. "My study (10 Responses)".
    ListResponsesResponse:
      type: array
      items:
        $ref: '#/components/schemas/ListResponse'
    Conditional:
      type: object
      properties:
        operator:
          type: string
          enum:
          - and
          - or
        criteria:
          type: array
          items:
            $ref: '#/components/schemas/Criterion'
          minItems: 1
      required:
      - operator
      - criteria
      additionalProperties: false
    CreateResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        linkId:
          type: string
        status:
          type: string
          enum:
          - draft
      required:
      - id
      - linkId
      - status
      additionalProperties: false
    ConceptMedia:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/Media/properties/name'
        url:
          $ref: '#/components/schemas/Media/properties/url'
        type:
          $ref: '#/components/schemas/Media/properties/type'
        widthPercentage:
          $ref: '#/components/schemas/Media/properties/widthPercentage'
      required:
      - name
      - url
      - type
      additionalProperties: false
    Option:
      type: object
      properties:
        externalId:
          type: string
          minLength: 1
          description: Optional handle so a conditional can reference this option by id. Unique within the payload.
        text:
          type: string
          minLength: 1
        status:
          type: string
          enum:
          - approve
          - reject
          - neutral
    

# --- truncated at 32 KB (54 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/listen-labs/refs/heads/main/openapi/listen-labs-public-api-openapi.yml