---
title: "Create or start workspaces workspaceID runs"
method: POST
path: "/v1/workspaces/{workspaceID}/runs"
---

# Create or start workspaces workspaceID runs

`POST /v1/workspaces/{workspaceID}/runs`

## Request

- Base URL: `https://api.plori.ai`
- URL: `https://api.plori.ai/v1/workspaces/{workspaceID}/runs`
- Auth: HTTP bearer

Candidate Workspace API. Access depends on the owner cohort and, for Files routes, the Files gate. Check operation state and retained data before assuming a write is durable.

## Path parameters

- `workspaceID` string, uuid, required

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `message` string
  - `messages` UserInvokeMessage[]
    - `role` 'user', required
    - `content` string, required
    - `parts` UserInvokePart[]
      - `type` 'image' | 'text' | 'pdf', required
      - `path` string
      - `mime` string
      - `name` string
      - `size` integer
      - `sha256` string
      - `w` integer
      - `h` integer
  - `session_id` string, uuid
  - `idempotency_key` string
  - `executor_agent_id` string, uuid
  - `context` object
  - `max_turn_tokens` integer: Optional cumulative cache-weighted token ceiling for this run. 0 or omitted: no ceiling for a registered account, whose credit balance is its only spend limit, and 2,000,000 for an anonymous trial. Near the ceiling the agent stops using tools and ends with a reply that says the work so far is saved and that a new message continues the task.
  - `max_turn_seconds` integer
  - `max_advisor_spend_micro_usd` integer
  - `callback_url` string
  - `callback_secret` string
  - `github_token` string
  - `github_server_url` string

## Response `202`

See the response body and resource state; asynchronous work requires polling.

- object
  - `run_id` string, uuid, required
  - `workspace_id` string, uuid: The Workspace the run belongs to; omitted for runs outside a Workspace.
  - `session_id` string, uuid, required

## Other responses

- `400`: Malformed request.
- `401`: Missing or invalid credential.
- `404`: No such resource.
- `409`: Conflict, active operation, or current-revision mismatch.

---

[API](https://skmtc.dev/plori/apis/plori-rest-api.md) · [All operations](https://skmtc.dev/plori/apis/plori-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/plori/apis/plori-rest-api/revisions/15c4f9260dff?raw)
