Trunk
Trunk builds developer experience and CI reliability tooling. Its platform spans Code Quality (a meta-linter and static analysis manager driven by the trunk CLI), a flake-aware parallel Merge Queue, and Flaky Tests detection/CI Analytics. Test results are uploaded from CI via the Trunk Analytics CLI/GitHub Action, and an HTTP REST API at api.trunk.io exposes Flaky Tests and Merge Queue control plus Svix-powered webhooks.
5 APIs
0 Features
Developer ToolsCI/CDCode QualityFlaky TestsMerge Queue
REST API for querying Flaky Tests state - fetch test-case details, list quarantined tests, list unhealthy (FLAKY/BROKEN) tests, list tests that failed in a time range, and link ...
CI test-result ingestion surface. The trunk-analytics-cli (and the trunk-io/analytics-uploader GitHub Action) uploads JUnit XML, Bazel BEP, and XCResult test reports to Trunk fo...
REST API to control the flake-aware parallel Merge Queue - submit, cancel, restart, and inspect pull requests; set impacted targets; create, get, update, and delete queues; and ...
Svix-powered outbound webhooks for subscribing to Flaky Tests events (test_case.status_changed, test_case.monitor_status_changed, test_case.investigation_completed) and Merge Qu...
Meta-linter and static analysis manager exposed through the trunk CLI and a local daemon (no public REST API). Commands include trunk init, trunk check, and trunk check --all; i...
opencollection: 1.0.0
info:
name: Trunk API
version: '1.0'
request:
auth:
type: apikey
key: x-api-token
value: '{{apiToken}}'
in: header
items:
- info:
name: Flaky Tests
type: folder
items:
- info:
name: Get the details of a test case
type: http
http:
method: POST
url: https://api.trunk.io/v1/flaky-tests/get-test-details
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"org_url_slug\": \"my-trunk-org-slug\",\n \"test_id\": \"01234567-0123-0123-0123-0123456789ab\"\n}"
docs: Fetch detailed metadata for a single test case, including status, failure rates, common failures, codeowners, and
quarantine state.
- info:
name: Get a list of quarantined tests
type: http
http:
method: POST
url: https://api.trunk.io/v1/flaky-tests/list-quarantined-tests
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"org_url_slug\": \"my-trunk-org-slug\",\n \"page_query\": {\n \"page_size\": 50\n }\n}"
docs: List tests currently quarantined in a repository, with pagination.
- info:
name: Get a list of unhealthy tests
type: http
http:
method: POST
url: https://api.trunk.io/v1/flaky-tests/list-unhealthy-tests
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"org_url_slug\": \"my-trunk-org-slug\",\n \"status\": \"FLAKY\",\n \"page_query\": {\n \"page_size\": 50\n\
\ }\n}"
docs: List unhealthy tests filtered by status (FLAKY or BROKEN), with pagination.
- info:
name: Get a list of distinct tests that failed in the given time range
type: http
http:
method: POST
url: https://api.trunk.io/v1/flaky-tests/list-failing-tests
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"org_url_slug\": \"my-trunk-org-slug\",\n \"start_time\": \"2026-06-01T00:00:00Z\",\n \"end_time\": \"2026-06-20T00:00:00Z\"\
,\n \"page_query\": {\n \"page_size\": 50\n }\n}"
docs: List distinct tests that failed within an inclusive start / exclusive end time range, with pagination.
- info:
name: Link a ticket to a test case
type: http
http:
method: POST
url: https://api.trunk.io/v1/flaky-tests/link-ticket-to-test-case
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"test_case_id\": \"01234567-0123-0123-0123-0123456789ab\",\n \"external_ticket_id\": \"KAN-123\"\n}"
docs: Associate an external Jira/Linear ticket with a Trunk test case.
- info:
name: Merge Queue
type: folder
items:
- info:
name: Submit a pull request
type: http
http:
method: POST
url: https://api.trunk.io/v1/submitPullRequest
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"targetBranch\": \"main\",\n \"pr\": {\n \"number\": 1234\n }\n}"
docs: Submit a pull request to the merge queue.
- info:
name: Cancel a pull request
type: http
http:
method: POST
url: https://api.trunk.io/v1/cancelPullRequest
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"targetBranch\": \"main\",\n \"pr\": {\n \"number\": 1234\n }\n}"
docs: Cancel a pull request in the merge queue.
- info:
name: Get a submitted pull request
type: http
http:
method: POST
url: https://api.trunk.io/v1/getSubmittedPullRequest
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"targetBranch\": \"main\",\n \"pr\": {\n \"number\": 1234\n }\n}"
docs: Get the state of a submitted pull request (NOT_READY, PENDING, TESTING, TESTS_PASSED, MERGED, FAILED, CANCELLED,
PENDING_FAILURE).
- info:
name: Restart tests on a pull request
type: http
http:
method: POST
url: https://api.trunk.io/v1/restartTestsOnPullRequest
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"targetBranch\": \"main\",\n \"pr\": {\n \"number\": 1234\n }\n}"
docs: Restart tests on a pull request in the merge queue.
- info:
name: Set impacted targets
type: http
http:
method: POST
url: https://api.trunk.io/v1/setImpactedTargets
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"targetBranch\": \"main\",\n \"pr\": {\n \"number\": 1234\n },\n \"impactedTargets\": [\"//app:test\"\
]\n}"
docs: Set the impacted build/test targets for a pull request.
- info:
name: Get merge queue testing details
type: http
http:
method: POST
url: https://api.trunk.io/v1/getMergeQueueTestingDetails
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"targetBranch\": \"main\"\n}"
docs: Get in-progress merge queue testing details.
- info:
name: Create a queue
type: http
http:
method: POST
url: https://api.trunk.io/v1/createQueue
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"targetBranch\": \"main\"\n}"
docs: Create a merge queue for a target branch.
- info:
name: Get a queue
type: http
http:
method: POST
url: https://api.trunk.io/v1/getQueue
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"targetBranch\": \"main\"\n}"
docs: Get a merge queue and its state (RUNNING, PAUSED, DRAINING, SWITCHING_MODES).
- info:
name: Update a queue
type: http
http:
method: POST
url: https://api.trunk.io/v1/updateQueue
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"targetBranch\": \"main\"\n}"
docs: Update a merge queue configuration.
- info:
name: Delete a queue
type: http
http:
method: POST
url: https://api.trunk.io/v1/deleteQueue
body:
type: json
data: "{\n \"repo\": {\n \"host\": \"github.com\",\n \"owner\": \"my-org\",\n \"name\": \"my-repo\"\n },\n\
\ \"targetBranch\": \"main\"\n}"
docs: Delete a merge queue.
- info:
name: Get merge queue metrics
type: http
http:
method: GET
url: https://api.trunk.io/v1/getMergeQueueMetrics?repo=my-repo&repoHost=github.com
docs: Get merge queue metrics in Prometheus text exposition format.