Login / Register
POST
/api/public/v1/build-sessions

Start a build session

Hand a brief to the agent — words, attachments, or both; a request with neither is refused with a 400. Returns as soon as the session row exists; the agent starts in the background and its first turn — questions, or a plan to approve — lands in the transcript a few seconds later, so read the session back rather than waiting on this call. A session started from a ticket needs the caller to be the ticket’s assignee or a manager of its project, the ticket to be refined and still open, and the project to be the one Builder works; a session with no ticket behind it is an engineer’s to start. Refused with a 409 when the caller is at their active-session cap or has spent their usage window. The model is pinned for the session’s life.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Dev Tools → API, to an assistant or CLI sign-in when you approve or edit it under Dev Tools, and to a teammate under Employee → Permissions.

builder:write

Request Body

PropertyTypeDescription
descriptionstringThe brief — what to build, up to 250,000 characters. Its first line becomes the session’s title. Optional when `attachments` are sent: the session is titled “Analyzing attachments…” until the agent has looked at them and named it.
ticketIdstringThe ticket this builds. Required for everyone but an engineer; the ticket then shows the session and reopens it rather than starting a second one.
modelstringWhich Claude runs it. Defaults to Sonnet.
ticketAttachmentIdsarrayIds of files already on the ticket to send with the brief, up to ten. Ignored without a `ticketId`.
targetBranchstringBranch mode, an engineer’s: an existing branch for the agent to check out and push to directly, with no pull request. It finishes by marking the branch pushed, which moves the session to DRAFT. Refused with a 400 for `master`, `main`, `staging`, `production`, `release`, a branch GitHub protects or one that does not exist, and with a 409 when another unfinished session is already on it. `claude/` branches are fine. Omit it for an ordinary session that opens a pull request.
attachmentsarrayFiles to send with the brief, up to ten: `{ kind: "IMAGE" | "FILE", url, filename?, mimeType?, sizeBytes? }`. The URL must be reachable by the agent.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/build-sessions" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Expose builder session status over MCP: list, status, messages and the write actions.",
    "ticketId": "tkt_214",
    "model": "claude-sonnet-5-5"
  }'
200Example response
json
{
  "message": "Build session created successfully!",
  "content": {
    "buildSessionId": "bse_a1b2c3"
  }
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Builder
/builder
  1. Open a ticket.
  2. Build this.
  3. Or: Builder → New session.