Skip to main content
A Room is an isolated conversation between your application and a factory. Typically you create one Room per work object—such as an issue, support ticket, customer, or incident—so separate threads of work never bleed into each other.
The response returns the Room’s id. All conversation endpoints are scoped under /v1/rooms/{roomId}/....

Design your interface first, then map to Rooms

Don’t start by designing Room topology in the abstract. Define the interface and work objects your users need first—for example, an issue dashboard where each row has an impact score, a “Fix with Agent” button, PR status, and rollback actions—then let your coding agent map each work object to a Room using externalKey:
  • One Room per work item (issue, ticket, PR, incident) keeps history, Events, and Workers cleanly scoped to that item.
  • One Room per customer or workspace works well when every interaction for that customer should share ongoing thread context.
  • Rooms never message each other directly. Keep Rooms strictly isolated and route each Event to the Room that owns that work item.

Isolation vs. shared factory state

Room isolation vs. shared factory state: Ticket 4821 and Ticket 4822 keep history, Events, notes, and Workers isolated while sharing apps, skills, memory, files, and databases.Room isolation vs. shared factory state: Ticket 4821 and Ticket 4822 keep history, Events, notes, and Workers isolated while sharing apps, skills, memory, files, and databases.
Every Room you create keeps its own:
  • History: the user-visible conversation log. See Room History.
  • Events: everything your app sent to this Room. See Events.
  • Notes: a short working summary the factory maintains for this conversation—such as ticket status and customer details.
  • Workers: the background tasks spawned from this Room. See Workers.
API-created Rooms cannot see or message one another. A Room has no access to another Room’s history, Events, notes, or Workers, so work on Issue #4821 never leaks context from Issue #4822. At the same time, every Room shares the factory’s connected apps, skills, long-term memory, files, and databases. Room notes stay scoped to a single Room; factory memory and files are shared across the factory.
Anything the factory writes to factory-level memory or files can be read from any Room. The factory stores conversation-specific details in Room notes, but don’t rely on Room isolation to protect data saved to shared factory memory or files.

The main Room

Every factory also includes a main Room—the default workspace used in the Worklayer web app, targeted with roomId set to web:
Unlike isolated API Rooms, the main Room (web) provides read-only visibility across the factory: GET /v1/rooms/web/workers lists Workers across all Rooms, and the web workspace can inspect Events and notes from other Rooms (read-only—it cannot modify another Room’s notes or message another Room directly). Use web for factory-wide visibility—such as an activity overview or checking every active Worker—and create dedicated API Rooms with POST /v1/rooms for per-item workflows so unrelated tasks stay cleanly isolated. Slack conversations run in their own isolated Rooms as well, though they are not exposed through /v1/rooms today. See Channels.

Idempotent Room creation with externalKey

POST /v1/rooms accepts two optional fields:
  • name — display name (1 to 191 characters).
  • externalKey — your own unique identifier, such as a help desk ticket ID (1 to 191 visible ASCII characters). If omitted, Worklayer generates one automatically.
If a Room with the same externalKey already exists, the API returns 409 Conflict along with its roomId:
This makes “find or create” straightforward: call POST /v1/rooms with your ticket’s externalKey and use the roomId from either 201 Created or 409 Conflict. Archived Rooms retain their externalKey, so a 409 may reference an archived Room.

Manage Rooms

  • List Rooms: GET /v1/rooms returns the main Room and all active (non-archived) API Rooms, ordered by most recent activity (limit: 1–50, default 20).
  • Rename a Room: PATCH /v1/rooms/{roomId} updates name. Pass {"name": null} to clear it.
  • Archive a Room: DELETE /v1/rooms/{roomId} archives the Room and returns 204 No Content. Archived Rooms no longer appear in GET /v1/rooms, and all routes for that Room return 404.
Renaming and archiving apply only to Rooms you created. Calling either on the main Room (web) returns 403 Forbidden.

Room History

Fetch a Room’s conversation log with GET /v1/rooms/{roomId}/history:
Room History focuses on user-visible conversation. It intentionally omits:
  • Internal factory reasoning and tool calls.
  • Worker-to-factory completion reports (inspect individual Worker transcripts with Get Worker Messages).
  • Message reactions.
A brand-new Room with no activity returns an empty messages array. Room History is read-only—to send new input to the factory, send an Event.

Pagination

In Room History, the first page contains the most recent entries (ordered oldest-first within the page), and nextCursor walks backward to older pages. All paginated endpoints in the Factory API follow the same cursor pattern:
1

Request a page

Pass an optional limit to control page size. Omit it to use the endpoint default.
2

Check nextCursor

When nextCursor is null, you have reached the end of the list.
3

Fetch the next page

Repeat the exact same request with cursor set to the previous response’s nextCursor.
Treat cursors as opaque tokens—never construct or modify them. A cursor is bound to the exact request that produced it (the same Room, and for Workers, the same status or order). Passing a mismatched or invalid cursor returns 400 with Invalid cursor for this request. On Worker list endpoints, a page may return fewer items than limit while still returning a non-null nextCursor. Keep paging until nextCursor is null.

Events

Send activity into a Room and control delivery timing.

Subscriptions

Receive signed webhooks the moment the factory replies.