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

# Get survey trends

> Retrieve per-instance question analytics for a survey, suitable for trend charting. Returns chronologically ordered data points for each question across all delivery instances, including average scores, eNPS scores, and answer breakdowns.



## OpenAPI

````yaml /openapi.json get /v1/surveys/{surveyId}/trends
openapi: 3.0.3
info:
  title: Doozy Public API
  version: 1.0.0
  description: >-
    The Doozy Public API allows you to programmatically access your
    organization's data.


    ## Authentication


    All API requests require an API key passed in the `x-api-key` header.


    ```

    x-api-key: dzy_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    ```


    API keys can be generated and managed through the Doozy dashboard. Each key
    is associated with a user account and inherits that user's permissions.


    ## Rate Limiting


    API requests are rate limited. Rate limiting is handled by Cloudflare. If
    you exceed the rate limit, you'll receive a 429 Too Many Requests response.


    ## Pagination


    List endpoints support cursor-based pagination using `limit` and
    `starting_after` query parameters.
  contact:
    name: Doozy Support
    email: support@doozy.live
    url: https://help.doozy.live/api
servers:
  - url: https://api.doozy.live
    description: Production
security:
  - apiKey: []
tags:
  - name: Quizzes
    description: Quiz analytics and reporting endpoints
  - name: Tracks
    description: Track management and analytics endpoints
  - name: Surveys
    description: Survey and poll analytics endpoints
  - name: Introductions
    description: Doozy Roulette and Matchmaking introduction endpoints
paths:
  /v1/surveys/{surveyId}/trends:
    get:
      tags:
        - Surveys
      summary: Get survey trends
      description: >-
        Retrieve per-instance question analytics for a survey, suitable for
        trend charting. Returns chronologically ordered data points for each
        question across all delivery instances, including average scores, eNPS
        scores, and answer breakdowns.
      parameters:
        - schema:
            type: string
            minLength: 1
            description: The unique identifier of the survey
            example: survey_abc123
          required: true
          description: The unique identifier of the survey
          name: surveyId
          in: path
      responses:
        '200':
          description: Survey trends with per-instance question analytics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SurveyTrendsResponse'
        '401':
          description: Authentication required - missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Survey not found or user does not have access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKey: []
components:
  schemas:
    SurveyTrendsResponse:
      type: object
      properties:
        object:
          type: string
          enum:
            - survey_trends
          description: Object type identifier
          example: survey_trends
        id:
          type: string
          description: Survey ID
          example: survey_abc123
        instances:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Instance ID
              scheduled_at:
                type: string
                nullable: true
                description: When this instance was sent
              total_recipients:
                type: integer
                description: Total recipients for this instance
              total_responses:
                type: integer
                description: Total responses for this instance
              response_rate:
                type: number
                description: Response rate (0-100)
            required:
              - id
              - scheduled_at
              - total_recipients
              - total_responses
              - response_rate
          description: Instances in chronological order
        questions:
          type: array
          items:
            $ref: '#/components/schemas/SurveyTrendQuestion'
          description: Per-question trend data across instances
      required:
        - object
        - id
        - instances
        - questions
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - api_error
                - authentication_error
                - invalid_request_error
                - rate_limit_error
              description: The type of error returned
              example: invalid_request_error
            code:
              type: string
              nullable: true
              description: Machine-readable error code for specific error conditions
              example: resource_not_found
            message:
              type: string
              description: Human-readable error message
              example: 'No such quiz: quiz_abc123'
            param:
              type: string
              nullable: true
              description: The parameter related to the error, if applicable
              example: id
            doc_url:
              type: string
              format: uri
              description: URL to documentation about this error
              example: https://docs.doozy.live/api/errors#resource_not_found
          required:
            - type
            - code
            - message
      required:
        - error
    SurveyTrendQuestion:
      type: object
      properties:
        id:
          type: string
          description: Question ID
          example: q_abc123
        text:
          type: string
          description: The question text
          example: How satisfied are you with your onboarding experience?
        type:
          allOf:
            - $ref: '#/components/schemas/SurveyQuestionType'
            - description: Question type
        data_points:
          type: array
          items:
            $ref: '#/components/schemas/SurveyTrendQuestionPoint'
          description: Per-instance data points, in the same order as the instances array
      required:
        - id
        - text
        - type
        - data_points
    SurveyQuestionType:
      type: string
      enum:
        - scale_1_to_10
        - scale_1_to_5
        - emoji_1_to_5
        - agree_disagree
        - enps
        - open_ended
        - multiple_choice
      description: Type of question
      example: scale_1_to_10
    SurveyTrendQuestionPoint:
      type: object
      properties:
        average_score:
          type: number
          nullable: true
          description: Average score for numeric questions (scale, eNPS) in this instance
          example: 7.8
        enps_score:
          type: number
          nullable: true
          description: eNPS score for this instance (eNPS questions only)
          example: 42
        total_responses:
          type: integer
          description: Number of responses for this question in this instance
          example: 30
        answer_breakdown:
          type: array
          items:
            $ref: '#/components/schemas/SurveyAnswerBreakdown'
          description: Breakdown of answers for this instance
      required:
        - average_score
        - enps_score
        - total_responses
        - answer_breakdown
    SurveyAnswerBreakdown:
      type: object
      properties:
        answer:
          type: string
          description: The answer value
          example: '8'
        total_responses:
          type: integer
          description: Number of times this answer was selected
          example: 25
        percentage:
          type: number
          description: Percentage of total responses (0-100)
          example: 35.7
      required:
        - answer
        - total_responses
        - percentage
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Generate keys in the Doozy dashboard.

````