Create a Project in this org, or import a template

POST/o/{org}/p
View .md

Path parameters

orgstringrequired

The org's slug or id. A caller with no role in the org gets 404.

Request body

A name alone makes a Project with no repository. A repository is installation_id, repo_owner and repo_name together (400 VALIDATION_ERROR for some but not all); default_branch and repo_id need one. The caller's GitHub installation must see the repository (403 INSTALLATION_NOT_LINKED or REPO_NOT_IN_INSTALLATION). A gitlab.com repository is repo_host: gitlab with repo_owner (the group path, group/subgroup when nested) and repo_name, and no installation_id or repo_id. The caller's own GitLab sign-in must be able to push to it, asked of GitLab now: no sign-in or one that needs reconnecting is 422 CONNECTION_NOT_READY, two with no connection naming one 422 CONNECTION_AMBIGUOUS, a project it cannot see or push to 404/403 RESOURCE_NOT_ACCESSIBLE, a default_branch that does not exist 404 NOT_FOUND, and GitLab unreachable 502 PROVIDER_ERROR. Each member's run in the Project clones it with that member's own GitLab sign-in, checked again at every start; no member's account is lent to another.

templatestringoptional

A Project template's id (GET /community/projects). The new Project takes the template's goal, instructions and default agent, adds each Community agent it runs (as POST /o/{org}/agents {template} does) and creates its automations switched off; send only name, visibility and a repository with it. 404 NOT_FOUND for no listed template; 422 TEMPLATE_AGENT_UNLISTED when one of its agents is no longer listed; 422 TEMPLATE_NEEDS_CONNECTION with needs (github: send a repository, linear, gmail: connect it; an API key takes neither). Answers 201 {project, agents: [{id, listing_id}], automations} with each webhook trigger's secret once; anything refused after the Project exists deletes it and its automations (the agents it added stay, and a retry reuses them).

Format uuid
namestringrequired
goalstringoptional
at most 280 characters
instructionsstringoptional

Standing instructions every run in the Project reads first.

at most 20000 characters
file_idsarray of stringoptional

Finished uploads of the caller's (POST /o/{org}/files) that become the Project's files, copied into every run started in it. Refused before the Project is made, with the code a run would get (404 ATTACHMENT_NOT_FOUND, 409 ATTACHMENT_IN_USE, 410 ATTACHMENT_EXPIRED, 400 INVALID_BODY).

visibilitystringoptional

Defaults to private.

One ofprivateorg
repo_hoststringoptional

gitlab.com; absent for GitHub.

One ofgitlab
connectionstringoptional

With repo_host: gitlab: which of your GitLab sign-ins (GET /me/connections) checks the repository. Not stored.

installation_idintegeroptional
Format int64
repo_ownerstringoptional
repo_namestringoptional
repo_idintegeroptional
Format int64
default_branchstringoptional
default_harnessstringoptional

Defaults to claude.

One ofclaudecodexopencode
default_harness_versionstringoptional

Responses

201Project created.

Project created. An import also answers agents (yours, each with the listing_id it came from) and automations (each switched off; a webhook trigger's secret once).

projectProjectrequired

The repository is optional Context. A GitHub one has installation_id, repo_owner and repo_name all set; a gitlab.com one has repo_host: gitlab, repo_owner (its group path) and repo_name, with installation_id and repo_id null; with none, all are null.

26 fields
idstringrequired
Format uuid
org_idstringoptional

The org the Project belongs to.

Format uuid
user_idstringoptional

The Project's creator: the one person who sees it while it is private, and the only one who changes its visibility.

Format uuid
visibilitystringoptional

Who sees the Project, its runs, automations, secrets and files: private is its creator alone, org is every member of its org. A run is always readable by whoever started it; a run with no Project is readable by them alone.

One ofprivateorg
namestringrequired
repo_hoststringoptional

Present when the repository is on gitlab.com; absent for a GitHub repository or none.

One ofgitlab
installation_idinteger | nullrequired
Format int64
repo_ownerstring | nullrequired
repo_namestring | nullrequired
repo_idinteger | nulloptional
Format int64
default_branchstring | nulloptional
default_harnessstringrequired

Launch-boundary managed harnesses.

One ofclaudecodexopencode
default_harness_versionstring | nulloptional
readinessstringrequired
One ofpendingreadyerror
sync_statusstringoptional
One ofidlesyncingsyncederror
sync_errorstring | nulloptional
last_synced_atstring | nulloptional
Format date-time
created_atstringoptional
Format date-time
updated_atstringoptional
Format date-time
is_defaultbooleanoptional

The project a prompt-only surface (Slack) resolves to. Per user, not per org.

people_countintegeroptional

How many people it is shared with by name (GET …/people lists them).

goalstringoptional

What the Project is for; empty when unset.

instructionsstringoptional

Standing instructions every run in the Project receives ahead of its prompt; empty when unset.

paused_atstring | nulloptional

When it was paused: no run or follow-up starts (409 PROJECT_PAUSED) and no automation fires. Null when running.

Format date-time
archived_atstring | nulloptional

When it was archived. A client leaves it out of its lists; nothing else changes, its runs and automations carry on. Null when not archived.

Format date-time
last_run_atstring | nulloptional

When a run last started in the Project. Null before its first run.

Format date-time
agentsarray of objectoptional
2 item fields
idstringrequired
listing_idstringrequired
automationsarray of Automationoptional
20 item fields
idstringrequired
Format uuid
project_idstringrequired

The Project it runs in.

Format uuid
namestringrequired
promptstringrequired

The instructions each run receives; a trigger's event follows as untrusted data.

profile_idstring | nulloptional

The saved agent it runs with; null when it runs a default harness or is a wake.

Format uuid
harnessstringoptional

The default harness it runs; absent with a saved agent or a wake.

One ofclaudecodexopencode
modelstringoptional

The model it runs harness with; absent for the harness default.

effortstringoptional

The effort it runs model at; absent for the model default.

profileobject | nulloptional

The saved agent it runs with; null when none, or when the caller cannot see that agent (profile_id still names it).

3 fields
idstringoptional
Format uuid
namestringoptional
harnessstringoptional

Launch-boundary managed harnesses.

One ofclaudecodexopencode
session_idstring | nulloptional

Makes it a wake: each fire sends the prompt to this session as a follow-up instead of starting a run. The session must be in this Project, changeable by created_by, resumable and open. A fire that lands mid-turn is skipped; a session that has closed turns the automation off and notifies its runner.

read_onlybooleanrequired

Its runs can read the repository and comment, but not push.

enabledbooleanrequired
max_runs_per_hourintegerrequired

Runs and wake turns all its triggers together may start per hour. A trigger's run past it is created queued and starts when the hour has room, up to one more hour's worth waiting; an event past that is refused, and so are Run now and a wake at the cap.

min 1max 30
notify_each_runbooleanrequired

How its finished runs reach created_by: each on its own (true), or as one Slack message a day that each run updates (false, the default). Failures always come on their own. Only created_by may change it (403 FORBIDDEN for anyone else, an org admin included).

created_bystringrequired

The member its runs start as: the last one to change what it does.

api_key_idstring | nulloptional

The API key it was set up or last changed with. Its fires are then that key's runs: prepaid credits, the key's connection rules and max_concurrent; once the key is revoked or expires they start nothing (skipped, api_key_revoked). A key changes only automations set up with a key (403 FORBIDDEN otherwise). Null: set up in the console, it runs as created_by.

created_atstringrequired
Format date-time
updated_atstringrequired
Format date-time
triggersarray of AutomationTriggerrequired
10 item fields
idstringrequired
Format uuid
kindstringrequired
One ofgithubschedulewebhooklinearemailsession
eventsarray of string | stringoptional

GitHub event keys (kind github) or Linear event keys (kind linear).

branch_patternsarray of stringoptional

Globs on a pull request's base branch (kind github only).

configTriggerConfigoptional
15 fields
labelsarray of stringoptional

Kind github: any-of label filter. Kind linear: the labels whose addition fires linear.issue.labeled (required with it).

teamsarray of stringoptional

Kind linear: Linear team keys; empty means every public team.

statesobjectoptional

Kind linear: Linear state name -> mode (required with linear.issue.state_changed). plan starts a read-only run that posts its plan as a comment on the issue through the runner's Linear connection; exec starts an ordinary run.

authorsarray of stringoptional

Kind github: GitHub logins.

cronstringoptional

Kind schedule: a 5-field cron expression, at most hourly (every 10 minutes for a wake). Exactly one of cron and every is sent; every is stored as its cron.

everystringoptional

Kind schedule: the plain-language schedule, read in timezone (1d is midnight); stored and returned as cron. 10m and 30m need a wake (the automation's session_id).

One of10m30m1h1d
timezonestringoptional

Kind schedule: an IANA timezone; UTC when omitted.

fromarray of stringoptional

Kind email: senders that may start a run, each an address (dana@acme.com) or a domain (acme.com, @acme.com); empty means anyone. Mail from anyone else, or whose domain did not pass DMARC at Gmail, is skipped.

labelstringoptional

Kind email: a Gmail label name; only new mail carrying it fires (a Gmail filter that adds the label picks the mail). Without it, any new inbox message fires.

history_idstringoptional

Kind email: the Gmail history the trigger has read up to. An email trigger reads its runner's connected Gmail (primary account) about once a minute; each new message (sender, subject, date, the plain-text body up to 64 KB, at most 20 attachments as the run's files) starts one run, deduped on its Gmail id. Mail sent by the runner never fires. Adding one needs a Gmail connection (422 GMAIL_NOT_CONNECTED) and makes the caller its runner.

history_accountstringoptional

Kind email: the Gmail account history_id belongs to. When the runner's account changes, the trigger reads from now.

agentsarray of stringoptional

Kind session (required): the runs it follows, by saved agent id, or a harness name for runs with no saved agent. When such a run in the Project ends, the automation starts with the ended run's status, outcome, pull request, structured result and final message as its event. Its runner must be able to read that run.

endedarray of stringoptional

Kind session: the ways the run ended that fire it; [completed] when omitted.

outcomearray of stringoptional

Kind session: fire only when the run's structured result (its output_schema answer, when valid) has one of these as outcome, such as approved or changes_requested. Absent means any.

max_depthintegeroptional

Kind session: how many session triggers in a row may follow one run something else started; 3 when omitted. Runs on one pull request count together, so a review and fix loop through GitHub events ends too.

min 1max 10
next_fire_atstring | nulloptional

The next schedule slot, or when an email trigger next reads Gmail; null for other kinds.

Format date-time
last_fired_atstring | nulloptional
Format date-time
created_atstringrequired
Format date-time
webhook_urlstringoptional

Kind webhook only: POST here with Authorization: Bearer <secret>; the body (at most 64 KB) becomes the event text and an Idempotency-Key header dedups retries. Answers 202 with a TriggerFireOutcome, and 401 for an unknown trigger or a wrong secret alike.

Format uri
webhook_secretstringoptional

Kind webhook, only in the response that created or rotated it.

recent_runsarray of objectoptional

Its five latest runs, newest first.

6 item fields
idstringrequired
statusstringrequired
trigger_idstring | nullrequired

The trigger that started it; null for Run now.

titlestring | nullrequired

The run's title: the first line of its prompt unless someone named it.

summarystring | nullrequired

What the agent said when the run finished; null until then.

created_atstringrequired
Format date-time
400Malformed request.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
401No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
409A Project with this (case-insensitive) name already exists in the org.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
422A template that cannot be imported now: TEMPLATE_AGENT_UNLISTED (names agent), or TEMPLATE_NEEDS_CONNECTION (lists needs).
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
429The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (RATE_LIMITED).

The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (RATE_LIMITED). The error names the limit. Wait Retry-After seconds.

errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional