HTTP API

119 operations under /v1, 71 of them also available as MCP tools. Explore request fields, response types and authentication requirements below.

Calling the API

JSON in, JSON out, one bearer credential. Unknown fields are rejected rather than ignored — a typo in a body is a 400, not a silent default.

curl https://api.trunk.dev/v1/me \
  -H "Authorization: Bearer $AGENT_KEY"

Subscribe to live updates with GET /v1/stream, which returns server-sent events. Use ?since=<event-id> to replay from a specific event.

Open the authenticated API console

Review assessments

Independent, revision-bound Green, Yellow and Red assessments with summaries and verified source findings. Required/Optional policy and aggregate verification remain owned by Checks.

GET/v1/changes/:changeId/reviews
human only

Read attributable Candidate review assessments and source findings

Green and Yellow pass a valid reviewer Check; Red fails it. Optional failures remain non-blocking. Historical assessments do not satisfy newer revisions. Internal model assignments, execution configuration and confidential prompts are excluded. This read never starts or retries a review.

Path
changeIdrequiredstring
The changeId to act on.
returns ChangeReviewsreviews.list

Reviewer configuration

Manage scoped reviewer definitions, activation and policy. Models remain managed internally by Trunk.

POST/v1/workspace/reviewer-settings
human only

Create a customer reviewer with Name, Prompt and scoped review policy

Body
namerequiredstring
1–120 characters
promptrequiredstring
1–20000 characters
enabledrequiredboolean
requiredrequiredboolean
draftReviewEnabledrequiredboolean
expectedVersioninteger
1 or more
expectedRequirementVersioninteger
0 or more
returns ReviewerSettingsreviewerSettings.workspace.create
PUT/v1/workspace/reviewer-settings/:reviewerId
human only

Edit a customer reviewer and policy with exact version preconditions

Path
reviewerIdrequiredstring
The reviewerId to act on.
Body
namerequiredstring
1–120 characters
promptrequiredstring
1–20000 characters
enabledrequiredboolean
requiredrequiredboolean
draftReviewEnabledrequiredboolean
expectedVersionrequiredinteger
1 or more
expectedRequirementVersionrequiredinteger
0 or more
returns ReviewerSettingsreviewerSettings.workspace.edit
POST/v1/repositories/:repositoryId/reviewer-settings
human only

Create a customer reviewer with Name, Prompt and scoped review policy

Path
repositoryIdrequiredstring
The repositoryId to act on.
Body
namerequiredstring
1–120 characters
promptrequiredstring
1–20000 characters
enabledrequiredboolean
requiredrequiredboolean
draftReviewEnabledrequiredboolean
expectedVersioninteger
1 or more
expectedRequirementVersioninteger
0 or more
returns ReviewerSettingsreviewerSettings.repository.create
PUT/v1/repositories/:repositoryId/reviewer-settings/:reviewerId
human only

Edit a customer reviewer and policy with exact version preconditions

Path
repositoryIdrequiredstring
The repositoryId to act on.
reviewerIdrequiredstring
The reviewerId to act on.
Body
namerequiredstring
1–120 characters
promptrequiredstring
1–20000 characters
enabledrequiredboolean
requiredrequiredboolean
draftReviewEnabledrequiredboolean
expectedVersionrequiredinteger
1 or more
expectedRequirementVersionrequiredinteger
0 or more
returns ReviewerSettingsreviewerSettings.repository.edit
DELETE/v1/repositories/:repositoryId/reviewer-settings/:reviewerId
human only

Delete a customer reviewer, retaining historical identity and results

Path
repositoryIdrequiredstring
The repositoryId to act on.
reviewerIdrequiredstring
The reviewerId to act on.
Body
expectedVersionrequiredinteger
1 or more
returns ReviewerSettingsreviewerSettings.repository.delete
PUT/v1/repositories/:repositoryId/reviewer-settings/global/:reviewerId
human only

Select a Trunk global reviewer and configure repository review policy

Path
repositoryIdrequiredstring
The repositoryId to act on.
reviewerIdrequiredstring
The reviewerId to act on.
Body
enabledrequiredboolean
requiredrequiredboolean
draftReviewEnabledrequiredboolean
expectedRequirementVersionrequiredinteger
0 or more
returns ReviewerSettingsreviewerSettings.repository.global

Identity

Who the credential belongs to, which services and paths it may touch, what it has left to spend today, and how its changes have fared. An agent should read this before it proposes anything.

GET/v1/me
whoami

Who am I, what may I touch, and what is my record

Call this first. Returns your scopes (which services and paths you may change), your remaining budget for today, and your measured track record per service — the same numbers policy uses to decide whether your next change lands unattended.

returns ActorProfileme.get

Changes

The whole lifecycle: propose, verify, decide, land, revert. A change is the only thing that reaches trunk — there is no branch to push and no pull request to open.

POST/v1/changes
propose_change

Propose a change — the only way code reaches trunk

Submits a complete change object: your stated intent, the spec you worked to, the diff, the results you observed, and your session trace. Creates new work with automatically managed backing refs. The branch field is not accepted. Use revise_change with change_id and expected_revision to update existing work. Trunk verifies the diff itself, scores risk against your track record in this service, and applies repository policy. Ordinary auto_land Changes land when all normal gates are satisfied; Draft-controlled revisions run the same gates but cannot create new landing authority until explicitly marked Ready. Otherwise the response tells you exactly which rule routed it to a human and what evidence triggered it. Configured required external checks are created and dispatched automatically for the exact immutable candidate revision; callers do not need to start Trunk-managed CI manually. If policy says auto_land and every required external check is green for the current revision, a Ready Change may land. Native API/MCP revisions apply explicit draft values and preserve readiness when omitted; automatic Trunk revisions preserve readiness, while a new accepted Human Git Push resets Draft. Every revision requires fresh evidence. Human-routed changes still require a decision, and neither approval nor Ready bypasses required gates.

Body
repository_idrequiredstring
Repository id or name.
titlerequiredstring
Imperative one-liner, as it will read on trunk.
at most 120 characters
intentrequiredstring
Why this change exists, in your own words: the problem, the evidence it is real, and what you decided not to do. This is what a human reads first.
at least 20 characters
diffrequiredstring
Unified diff (git format). Trunk derives its own evidence from this — it does not take your word for what changed.
at least 10 characters
linear_issuestring
Linear issue identifier or URL. Its description is shared with repository readers and used by Reviews. On revision omit to keep the snapshot, resend to refresh, or send an empty string to unlink.
at most 1024 characters
servicestring
Owning service. Inferred from the changed paths when omitted.
specobject
goalstring
non_goalsstring[]
acceptance_criteriastring[]
constraintsstring[]
base_commitstring
Trunk commit you worked from. Defaults to current head.
reportedobject
Results you observed. Recorded as self-reported and weighted as such.
suitesobject[]
namerequiredstring
passedrequiredinteger
failedrequiredinteger
skippedinteger
duration_msinteger
coverage_deltanumber
benchmarksobject[]
namerequiredstring
before_msrequirednumber
after_msrequirednumber
traceobject[]
Client-submitted session trace: prompts, tool calls, skills and reasoning summaries. Only submit content you can share with repository readers; omit secrets. Trunk does not automatically capture client sessions.
kindrequiredstring
What the agent was doing at this step.
one of read · search · reason · edit · test · bench · tool · note · prompt · skill
summaryrequiredstring
One line, written for a human skimming the trace.
at most 300 characters
detailstring
Optional longer output: command, result, reasoning.
promptobject
rolerequiredstring
one of system · developer · user · assistant
contentrequiredstring
Prompt text explicitly supplied by the client.
tool_callobject
namerequiredstring
call_idstring
Client tool-call identifier for correlation.
argumentsstring
Tool input as text or serialized JSON.
resultstring
Tool output as text or serialized JSON.
statusstring
one of started · succeeded · failed
skillobject
namerequiredstring
sourcestring
Skill path or URI.
contentstring
reasoningstring
Agent-supplied reasoning summary or decision rationale, not private chain-of-thought.
tsstring
ISO timestamp. Defaults to now.
tokensinteger
Tokens consumed by this step.
usdnumber
Cost of this step in USD.
cost_usdnumber
What this change cost to produce. Recorded for usage reporting.
draftboolean
For native repositories, explicit true sets Draft; explicit false sets Ready, on both creation and revision. Omitted on a new Change starts Ready; omitted on a revision preserves the previous Draft/Ready state. Verification/CI/Preview and all landing gates remain independent.
returns Changechanges.propose
POST/v1/changes/:change_id/revisions
revise_change

Revise an existing Change by id and expected revision

Replace the complete proposal content of your exact current open Change. This is a full replacement, not a partial update: omitting spec or reported clears them. Resend the complete spec, including any existing acceptance criteria you want to keep, and any reported results you want to retain. Requires expected_revision; stale or terminal Changes fail without creating new work. Keeps the Change id and backing refs, invalidates prior approvals and re-runs normal verification, policy and required checks. For native repositories, explicit draft:true sets Draft; draft:false sets Ready; omitted draft preserves the previous state. Linked GitHub source revisions preserve readiness; synchronized readiness commands are separate. Omitted base_commit retains the existing base; supply a new exact base explicitly when rebasing. Configured required external checks are created and dispatched automatically for the exact immutable candidate revision; callers do not need to start Trunk-managed CI manually. If policy says auto_land and every required external check is green for the current revision, a Ready Change may land. Native API/MCP revisions apply explicit draft values and preserve readiness when omitted; automatic Trunk revisions preserve readiness, while a new accepted Human Git Push resets Draft. Every revision requires fresh evidence. Human-routed changes still require a decision, and neither approval nor Ready bypasses required gates.

Path
change_idrequiredstring
The change id to act on.
Body
titlerequiredstring
Imperative one-liner, as it will read on trunk.
at most 120 characters
intentrequiredstring
Why this change exists, in your own words: the problem, the evidence it is real, and what you decided not to do. This is what a human reads first.
at least 20 characters
diffrequiredstring
Unified diff (git format). Trunk derives its own evidence from this — it does not take your word for what changed.
at least 10 characters
expected_revisionrequiredinteger
Current numerical Change revision observed by the caller. A stale value returns conflict without writing.
1–9007199254740991
linear_issuestring
Linear issue identifier or URL. Its description is shared with repository readers and used by Reviews. On revision omit to keep the snapshot, resend to refresh, or send an empty string to unlink.
at most 1024 characters
servicestring
Owning service. Inferred from the changed paths when omitted.
specobject
goalstring
non_goalsstring[]
acceptance_criteriastring[]
constraintsstring[]
base_commitstring
Exact replacement base commit. Omit to retain the current Change base.
reportedobject
Results you observed. Recorded as self-reported and weighted as such.
suitesobject[]
namerequiredstring
passedrequiredinteger
failedrequiredinteger
skippedinteger
duration_msinteger
coverage_deltanumber
benchmarksobject[]
namerequiredstring
before_msrequirednumber
after_msrequirednumber
traceobject[]
Client-submitted session trace: prompts, tool calls, skills and reasoning summaries. Only submit content you can share with repository readers; omit secrets. Trunk does not automatically capture client sessions.
kindrequiredstring
What the agent was doing at this step.
one of read · search · reason · edit · test · bench · tool · note · prompt · skill
summaryrequiredstring
One line, written for a human skimming the trace.
at most 300 characters
detailstring
Optional longer output: command, result, reasoning.
promptobject
rolerequiredstring
one of system · developer · user · assistant
contentrequiredstring
Prompt text explicitly supplied by the client.
tool_callobject
namerequiredstring
call_idstring
Client tool-call identifier for correlation.
argumentsstring
Tool input as text or serialized JSON.
resultstring
Tool output as text or serialized JSON.
statusstring
one of started · succeeded · failed
skillobject
namerequiredstring
sourcestring
Skill path or URI.
contentstring
reasoningstring
Agent-supplied reasoning summary or decision rationale, not private chain-of-thought.
tsstring
ISO timestamp. Defaults to now.
tokensinteger
Tokens consumed by this step.
usdnumber
Cost of this step in USD.
cost_usdnumber
What this change cost to produce. Recorded for usage reporting.
draftboolean
For native repositories, explicit true sets Draft; explicit false sets Ready, on both creation and revision. Omitted on a new Change starts Ready; omitted on a revision preserves the previous Draft/Ready state. Verification/CI/Preview and all landing gates remain independent.
returns Changechanges.revise
GET/v1/changes
list_changes

List changes

Filter by repository, branch, author, service, route or status. For landing history, use status=landed,reverted and order_by=landed_at. For the decision queue, use status=awaiting_decision,blocked, order_by=risk and limit=100. Date ordering is newest first; get_repository provides the current trunk head.

Query
repository_idstring
servicestring
branchstring
Only changes on this branch.
authorstring
Actor handle or id.
statusstring
Comma-separated: verifying, merge_conflicts, awaiting_decision, approved, landed, reverted, blocked, rejected, no_change. No_change means completed without changes, not landed or rejected. Merge conflicts are an effective status, independent of lifecycle status.
routestring
one of auto_land · human_review · block
order_bystring
Dates sort newest first; unlanded changes sort last for landed_at. Risk ranks the newest matching limit changes by descending score, with recency breaking ties.
one of created_at · landed_at · risk
defaults to "created_at"
limitinteger
1–200
defaults to 25
returns ChangeListchanges.list
GET/v1/changes/:change_id
get_change

Get one change, with whichever parts you need

Path
change_idrequiredstring
The change id to act on.
Query
includestring
Comma-separated: diff, evidence, trace, decisions, track.
defaults to "evidence,trace,decisions,track"
returns Changechanges.get
POST/v1/changes/:change_id/verify
verify_change

Re-run verification and re-route

Rebuilds the evidence bundle from scratch, re-scores risk against the current track record, and re-applies policy. Any approval bound to an older evidence digest is invalidated. After verification materializes the current immutable candidate, configured required external checks are dispatched automatically. Re-running verification safely reuses/reconciles the same durable first-attempt CI identity.

Path
change_idrequiredstring
The change id to act on.
returns VerifyResultchanges.verify
POST/v1/changes/:change_id/decisions
human only

Record a human decision or terminate a pre-evidence Change

Human-only. request_key is the caller-stable idempotency boundary: retry the exact same request with the same key after any lost or ambiguous response; reusing a key with different input fails closed. With verification evidence present, a decision is bound to that evidence. Before verification evidence exists, only reject is accepted and no Decision row is recorded. The response distinguishes the durable Decision outcome from the follow-on landing outcome; approval does not bypass required external checks.

Path
change_idrequiredstring
The change id to act on.
Body
request_keyrequiredstring
Caller-stable idempotency token for this logical decision request. Retry with the same key after any lost or ambiguous response.
1–128 characters
verdictrequiredstring
one of approve · reject · request_changes
evidence_digeststring
The digest you read for an evidence-bound decision. With evidence present, omitting it accepts whatever evidence is current; before evidence exists, only reject is allowed and no Decision row is recorded.
at least 1 characters
notestring
What convinced you, or what is missing.
returns ChangeDecisionResultchanges.decide
POST/v1/changes/:change_id/land
human only

Land an approved or auto-landable change on trunk

Human-only. Agents propose changes and mark their own Draft revisions Ready; Trunk lands them through the normal policy and approval lifecycle.

Path
change_idrequiredstring
The change id to act on.
Body
reasonstring
forceboolean
Admin override. Recorded on the change.
returns Changechanges.land
POST/v1/changes/:change_id/ready
mark_change_ready

Mark the exact current Draft revision ready for the normal landing lifecycle

Only the Change author may open landing readiness for the exact numerical Change revision supplied by the caller. It creates no evidence and bypasses no policy, approval, check, Preview, freshness, source or publication fence. A stale revision is rejected. Automatic Trunk revisions preserve readiness; an actual new Human Git Push resets Draft. Native API/MCP revisions apply explicit draft values and preserve readiness when omitted. Linked GitHub source revisions preserve readiness; synchronized readiness commands are separate. Each revision still needs its own evidence and approvals.

Path
change_idrequiredstring
The change id to act on.
Body
revisionrequiredinteger
Exact current numerical Change revision being released from Draft.
1 or more
returns Changechanges.mark_ready
POST/v1/changes/:change_id/github/recover
recover_github_contribution

Request synchronization recovery for an exact linked GitHub contribution revision

Resets bounded synchronization retries for an existing linked contribution. Requires the original author and current repository, service and path proposal authority; a verified GitHub contributor may act only through the existing provenance-bound human connection. The integration must be explicitly enabled. Recovery is scheduled, not completed by this response. It does not revise or reopen the Change, change Draft/Ready, create verification evidence or authorize a merge. Completed no-change contributions may repair synchronization while remaining terminal. Stale revisions and merged or published contributions are rejected.

Path
change_idrequiredstring
The change id to act on.
Body
revisionrequiredinteger
Exact current numerical Change revision whose synchronization is retried.
1 or more
returns Changechanges.recover_github
POST/v1/changes/:change_id/revert
revert_change

Revert a landed change

Reverts on trunk and attributes the outcome to the change's author. This is what moves an agent's track record, which is what changes how its next change routes.

Path
change_idrequiredstring
The change id to act on.
Body
reasonrequiredstring
What went wrong. Shown on the author's record.
at least 5 characters
detected_bystring
Alert, on-call, customer report, canary…
returns RevertResultchanges.revert
POST/v1/changes/:change_id/trace
append_change_trace

Append steps to a change session trace

Path
change_idrequiredstring
The change id to act on.
Body
stepsrequiredobject[]
kindrequiredstring
What the agent was doing at this step.
one of read · search · reason · edit · test · bench · tool · note · prompt · skill
summaryrequiredstring
One line, written for a human skimming the trace.
at most 300 characters
detailstring
Optional longer output: command, result, reasoning.
promptobject
rolerequiredstring
one of system · developer · user · assistant
contentrequiredstring
Prompt text explicitly supplied by the client.
tool_callobject
namerequiredstring
call_idstring
Client tool-call identifier for correlation.
argumentsstring
Tool input as text or serialized JSON.
resultstring
Tool output as text or serialized JSON.
statusstring
one of started · succeeded · failed
skillobject
namerequiredstring
sourcestring
Skill path or URI.
contentstring
reasoningstring
Agent-supplied reasoning summary or decision rationale, not private chain-of-thought.
tsstring
ISO timestamp. Defaults to now.
tokensinteger
Tokens consumed by this step.
usdnumber
Cost of this step in USD.
returns Tracechanges.trace

The decision queue

What policy could not resolve on evidence alone. If this is empty, everything that landed today landed unattended.

Repositories

A repository owns services, the routing policy and the trunk log. Services are matched from changed paths, which is how a change finds its owner.

POST/v1/repositories/:repository_id/agent-git-credentials
issue_agent_git_credential

Issue a five-minute agent Git read credential

Use the returned credential only with a temporary protected Git helper on the exact native Trunk HTTPS remote. Supports clone/fetch and the remote-read part of pull, including published candidate refs. Repository-wide read requires current read permission and the original API key or MCP OAuth delegation. Renew through this same authenticated operation; retry an expired Git read at most once. No push, Human Work prefix, Ready or landing authority. Never put the password in URLs, arguments, logs or shared Git configuration. GitHub-backed repositories are not supported.

Path
repository_idrequiredstring
The repository id to act on.
returns AgentGitCredentialrepositories.agentGitCredential
POST/v1/repositories/:repository_id/git-credentials
human only

Issue a short-lived human Git HTTPS credential

Issues a short-lived credential for the repository’s Trunk-owned HTTPS Git remote. Read credentials permit clone/fetch. Write credentials additionally return the authenticated actor’s allowed Human Work ref prefix; Trunk landing remains the only normal canonical publication path.

Path
repository_idrequiredstring
The repository id to act on.
Body
accessrequiredstring
Requested Git authority.
one of read · write
returns GitCredentialrepositories.gitCredential
POST/v1/repositories/:repository_id/import
import_repository

Start or resume an initial repository import

Requires repository-admin authority. Reserves one durable import operation using bounded commit/source/digest/size metadata, or reconciles the same operation after an interrupted raw-pack upload. Bulk Git-pack bytes are uploaded separately to the returned Trunk-owned binary transfer URL and never travel through JSON or MCP.

Path
repository_idrequiredstring
The repository id to act on.
Body
commitrequiredstring
Pinned Git SHA-1 commit to import.
matches ^[a-f0-9]{40}$
sourcerequiredstring
Audit label for the source, without credentials. Never fetched by the server.
1–500 characters
pack_digestrequiredstring
Lowercase SHA-256 digest of the exact raw Git pack.
matches ^[a-f0-9]{64}$
pack_bytesrequiredinteger
Exact raw Git pack byte count.
32 or more
returns RepositoryImportrepositories.import
GET/v1/repositories/:repository_id/import
get_repository_import

Inspect the durable repository import operation

Requires repository-admin authority. Returns bounded metadata and the durable import state. This operation never carries Git-pack bytes or performs provider mutation.

Path
repository_idrequiredstring
The repository id to act on.
returns RepositoryImportrepositories.import.get
GET/v1/repositories
list_repositories

List repositories

returns RepositoryListrepositories.list
POST/v1/repositories
human only

Create a repository

Creates a repository, its services, and version 1 of its routing policy. Services are how Trunk assigns paths and criticality to a change, and they are what track records are measured against — a repository with no services still works, but every change lands as "unassigned" at medium criticality. Human-only: registering repositories is not an agent operation. The creating human becomes repository administrator and check administrator in the durable preparation transaction before provider provisioning begins. CI is disabled by default. Human repository check admins configure required checks through GET/PUT /v1/repositories/:repositoryId/check-requirements; Trunk-managed workflows use provider trunk-ci with the exact WorkflowPlanV2 candidate workflow name. PUT replaces the complete required-check list, so callers must preserve unrelated providers.

Body
namerequiredstring
A single lowercase slug. Repositories are not namespaced.
at most 40 characters
trunk_branchstring
The branch changes land on. Defaults to "trunk".
at most 60 characters
servicesobject[]
Path globs decide which service a change belongs to.
namerequiredstring
at most 40 characters
criticalitystring
one of low · medium · high · critical
path_globsstring[]
e.g. services/payments/**
rulesobject[]
Routing policy. Defaults to the built-in rules.
returns RepositoryDetailrepositories.create

Policy

The rules that decide what lands unattended. Policy is versioned, and a candidate can be replayed over historical changes before it is adopted.

GET/v1/repositories/:repository_id/policy
get_policy

Read the active routing policy

Path
repository_idrequiredstring
The repository id to act on.
returns PolicyDocumentpolicy.get
PUT/v1/repositories/:repository_id/policy
human only

Save routing policy against the version read for editing

Current human repository administrators only. expectedVersion is mandatory. Stale versions return 409 without a write, even for identical rules. Current identical ordered rules return unchanged without new history. A lost response does not prove rollback: read current policy before deliberately deciding on another save; never blindly retry.

Path
repository_idrequiredstring
The repository id to act on.
Body
expectedVersionrequiredinteger
Policy version actually read by the editor.
0 or more
rulesrequiredobject[]
idstring
whenobject
thenstring
one of auto_land · human_review · block
reasonstring
returns PolicySaveResultpolicy.set
POST/v1/repositories/:repository_id/policy/simulate
simulate_policy

Replay a candidate policy over historical changes

Answers the only question that matters before changing policy: how many of the last N changes would this have auto-landed, and which ones would it have stopped?

Path
repository_idrequiredstring
The repository id to act on.
Body
rulesrequiredobject[]
limitinteger
200 or less
defaults to 50
returns PolicySimulationpolicy.simulate

Source

The code itself, read from whichever Git provider holds it. Trunk lands on one branch and creates no others, so the branch list is the provider’s, not Trunk’s — and a read is only served for a branch that is actually there.

GET/v1/repositories/:repository_id/candidate-retention
audit_candidate_retention

Audit the live public and ephemeral tips of a candidate checkout

Reads live tips and retention evidence for an original candidate checkout, an enrolled integration, or a completed orphan checkout retirement. A matching ephemeral tip is a point-in-time observation. This operation grants no deletion authority.

Path
repository_idrequiredstring
The repository id to act on.
Query
change_idrequiredstring
at most 80 characters · matches ^chg_[a-z0-9]+$
revisionrequiredinteger
1 or more
returns CandidateRetentionAuditsource.candidateRetention
POST/v1/repositories/:repository_id/files/read
read_files

Read several files from one exact branch snapshot

Reads up to 12 repository files in one call. The named branch is resolved once and every file is read at that immutable head commit. Missing paths are reported separately. Aggregate returned text is capped at 2097152 bytes.

Path
repository_idrequiredstring
The repository id to act on.
Body
pathsrequiredstring[]
Repository-relative file paths. At most 12.
refstring
Branch name. Defaults to the trunk branch.
returns SourceFilesContentsource.files
POST/v1/repositories/:repository_id/patch/preflight
preflight_patch

Preflight a Git patch against the exact recorded Trunk head

Read-only exact applicability check for an existing unified Git diff. Trunk captures its current recorded commit SHA once and verifies supported operations at that immutable commit. The returned base_commit can be used for propose_change. Preflight neither reserves the head nor grants proposal or landing authority. Diff input is capped at 3145728 bytes and source processing uses independent finite patch limits (1000 files, 16 MiB source, 256 metadata queries, 30 seconds). Text renames/copies, including edits, use exact-base content and mode reconstruction. A binary rename with 100% similarity reuses the exact source blob. Renames report both endpoints. Native repositories also accept binary additions and deletions with forward and inverse Git literal blocks and full blob IDs. Use git diff --binary --find-renames to generate the patch. Collisions, path chains, binary edits and copies, symlinks and submodules are unsupported. Newline and regular-file mode changes are preserved within supported rename/copy patches. Standalone mode-only and no-trailing-newline forms remain unsupported.

Path
repository_idrequiredstring
The repository id to act on.
Body
diffrequiredstring
at least 1 characters
returns PatchPreflightResultsource.patch_preflight
GET/v1/repositories/:repository_id/branches
list_branches

The branches this repository holds

Trunk lands on one branch and creates no others, so this is whatever the underlying Git provider actually has. The trunk branch is flagged and listed first. Reads are only served for a branch that appears here.

Path
repository_idrequiredstring
The repository id to act on.
returns SourceBranchessource.branches
GET/v1/repositories/:repository_id/tree
list_directory

One directory of the source at one branch

Directories first, then files, each alphabetically. Omit `path` for the repository root, and `ref` for the trunk branch. A `ref` naming no branch is a 404 rather than a silent fall back to trunk.

Path
repository_idrequiredstring
The repository id to act on.
Query
refstring
Branch name. Defaults to the trunk branch.
pathstring
Directory to list. Defaults to the repository root.
at most 1024 characters
returns SourceTreesource.tree
GET/v1/repositories/:repository_id/file
read_file

One file of the source at one branch

Text arrives as `text`; a blob that is not decodable text comes back with `text: null` and `binary: true`. Large files are truncated to whole lines with `truncated: true`, and `bytes` is always the size of the whole blob.

Path
repository_idrequiredstring
The repository id to act on.
Query
pathrequiredstring
File to read, from the repository root.
at most 1024 characters
refstring
Branch name. Defaults to the trunk branch.
returns SourceFileContentsource.file

The trunk log

What landed, in order, with the change and the evidence behind each commit.

GET/v1/repositories/:repository_id/trunk
human only

The trunk log: what landed, in order

Path
repository_idrequiredstring
The repository id to act on.
Query
limitinteger
500 or less
defaults to 50
returns TrunkLogtrunk.log

Agents

The fleet, its scopes and its measured record. Registering an agent and granting it scope are human acts and stay human-only.

POST/v1/agents
human only

Register an agent identity

Human-only. The agent uses the workspace’s default repository access while the registrant is a member. Returns the API key once.

Body
handlerequiredstring
matches ^[a-z][a-z0-9-]{1,30}$
displayrequiredstring
returns NewAgentagents.create
DELETE/v1/agents/:agent_id
human only

Delete an agent that never did anything

Human-only. Removes the identity along with its scopes, budget and API keys. Refused with a 409 once the agent has a record — a proposed change, a revert, an attested check run. That history is signed by this actor and policy reads it, so it outlives any wish to tidy the fleet up; revoke the agent's keys instead, which stops it working and leaves what it did readable.

Path
agent_idrequiredstring
The agent id to act on.
returns DeletedAgentagents.delete
POST/v1/agents/:agent_id/scopes
human only

Grant an agent a scope

Requires repository administrator access.

Path
agent_idrequiredstring
The agent id to act on.
Body
repository_idrequiredstring
servicestring
defaults to "*"
path_globsstring[]
Glob patterns the agent may modify, e.g. services/payments/**
opsstring[]
returns Scopeagents.grant
PUT/v1/agents/:agent_id/budget
human only

Set an agent budget

Path
agent_idrequiredstring
The agent id to act on.
Body
changes_per_dayinteger
0 or more
max_diff_linesinteger
1 or more
max_filesinteger
1 or more
returns Budgetagents.budget

API keys

An agent key is shown once at issue and stored only as a digest. Human-only: an agent cannot widen its own credentials.

GET/v1/agents/:agent_id/keys
human only

List an agent's active API keys

Names and previews only. A key itself is readable exactly once, when it is issued.

Path
agent_idrequiredstring
The agent id to act on.
returns ApiKeyListkeys.list
POST/v1/agents/:agent_id/keys
human only

Issue a new API key

Returns the key once. Only its digest is stored, so it cannot be recovered afterwards — reissue instead. An agent may hold several keys at once, which is how you rotate without downtime: issue the new one, move the agent across, then revoke the old one.

Path
agent_idrequiredstring
The agent id to act on.
Body
namestring
What this key is for, e.g. "ci" or "laptop".
at most 60 characters
returns IssuedApiKeykeys.create
DELETE/v1/agents/:agent_id/keys/:key_id
human only

Revoke an API key

The key stops authenticating immediately. The record of it is kept, so a key that was used and then taken away stays visible.

Path
agent_idrequiredstring
The agent id to act on.
key_idrequiredstring
The key id to act on.
returns RevokedApiKeykeys.revoke

Events

The platform event stream — every proposal, routing decision, landing and revert.

GET/v1/events
list_events

Recent platform events

Query
limitinteger
500 or less
defaults to 50
sinceinteger
defaults to 0
change_idstring
returns EventListevents.list

Statistics

Throughput and autonomy for a repository: what was proposed, what landed, and how much of it needed a person.

Accounts and sessions

Human sign-up, sign-in and sign-out. Not MCP tools: registering people is not an agent operation.

POST/v1/auth/signup
no credentialhuman only

Create an account

Redeems an email-bound beta or workspace invitation, creates a human identity, and opens a session. Redeeming a workspace invitation also joins that workspace. Signup is for humans.

Body
invitation_tokenrequiredstring
One-time beta or workspace invitation secret for this email.
at most 43 characters
emailrequiredstring
at most 254 characters
passwordrequiredstring
At least 10 characters.
10–512 characters
namerequiredstring
Display name, shown on decisions you record.
at most 120 characters
handlestring
Optional; derived from your name otherwise.
matches ^[a-z][a-z0-9-]{1,30}$
returns Sessionauth.signup
POST/v1/auth/signout
human only

End the current session

Body
everywhereboolean
End every session for this account.
returns SignedOutauth.signout

externalCi

POST/v1/changes/:changeId/ci-dispatches
human only

Dispatch or retry an exact required Trunk-managed check

Manual/admin handoff for a configured Trunk-managed required check after Trunk has materialized and verified an immutable candidate. Normal first-attempt CI is orchestrated automatically; first dispatch remains human-attester-only; an explicitly authorized agent attester may retry its own exact current revision. The requested provider/check is revalidated as a required repository check under the same repository lock that creates the queued CheckRun and durable dispatch intent. The stable managed-CI provider identity is trunk-ci; the backing execution provider is intentionally not part of this public contract. The caller supplies the exact candidate SHA it observed; Trunk binds the request to the current numbered Change revision and uses the same rolling-safe first-attempt identity selection as automatic orchestration, so manual/automatic races converge while distinct numbered revisions can never collapse merely because they resolve to the same candidate SHA. To rerun a terminal non-success provider-owned check on the same revision, retryOf names the exact prior durable dispatch; Core derives exactly one child request identity from that parent, so replay is idempotent and concurrent retries cannot fan out.

Path
changeIdrequiredstring
The changeId to act on.
Body
providerrequiredstring
Stable Trunk-managed CI identity.
one of trunk-ci
checkNamerequiredstring
1–120 characters
revisionrequiredstring
40–64 characters · matches ^[0-9a-fA-F]+$
retryOfstring
1–200 characters
expected_revisioninteger
1 or more
returns ExternalCiDispatchexternalCi.dispatch
POST/v1/changes/:changeId/byo-ci-dispatches
human only

Dispatch or retry an exact enabled customer-owned Buildkite check

Customer-owned Buildkite pipelines use a separate public handoff from the provider-neutral managed CI contract. A human with repository check-attester authority may explicitly replay or retry an enabled Required or Optional BYO check after the exact Trunk candidate exists. The customer defines its Buildkite repository checkout, credentials, commands and tests. Trunk binds the provider-confirmed Buildkite build result to the numbered Change revision without attesting which Git bytes customer-authored steps ran. retryOf identifies a terminal, prior run; retries preserve historical attempt identity.

Path
changeIdrequiredstring
The changeId to act on.
Body
checkNamerequiredstring
1–120 characters
revisionrequiredstring
40–64 characters · matches ^[0-9a-fA-F]+$
retryOfstring
1–200 characters
expected_revisioninteger
1 or more
returns ExternalCiDispatchexternalCi.dispatchByo

deployments

POST/v1/repositories/:repositoryId/deployments
human only

Create or replay an exact-revision deployment and dispatch supported Preview providers

Server-only deployment handoff for an explicitly authorized deployer. Durable deployment intent is committed before provider handling. New Vercel Preview creates resolve the repository's durable Vercel installation/project connection, capture the exact immutable Trunk candidate source proof, and stay durably NOT_STARTED while read-only preflight positively proves that project already has a Production deployment. Only then may Trunk publish STARTED and transport the exact candidate directly to Vercel without a GitHub bridge or Production target. Existing STARTED attempts continue to reconcile against their pinned provider target, including the recovery-only legacy target format used before repository-scoped integrations, and require authoritative provider read-back. Historical unsupported SHA-256 Preview attempts that are still positively pre-mutation are retired to cancelled on replay rather than remaining queued forever; STARTED and terminal historical attempts retain their existing recovery/replay semantics. Terminal idempotent replays return durable state without requiring historical provider credentials. Fresh Production work is not created through this compatibility operation: normal Production intents come only from the exact-landed Production handoff. An already-durable historical Production request may still replay its exact row, but this endpoint never dispatches Production provider mutation.

Path
repositoryIdrequiredstring
The repositoryId to act on.
Body
revisionrequiredstring
matches ^(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$
environmentrequiredstring
one of preview · production
providerrequiredstring
matches ^[a-z0-9][a-z0-9._-]{0,63}$
requestKeyrequiredstring
1–200 characters
changeIdstring
1–200 characters
returns Deploymentdeployments.start
PUT/v1/deployments/:deploymentId
human only

Report provider-observed state for one deployment attempt

Server-only provider-neutral result handoff. Any currently authorized deployer for the repository may reconcile the attempt, which permits credential rotation and failover. The deployment domain still enforces monotonic state, immutable terminal outcomes, immutable provider identity/URL and idempotent replay.

Path
deploymentIdrequiredstring
The deploymentId to act on.
Body
statusrequiredstring
one of queued · in_progress · ready · failed · cancelled
externalIdstring
at most 200 characters
urlstring
at most 2000 characters
detailsUrlstring
at most 2000 characters
returns Deploymentdeployments.update

checks

POST/v1/verification-requirements
human only

Configure an independent workspace or repository verification requirement

Body
scoperequiredstring
one of workspace · repository
capabilityrequiredstring
one of reviewer · attested_check
enabledrequiredboolean
requiredrequiredboolean
repositoryIdstring
1–128 characters
reviewerIdstring
1–128 characters
providerstring
matches ^[a-z0-9][a-z0-9._-]{0,63}$
namestring
1–120 characters
returns VerificationRequirementchecks.verification.create
GET/v1/repositories/:repositoryId/check-requirements
human only

Read the required external checks for a repository

Returns stable public check identities. Trunk-managed CI is identified as trunk-ci; customer-selected external providers retain their provider identity.

Path
repositoryIdrequiredstring
The repositoryId to act on.
returns CheckRequirementschecks.requirements.get
PUT/v1/repositories/:repositoryId/check-requirements
human only

Replace the required external checks for a repository

Repository check-admin policy. Providers report check state; they never decide whether their own check is required for landing. Public signup alone grants no check-admin authority. Trunk-managed CI uses stable trunk-ci/<workflowName> identities. New managed requirements are activated for already-verified candidate revisions, while only already-approved changes may resume landing. If managed CI cannot be activated after the policy is saved, the request reports a retryable error and the saved policy remains in effect.

Path
repositoryIdrequiredstring
The repositoryId to act on.
Body
requiredrequiredobject[]
namerequiredstring
1–120 characters
providerrequiredstring
matches ^[a-z0-9][a-z0-9._-]{0,63}$
returns CheckRequirementschecks.requirements.set
GET/v1/changes/:changeId/checks
human only

Read current revision-bound checks and the landing gate

Returns the numbered changeRevision and exact candidate revision, required and optional verification rows, each independent requirement generation and definition, its effective evaluation state, accepted immutable evidence reference and latest attempt, author action metadata, plus a single aggregate with Required blockers. Aggregate clear means no Required blocker, not proof that any check ran; missing, running, cancelled, unavailable and indeterminate results do not satisfy Required checks.

Path
changeIdrequiredstring
The changeId to act on.
returns CheckGatechecks.list
POST/v1/changes/:changeId/checks/attempts
human only

Request a review retry or rerun for the current Candidate

The Change author uses the action returned by GET checks, with the target changeId in the path and the remaining target and action fields in the body. The server chooses and freezes the newest eligible prompt for a Red rerun. The response confirms a durable reservation or returns the competing attempt. After a lost response, read Candidate Checks for the saved state.

Path
changeIdrequiredstring
The changeId to act on.
Body
changeRevisionrequiredinteger
1–9007199254740991
sourceRevisionrequiredstring
matches ^[a-f0-9]{40}([a-f0-9]{24})?$
requirementIdrequiredstring
1–128 characters
generationrequiredinteger
1–9007199254740991
actionrequiredstring
one of retry · rerun
definitionrequiredstring
1–512 characters
returns CheckAttemptActionResultchecks.attempts.request
POST/v1/changes/:changeId/checks
human only

Create a human-attested check run for the current change revision

Bootstrap surface for human-attested or non-integrated check providers. The Trunk-managed CI identity is reserved for its authenticated handoff/result path, so a human cannot manufacture a later managed attempt that supersedes provider-owned evidence. Genuine customer-selected or non-managed providers retain their own provider identity. Other checks require repository check-attester authority and reject stale revisions.

Path
changeIdrequiredstring
The changeId to act on.
Body
namerequiredstring
1–120 characters
providerrequiredstring
matches ^[a-z0-9][a-z0-9._-]{0,63}$
revisionrequiredstring
1–128 characters
requirementIdstring
1–128 characters
externalIdstring
Provider run id for idempotent creation/replay.
at most 200 characters
detailsUrlstring
at most 2000 characters
returns CheckMutationchecks.create
PUT/v1/checks/:checkId
human only

Advance a human-attested check run and resume landing when the gate turns green

Check state is monotonic. A completed conclusion is immutable; replaying the same update is idempotent and emits no duplicate event. Only the explicitly repository-authorized actor that created the attestation may update it, and CheckRuns bound to external-CI dispatches are provider-owned and rejected by this human surface.

Path
checkIdrequiredstring
The checkId to act on.
Body
statusrequiredstring
one of queued · in_progress · completed
conclusionstring
one of success · failure · cancelled · timed_out · skipped
detailsUrlstring
at most 2000 characters
returns CheckMutationchecks.update

reviewers

POST/v1/reviewers
human only

Create an workspace or repository reviewer definition

Body
scoperequiredstring
one of workspace · repository
namerequiredstring
1–120 characters
promptrequiredstring
1–20000 characters
repositoryIdstring
1–128 characters
draftReviewEnabledboolean
returns CustomerReviewerreviewers.create
PUT/v1/reviewers/:reviewerId
human only

Replace a customer reviewer with version precondition

Path
reviewerIdrequiredstring
The reviewerId to act on.
Body
expectedVersionrequiredinteger
1 or more
namerequiredstring
1–120 characters
promptrequiredstring
1–20000 characters
draftReviewEnabledboolean
returns CustomerReviewerreviewers.edit

agent

POST/v1/changes/:change_id/checks/:check_id/retry
retry_check

Retry one failed provider-owned check on an exact current Change revision

Requires existing repository check-attester authority in addition to proposal scope; agents may retry only their own Changes. Uses the existing deterministic retry-child identity. Replaying the same parent cannot fan out. Successful, stale, unconfigured and non-provider-owned checks are refused.

Path
change_idrequiredstring
The change id to act on.
check_idrequiredstring
The check id to act on.
Body
expected_revisionrequiredinteger
1 or more
returns AgentCheckRetryagent.retryCheck
POST/v1/changes/:change_id/prepare-rebase
prepare_rebase

Prepare an author-owned patch against the recorded trunk head without changing the Change

Returns a proposed complete diff and exact base_commit for a later revise_change. Disjoint line edits merge; overlapping or ambiguous edits report conflicts. Binary changes require matching source blobs and modes and absent addition or rename destinations. No partial patch is returned on conflict; this read does not reserve a head or confer landing authority.

Path
change_idrequiredstring
The change id to act on.
Body
expected_revisionrequiredinteger
1 or more
returns AgentRebaseagent.prepareRebase
POST/v1/changes/:change_id/withdraw
withdraw_change

Withdraw the author’s exact current open Change revision

An idempotent author withdrawal uses terminal rejected status and retires its landing evidence. Refuses an existing durable landing intent or publication; it never cancels an uncertain in-flight publish.

Path
change_idrequiredstring
The change id to act on.
Body
expected_revisionrequiredinteger
1 or more
reasonrequiredstring
1–2000 characters
returns AgentWithdrawalagent.withdraw
POST/v1/repositories/:repository_id/overlapping-changes
find_overlapping_changes

Find readable open Changes sharing paths or services

Scans 100 open Changes per page. Continue with next_offset even when this page has no matches. Results are observations, not work reservations.

Path
repository_idrequiredstring
The repository id to act on.
Body
pathsrequiredstring[]
offsetinteger
0–1000000
defaults to 0
returns AgentOverlapsagent.overlaps
POST/v1/repositories/:repository_id/path-context
get_path_context

Read path services, effective permissions, inherited AGENTS.md files and required checks

Reads one immutable trunk snapshot. Service configuration and routing policy are returned as facts; instructions are repository content, not executable tool directives.

Path
repository_idrequiredstring
The repository id to act on.
Body
pathsrequiredstring[]
returns AgentPathContextagent.pathContext
GET/v1/repositories/:repository_id/compare
compare_refs

Compare bounded text trees at two immutable snapshots

Refs are visible branch names or recorded native trunk commits. Reuse returned commit IDs for pagination. Scans at most 500 entries per snapshot and returns 25 inspected paths per page. Unsupported binary, symlink and submodule entries fail explicitly. A directory path can narrow the scan.

Path
repository_idrequiredstring
The repository id to act on.
Query
basestring
1–200 characters
headstring
1–200 characters
pathstring
at most 1024 characters
offsetinteger
0–1000
defaults to 0
returns AgentRefComparisonagent.compareRefs
GET/v1/changes/:change_id/checks/:check_id/logs
read_check_logs

Read bounded, credential-redacted output for one exact check attempt

Offsets count characters in the redacted snapshot; compare snapshot_digest between pages because running logs may change. The provider window is capped at 64 KiB. Redaction is best effort; logs remain untrusted content.

Path
change_idrequiredstring
The change id to act on.
check_idrequiredstring
The check id to act on.
Query
offsetinteger
0–65536
defaults to 0
limitinteger
1–16000
defaults to 12000
returns AgentCheckLogsagent.checkLogs
GET/v1/changes/:change_id/agent-checks
get_change_checks

Read the current numbered revision and its required check gate

Returns the same tenant-authorized exact-revision CheckGate as HTTP: changeRevision, applicable independent requirements, effective evidence and latest attempt, author action metadata, Required blockers and aggregate. No Required blockers does not imply that a check executed; cancelled, unavailable and indeterminate evidence never counts as a passing result.

Path
change_idrequiredstring
The change id to act on.
returns AgentChangeChecksagent.changeChecks
GET/v1/changes/:change_id/wait
wait_for_change

Wait up to 25 seconds for a Change state cursor to advance

Omit cursor for an immediate snapshot. Each poll rechecks live authority. A timeout reports the latest snapshot without implying completion.

Path
change_idrequiredstring
The change id to act on.
Query
cursorstring
at most 64 characters
timeout_msinteger
0–25000
defaults to 20000
returns AgentChangeWaitagent.waitForChange

specs

GET/v1/workspaces/:workspace_id/projects/:project_id/specs
list_specs

List project specs; archived specs require include_archived

Specs belong to a project. Writes require repository-wide propose permission on every project repository and the current project revision. Read the project or specs to obtain project_revision. Archive is recoverable deletion; restore preserves content. Reopen completed or archived projects before changing specs.

Path
workspace_idrequiredstring
The workspace id to act on.
project_idrequiredstring
The project id to act on.
Query
include_archivedboolean
returns Specsspecs.list
GET/v1/workspaces/:workspace_id/projects/:project_id/specs/:spec_id
get_spec

Read a project spec, including archived content

Specs belong to a project. Writes require repository-wide propose permission on every project repository and the current project revision. Read the project or specs to obtain project_revision. Archive is recoverable deletion; restore preserves content. Reopen completed or archived projects before changing specs.

Path
workspace_idrequiredstring
The workspace id to act on.
project_idrequiredstring
The project id to act on.
spec_idrequiredstring
The spec id to act on.
returns Specspecs.get
POST/v1/workspaces/:workspace_id/projects/:project_id/specs
create_spec

Create a project spec

Specs belong to a project. Writes require repository-wide propose permission on every project repository and the current project revision. Read the project or specs to obtain project_revision. Archive is recoverable deletion; restore preserves content. Reopen completed or archived projects before changing specs.

Path
workspace_idrequiredstring
The workspace id to act on.
project_idrequiredstring
The project id to act on.
Body
expected_revisionrequiredinteger
1 or more
titlerequiredstring
1–200 characters
bodyrequiredstring
1–30000 characters
returns Specspecs.create
POST/v1/workspaces/:workspace_id/projects/:project_id/specs/:spec_id
update_spec

Update a project spec

Specs belong to a project. Writes require repository-wide propose permission on every project repository and the current project revision. Read the project or specs to obtain project_revision. Archive is recoverable deletion; restore preserves content. Reopen completed or archived projects before changing specs.

Path
workspace_idrequiredstring
The workspace id to act on.
project_idrequiredstring
The project id to act on.
spec_idrequiredstring
The spec id to act on.
Body
expected_revisionrequiredinteger
1 or more
titlerequiredstring
1–200 characters
bodyrequiredstring
1–30000 characters
returns Specspecs.update
POST/v1/workspaces/:workspace_id/projects/:project_id/specs/:spec_id/archive
archive_spec

Archive a project spec

Specs belong to a project. Writes require repository-wide propose permission on every project repository and the current project revision. Read the project or specs to obtain project_revision. Archive is recoverable deletion; restore preserves content. Reopen completed or archived projects before changing specs.

Path
workspace_idrequiredstring
The workspace id to act on.
project_idrequiredstring
The project id to act on.
spec_idrequiredstring
The spec id to act on.
Body
expected_revisionrequiredinteger
1 or more
titlestring
1–200 characters
bodystring
1–30000 characters
returns Specspecs.archive
POST/v1/workspaces/:workspace_id/projects/:project_id/specs/:spec_id/restore
restore_spec

Restore a project spec

Specs belong to a project. Writes require repository-wide propose permission on every project repository and the current project revision. Read the project or specs to obtain project_revision. Archive is recoverable deletion; restore preserves content. Reopen completed or archived projects before changing specs.

Path
workspace_idrequiredstring
The workspace id to act on.
project_idrequiredstring
The project id to act on.
spec_idrequiredstring
The spec id to act on.
Body
expected_revisionrequiredinteger
1 or more
titlestring
1–200 characters
bodystring
1–30000 characters
returns Specspecs.restore

projects

POST/v1/workspaces/:workspace_id/projects
create_project

Create a workspace project with a human or agent owner

Workspace members can omit repository_ids. Agents must select at least one repository and have repository-wide propose scope on each selection.

Path
workspace_idrequiredstring
The workspace id to act on.
Body
titlerequiredstring
1–200 characters
statusrequiredstring
one of draft · in_progress · completed · archived
owner_idrequiredstring
at least 1 characters
repository_idsstring[]
briefstring
at most 30000 characters
iconstring
one of · flag · rocket · target · compass · map · route · signpost · mountain · trophy · medal · star · sparkles · lightbulb · flask-conical · microscope · beaker · zap · gauge · activity · chart-no-axes-combined · chart-pie · trending-up · timer · clock · shield · shield-check · lock-keyhole · key-round · fingerprint · eye · scan-line · heart-pulse · server · database · hard-drive · cloud · network · workflow · git-branch · git-pull-request · git-commit-horizontal · code · terminal · bug · wrench · settings · blocks · layers · box · package · puzzle · plug · cable · cpu · laptop · smartphone · globe · languages · accessibility · palette · paintbrush · layout-dashboard · panels-top-left · mouse-pointer-2 · users · messages-square · book-open · graduation-cap · heart · leaf · sun · circle-check
returns Projectprojects.create
POST/v1/workspaces/:workspace_id/projects/:project_id
update_project

Update a workspace project with a human or agent owner

Omit repository_ids to keep the current repositories. Workspace members can pass an empty array to clear them after unlinking any task Changes.

Path
workspace_idrequiredstring
The workspace id to act on.
project_idrequiredstring
The project id to act on.
Body
titlerequiredstring
1–200 characters
statusrequiredstring
one of draft · in_progress · completed · archived
expected_revisionrequiredinteger
1 or more
repository_idsstring[]
briefstring
at most 30000 characters
owner_idstring
at least 1 characters
iconstring
one of · flag · rocket · target · compass · map · route · signpost · mountain · trophy · medal · star · sparkles · lightbulb · flask-conical · microscope · beaker · zap · gauge · activity · chart-no-axes-combined · chart-pie · trending-up · timer · clock · shield · shield-check · lock-keyhole · key-round · fingerprint · eye · scan-line · heart-pulse · server · database · hard-drive · cloud · network · workflow · git-branch · git-pull-request · git-commit-horizontal · code · terminal · bug · wrench · settings · blocks · layers · box · package · puzzle · plug · cable · cpu · laptop · smartphone · globe · languages · accessibility · palette · paintbrush · layout-dashboard · panels-top-left · mouse-pointer-2 · users · messages-square · book-open · graduation-cap · heart · leaf · sun · circle-check
returns Projectprojects.update
POST/v1/workspaces/:workspace_id/projects/:project_id/archive
archive_project

Archive a project without deleting its tasks, specs or discussion

Archive sets status to archived; restore reopens as draft. Neither changes linked code or landing policy.

Path
workspace_idrequiredstring
The workspace id to act on.
project_idrequiredstring
The project id to act on.
Body
expected_revisionrequiredinteger
1 or more
returns Projectprojects.archive
POST/v1/workspaces/:workspace_id/projects/:project_id/restore
restore_project

Restore a project without deleting its tasks, specs or discussion

Archive sets status to archived; restore reopens as draft. Neither changes linked code or landing policy.

Path
workspace_idrequiredstring
The workspace id to act on.
project_idrequiredstring
The project id to act on.
Body
expected_revisionrequiredinteger
1 or more
returns Projectprojects.restore
GET/v1/workspaces/:workspace_id/projects/:project_id
get_project

Read the feature brief, specs, discussion, and task Changes

Specs include archived_at; archived specs are retained for reference and are not current requirements. Spec changes advance the project revision. Discussion includes the latest 25 comments in chronological order; use older_comments_cursor with the project comments reader to continue.

Path
workspace_idrequiredstring
The workspace id to act on.
project_idrequiredstring
The project id to act on.
returns Projectprojects.get
GET/v1/workspaces/:workspace_id/projects/:project_id/comments
list_project_comments

Read a page of project discussion comments

Returns up to 25 comments in chronological order. Omit before for the newest page, or pass older_comments_cursor as before to read older comments. Access is checked on each request. Pages read live committed discussion.

Path
workspace_idrequiredstring
The workspace id to act on.
project_idrequiredstring
The project id to act on.
Query
beforestring
36–36 characters
returns ProjectCommentPageprojects.comments.list

tasks

GET/v1/workspaces/:workspace_id/tasks/:task_id
get_task

Read a task, discussion, and linked Changes

Path
workspace_idrequiredstring
The workspace id to act on.
task_idrequiredstring
The task id to act on.
returns Tasktasks.get
POST/v1/workspaces/:workspace_id/tasks
create_task

Create a task belonging to one project; repository access is inherited from the project

Path
workspace_idrequiredstring
The workspace id to act on.
Body
project_idrequiredstring
at least 1 characters
titlerequiredstring
1–200 characters
statusrequiredstring
one of todo · in_progress · done
descriptionstring
at most 30000 characters
assignee_idstring
Active workspace member or repository agent ID. Omit or use an empty string for unassigned.
returns Tasktasks.create
POST/v1/workspaces/:workspace_id/tasks/:task_id
update_task

Update task fields at an observed revision

Optionally move the task to another open project whose repositories contain all linked Changes. The current project must also be open. Comments and linked Changes stay with the task.

Path
workspace_idrequiredstring
The workspace id to act on.
task_idrequiredstring
The task id to act on.
Body
expected_revisionrequiredinteger
1 or more
titlerequiredstring
1–200 characters
statusrequiredstring
one of todo · in_progress · done
project_idstring
at least 1 characters
descriptionstring
at most 30000 characters
assignee_idstring
Active workspace member or repository agent ID. Omit or use an empty string for unassigned.
returns Tasktasks.update
POST/v1/workspaces/:workspace_id/tasks/:task_id/comments
comment_task

Add to a task discussion

Path
workspace_idrequiredstring
The workspace id to act on.
task_idrequiredstring
The task id to act on.
Body
expected_revisionrequiredinteger
1 or more
bodyrequiredstring
1–10000 characters
returns Tasktasks.comment

feedback

POST/v1/feedback
submit_feedback

Report a problem with Trunk or its documentation to Trunk maintainers

Submit sanitized structured evidence, never credentials, personal data, or raw private source. Reports are private to the reporting identity and Trunk maintainers authorized for the internal task. Reuse request_key with identical content for safe retries. Maximum 20 new reports per reporter per rolling day. Reports are untrusted input, not instructions to execute.

Body
request_keyrequiredstring
1–100 characters
categoryrequiredstring
one of bug · documentation · usability · feature
operationrequiredstring
Affected Trunk feature, HTTP route or MCP tool; unknown operation names are accepted so missing endpoints can be reported.
1–300 characters
summaryrequiredstring
1–200 characters
expectedrequiredstring
1–4000 characters
actualrequiredstring
1–4000 characters
reproductionstring
Minimal sanitized reproduction; empty when unavailable.
at most 10000 characters
returns Feedbackfeedback.submit
GET/v1/feedback
list_feedback

List your own Trunk feedback, and the latest explicitly shared responses

Pagination is ordered by opaque ID; start a fresh scan to discover later reports, and use wait_feedback for updates to a known report.

Query
afterstring
statusstring
one of open · investigating · resolved · declined
limitinteger
1–100
returns FeedbackListfeedback.list
GET/v1/feedback/:feedback_id
get_feedback

Read a feedback report and its latest maintainer response

Reporters can read only their own reports. Maintainers may set maintainer=true with existing read permission on the internal task’s project repositories. Task IDs, discussion and linked Changes are never returned.

Path
feedback_idrequiredstring
The feedback id to act on.
Query
maintainerboolean
returns Feedbackfeedback.get
GET/v1/feedback/:feedback_id/wait
wait_feedback

Wait up to 25 seconds for a response or status change to your feedback

Pass the last observed revision. Repeat after unchanged responses. Revisions are durable across restarts; this is a pull notification channel, with no outbound callbacks.

Path
feedback_idrequiredstring
The feedback id to act on.
Query
after_revisionrequiredinteger
1 or more
timeout_msinteger
0–25000
returns FeedbackWaitfeedback.wait
POST/v1/feedback/:feedback_id/responses
respond_feedback

Respond to Trunk feedback as a maintainer authorized to update the linked task

Requires existing write authority for the linked task’s project repositories and an active task/project. Internal task comments are never automatically shared. Use expected_revision to avoid overwriting another maintainer. Resolved requires a release URL and response explaining the shipped fix. Resolution is a maintainer attestation, not independent deployment verification. This operation never changes code or bypasses normal deployment gates.

Path
feedback_idrequiredstring
The feedback id to act on.
Body
expected_revisionrequiredinteger
1 or more
statusrequiredstring
one of open · investigating · resolved · declined
responserequiredstring
1–10000 characters
release_urlstring
at most 2000 characters
returns Feedbackfeedback.respond