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

# List events

> Every time one of the author's videos went viral or passed a view milestone, oldest first. To poll, save `next_cursor` and pass it as `after` next time: you get only what happened since.



## OpenAPI

````yaml /api-reference/openapi.json get /events
openapi: 3.1.0
info:
  title: Sonder API
  version: 1.0.0
  description: >-
    Read an author's Sonder videos, views, viral days and view milestones. Every
    request uses an API key the author creates in Sonder, and sees that author's
    data only.
servers:
  - url: https://api.yousonder.com/v1
    description: Production
  - url: https://sonder-server-production.up.railway.app/v1
    description: Production (direct address)
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Who the key belongs to.
  - name: Books
    description: The author's books.
  - name: Videos
    description: Posted videos with views, viral status and milestones.
  - name: Stats
    description: Day-by-day views.
  - name: Events
    description: Viral and milestone moments, for polling.
  - name: Connect
    description: One-click connect (OAuth 2.0).
paths:
  /events:
    get:
      tags:
        - Events
      summary: List events
      description: >-
        Every time one of the author's videos went viral or passed a view
        milestone, oldest first. To poll, save `next_cursor` and pass it as
        `after` next time: you get only what happened since.
      operationId: listEvents
      parameters:
        - name: after
          in: query
          description: >-
            Return events after this one (`next_cursor` from your last call).
            Leave out to start from the beginning.
          schema:
            type: string
          example: evt_1041
        - name: limit
          in: query
          description: Events per page, 1–100.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
      responses:
        '200':
          description: A page of events.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                  - has_more
                  - next_cursor
                properties:
                  success:
                    type: boolean
                    const: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Event'
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Save this; pass it as `after` next time.
              example:
                success: true
                data:
                  - id: evt_1042
                    type: video.milestone_reached
                    occurred_at: '2026-09-15T12:00:00.000Z'
                    recorded_at: '2026-09-15T12:21:40.000Z'
                    video:
                      id: 9f3c2a71-4b6e-4d8a-a1c5-7e2b9d0f3a64
                      title: Your kid isn't lazy. They're exhausted.
                      book:
                        id: 5b1d7c2e-8f0a-4c1b-9d3e-2a6f4b8c9e01
                        title: The Quiet Hours
                    views: 10412
                    milestone: 10000
                    viral: null
                  - id: evt_1043
                    type: video.went_viral
                    occurred_at: '2026-09-15T14:00:00.000Z'
                    recorded_at: '2026-09-15T14:22:03.000Z'
                    video:
                      id: 9f3c2a71-4b6e-4d8a-a1c5-7e2b9d0f3a64
                      title: Your kid isn't lazy. They're exhausted.
                      book:
                        id: 5b1d7c2e-8f0a-4c1b-9d3e-2a6f4b8c9e01
                        title: The Quiet Hours
                    views: 12840
                    milestone: null
                    viral:
                      threshold: 12000
                      author_median_views: 1200
                      compared_videos: 23
                has_more: false
                next_cursor: evt_1043
        '400':
          description: A parameter is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                error:
                  code: invalid_parameter
                  message: after must be an event id this API returned, like evt_1234.
        '401':
          description: The API key is missing, malformed or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                error:
                  code: invalid_api_key
                  message: >-
                    That API key is not valid. Check it was copied in full, or
                    create a new one in Sonder under Settings → API keys.
        '403':
          description: The author's Sonder plan isn't active.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                error:
                  code: plan_inactive
                  message: >-
                    This Sonder account doesn't have an active plan, so its data
                    isn't shared. The key works again as soon as the plan is
                    active.
        '429':
          description: >-
            More than 60 requests in a minute with this key. Wait for the
            seconds in `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                error:
                  code: rate_limited
                  message: >-
                    Too many requests. Each key allows 60 a minute; try again
                    after the time in the Retry-After header.
components:
  schemas:
    Event:
      type: object
      required:
        - id
        - type
        - occurred_at
        - recorded_at
        - video
        - views
        - milestone
        - viral
      properties:
        id:
          type: string
          description: Like evt_1043. Increases over time.
        type:
          type: string
          enum:
            - video.milestone_reached
            - video.went_viral
        occurred_at:
          type: string
          format: date-time
          description: When it happened, to the hour.
        recorded_at:
          type: string
          format: date-time
          description: When Sonder recorded it.
        video:
          type: object
          required:
            - id
            - title
            - book
          properties:
            id:
              type: string
              format: uuid
            title:
              type: string
            book:
              oneOf:
                - $ref: '#/components/schemas/BookRef'
                - type: 'null'
        views:
          type: integer
          description: Total views at that moment.
        milestone:
          type:
            - integer
            - 'null'
          description: The milestone passed (milestone events only).
        viral:
          oneOf:
            - type: object
              required:
                - threshold
                - author_median_views
                - compared_videos
              properties:
                threshold:
                  type:
                    - integer
                    - 'null'
                author_median_views:
                  type:
                    - integer
                    - 'null'
                compared_videos:
                  type:
                    - integer
                    - 'null'
            - type: 'null'
    Error:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable, machine-readable reason.
              enum:
                - missing_api_key
                - invalid_api_key
                - api_key_revoked
                - plan_inactive
                - rate_limited
                - invalid_parameter
                - range_too_long
                - not_found
                - internal_error
            message:
              type: string
              description: What went wrong and what to do, in plain English.
    BookRef:
      type: object
      required:
        - id
        - title
      properties:
        id:
          type: string
          format: uuid
        title:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An API key from Sonder → Settings → API keys, like `sonder_live_…`.

````