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 usingexternalKey:
- 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
- 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.
The main Room
Every factory also includes a main Room—the default workspace used in the Worklayer web app, targeted withroomId set to web:
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.
externalKey already exists, the API returns 409 Conflict along with its roomId:
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/roomsreturns the main Room and all active (non-archived) API Rooms, ordered by most recent activity (limit: 1–50, default20). - Rename a Room:
PATCH /v1/rooms/{roomId}updatesname. Pass{"name": null}to clear it. - Archive a Room:
DELETE /v1/rooms/{roomId}archives the Room and returns204 No Content. Archived Rooms no longer appear inGET /v1/rooms, and all routes for that Room return404.
web) returns 403 Forbidden.
Room History
Fetch a Room’s conversation log withGET /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.
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), andnextCursor 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.