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

# Get Room History

> Returns a Room's read-only conversation log—including user messages, Events, and factory replies. The first page returns the newest entries (ordered oldest-first within the page), and `nextCursor` paginates backward to older entries. To send new input, submit an Event. See [Room History](/rooms#room-history).



## OpenAPI

````yaml /openapi.json get /v1/rooms/{roomId}/history
openapi: 3.1.0
info:
  title: Worklayer Factory API
  version: 1.0.0
  description: >-
    Create custom interfaces to interact with your Worklayer factory—an
    always-on workspace with its own connected apps, skills, memory, files, and
    background Workers (also called an Environment in parts of the web app).
    Send Events into Rooms, read Room History, resolve human Reviews, follow or
    steer Workers, and receive real-time updates via signed Subscriptions.
servers:
  - url: https://api.myworklayer.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Rooms
    description: >-
      Create and manage isolated Rooms and read Room History. Every factory
      includes a main Room (`web`) and supports creating additional Rooms via
      the API. Room History is read-only.
  - name: Events
    description: Send Events into a Room and retrieve stored API Events.
  - name: Workers
    description: Inspect, stream, and steer background Workers spawned by your factory.
  - name: Review
    description: >-
      List and resolve pending approvals, questions, and app connections
      blocking a Worker.
  - name: Subscriptions
    description: >-
      Create, update, rotate, and delete HTTPS webhook endpoints for your
      factory.
  - name: Subscription events
    description: Signed webhook payloads delivered by Worklayer when factory events occur.
paths:
  /v1/rooms/{roomId}/history:
    parameters:
      - $ref: '#/components/parameters/RoomId'
    get:
      tags:
        - Rooms
      summary: Get Room History
      description: >-
        Returns a Room's read-only conversation log—including user messages,
        Events, and factory replies. The first page returns the newest entries
        (ordered oldest-first within the page), and `nextCursor` paginates
        backward to older entries. To send new input, submit an Event. See [Room
        History](/rooms#room-history).
      operationId: getRoomHistory
      parameters:
        - $ref: '#/components/parameters/Limit100'
        - $ref: '#/components/parameters/Cursor4096'
      responses:
        '200':
          description: A page of history entries.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoomHistoryPage'
              example:
                messages:
                  - id: cmhx3r0a10007l808m2c4t9xw
                    kind: event
                    text: Order 1188 for ticket 4821 is shipped with UPS.
                    createdAt: '2026-11-19T17:41:02.118Z'
                    eventId: b7e4c1d2-8a3f-4f6e-9d20-5c1a7e9b3f08
                  - id: toolu_01HbW7q2Lk9sVd3XnR8cPz4m
                    kind: response
                    text: >-
                      Ticket 4821 is shipped. I sent the tracking number to the
                      customer.
                    createdAt: '2026-11-19T17:42:08.311Z'
                nextCursor: cmhx3q9f80005l8086b1n0d4k
        '400':
          description: A query parameter or the cursor is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 400
                message: Invalid cursor for this request.
                error: Bad Request
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/RoomNotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl
            "https://api.myworklayer.com/v1/rooms/cmhx3q7v20004l808sd5k2r1m/history?limit=30"
            \
              -H "Authorization: Bearer $WORKLAYER_API_KEY"
        - lang: javascript
          label: fetch
          source: >-
            const response = await
            fetch('https://api.myworklayer.com/v1/rooms/cmhx3q7v20004l808sd5k2r1m/history?limit=30',
            {
              headers: {
                Authorization: `Bearer ${process.env.WORKLAYER_API_KEY}`,
              },
            });

            const data = await response.json();

            console.log(data);
components:
  parameters:
    RoomId:
      name: roomId
      in: path
      required: true
      description: >-
        Room ID. Pass `web` to target your factory's main Room (the conversation
        in the Worklayer web app).
      schema:
        type: string
        minLength: 1
        maxLength: 191
      example: cmhx3q7v20004l808sd5k2r1m
    Limit100:
      name: limit
      in: query
      description: The maximum number of items on the page.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 30
    Cursor4096:
      name: cursor
      in: query
      description: The `nextCursor` of the previous page.
      schema:
        type: string
        minLength: 1
        maxLength: 4096
        pattern: ^[A-Za-z0-9_-]+$
  schemas:
    RoomHistoryPage:
      type: object
      required:
        - messages
        - nextCursor
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/RoomHistoryEntry'
          description: Oldest first.
        nextCursor:
          type:
            - string
            - 'null'
          description: >-
            Send this value as `cursor` to get older entries. Null when there
            are no older entries.
    Error:
      type: object
      description: The error body. Most errors have this shape.
      required:
        - statusCode
        - message
      properties:
        statusCode:
          type: integer
          description: The HTTP status code.
        message:
          type: string
          description: A short description of the error.
        error:
          type: string
          description: The name of the HTTP status.
    RoomHistoryEntry:
      type: object
      required:
        - id
        - kind
        - text
        - createdAt
      properties:
        id:
          type: string
        kind:
          type: string
          enum:
            - user
            - event
            - response
          description: >-
            `user`: a message from a person. `event`: an Event that the factory
            received. `response`: a response from the factory.
        text:
          type: string
        createdAt:
          type: string
          format: date-time
        eventId:
          type: string
          description: 'Only when `kind` is `event`: the id of the Event.'
  responses:
    Unauthorized:
      description: >-
        The API key is missing, not valid or revoked. The response has the
        header `WWW-Authenticate: Bearer`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            message: Unauthorized
    RoomNotFound:
      description: The Room is not found for this API key, or it is archived.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 404
            message: Room not found.
            error: Not Found
    TooManyRequests:
      description: Too many requests in a short time. Wait, then send the request again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 429
            message: 'ThrottlerException: Too Many Requests'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: wrk-…
      description: >-
        Your factory's Worklayer API key (`wrk-...`). See [Get an API
        key](/quickstart#get-an-api-key) and [Authentication](/authentication).
        Requests sent from the playground execute live against your factory.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.