Skip to content

Factories > API & SDKs

Factory endpoints

Discover factories and dispatch tasks by UID with factory endpoints, without learning the foreman agent's internals.

Open in ChatGPT ↗
Ask ChatGPT about this page
Open in Claude ↗
Ask Claude about this page
Copied!

The factory endpoints are part of the Warp Platform API. Use them to find a factory and start work from your own code without managing agent details. Call them from a chat bot, script, or service you control.

For ad hoc requests, use a short-lived personal API key so requests respect your visibility and access controls. For an external service that submits work, use an agent API key scoped to the target factory’s foreman. See Creating and managing API keys for key creation and how to identify that foreman.

Send the key in the Authorization: Bearer header. A self-hosted worker key authenticates a worker daemon, not the external service calling these endpoints.

  • GET /factory - list factories your account can access. Add search to filter by name or alias, case-insensitive.
  • GET /factory/{uid} - get one factory by UID.
  • POST /factory/{uid}/runs - dispatch a run to the factory’s foreman agent. Pass a prompt; the server resolves the foreman for you.

These are the core discovery and dispatch endpoints. The interactive Warp Platform API reference documents their parameters and schemas, and also covers the factory’s tasks and factory-file schemas. A dispatched run is an ordinary cloud agent run: retrieve it, send it follow-ups, or cancel it through the same agent and run endpoints used for any run.

Factory endpoints are one of several ways to get work into a factory, and each fits a different source:

  • A bot, service, or script you control - use factory endpoints to find a factory and dispatch to it.
  • A tool that can send a webhook, such as CI, Sentry, or PagerDuty - create a custom webhook and let an automation filter deliveries by payload, with no code to write.
  • A coding agent session, local or in another MCP client - use Factory MCP to send work in or pull a task down to work on locally.
  • A chat platform or issue tracker your team already uses - connect it as an integration so matching events start work automatically.

See Connect your factory for the full comparison across every intake path.

Use factory endpoints to find or start work on a factory. Use Agent & run endpoints for everything else: a standalone cloud agent, run management, or orchestration.

TaskRecommended API
Find a factory by name before dispatching to itfactory endpoints - GET /factory?search=
Start a new task on a factoryfactory endpoints - POST /factory/{uid}/runs
Continue, monitor, or cancel a run (factory or standalone)Agent & run endpoints - GET /agent/runs/{runId}, POST /agent/runs/{runId}/followups, POST /agent/runs/{runId}/cancel
Run a standalone cloud agent with no factory involvedAgent & run endpoints - POST /agent/runs
Build a multi-agent orchestrationAgent & run endpoints - see Multi-agent orchestration

Every factory run is still an ordinary run, so Agent & run endpoints handle status, follow-ups, and cancellation no matter which endpoint family started it.

import os
from warp_platform_sdk import WarpClient
client = WarpClient(api_key=os.environ.get("WARP_API_KEY"))
# Find a factory by name or alias — no UIDs needed up front
page = client.factories.list(search="payments")
factory = page.factories[0]
# Iteration fetches additional pages automatically
for f in client.factories.list(search="payments"):
print(f.uid, f.name)

The REST equivalent:

GET /api/v1/factory?search=payments
Authorization: Bearer YOUR_API_KEY

Get a factory when the UID is already known

Section titled “Get a factory when the UID is already known”
factory = client.factories.get(factory.uid)
GET /api/v1/factory/YOUR_FACTORY_UID
Authorization: Bearer YOUR_API_KEY

Dispatch with just the factory’s UID and a prompt:

run = client.factories.runs.create(
factory.uid,
prompt="Investigate and fix the flaky payment webhook retry test",
title="Fix flaky payment webhook retry test",
ticket_ref="linear:PAY-123",
)
print(run.run_id, run.run_url, run.state)
POST /api/v1/factory/YOUR_FACTORY_UID/runs
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"prompt": "Investigate and fix the flaky payment webhook retry test",
"title": "Fix flaky payment webhook retry test",
"ticket_ref": "linear:PAY-123"
}

Every field except prompt is optional. Omit title and the server derives one from the prompt. ticket_ref identifies the originating ticket in <source>:<id> form (for example linear:PAY-123 or jira:PROJ-456); pass ticket_url to link the factory’s task record back to it, or omit both for an adhoc reference.

An API key for the target factory’s foreman can:

  • Submit new work with POST /factory/{uid}/runs. The caller must have permission to use the factory and act as its foreman; resolving the foreman on the server does not bypass these checks.
  • List that factory’s work items with GET /factory/{uid}/tasks, including work created by other users. The optional created_by filter takes an email address to narrow the list; requests are not implicitly limited to work created by the key’s owner.

These permissions do not grant unrestricted factory configuration or access to other factories. A key for an unrelated agent does not automatically have permission to act as the target foreman.

The run’s creator and the work item’s author reflect the key’s authenticated user or agent. A foreman key records the foreman, not the human who minted the key. This is separate from the GitHub credentials and commit authorship used during execution.

Use POST /factory/{uid}/runs to submit new work. POST /factory/{uid}/tasks instead binds an existing conversation to a work item; it does not start a new foreman run.

status = client.agent.runs.retrieve(run.run_id)

Send a follow-up the same way you would for any run:

POST /api/v1/agent/runs/YOUR_RUN_ID/followups
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"message": "Also add a regression test for the retry backoff"
}

See key endpoints for the full set of run-management operations, including cancellation.