Skip to main content

Documentation Index

Fetch the complete documentation index at: https://trunk-4cab4936-mintlify-migrate-docs-changes-1778515731.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

REST API Overview

Trunk provides HTTP REST APIs for each of our features. The APIs use status codes to indicate the success or failure of requests, return JSON from all requests, and use standard HTTP response codes. All API requests must be authenticated.

Available APIs

  • Flaky Tests: for accessing information like quarantined tests in your repo.
  • Merge API : for controlling the Trunk Merge Queue.

Authentication

Authenticate to the API with an API key using the header x-api-token.

Finding your API token

You can find your API token in the Trunk App.

Open interactive demo

Explore the interactive walkthrough in a new tab.

Example

To submit an empty list of events to be tracked, do the following from the command line.
curl \
    -i \
    -X POST https://api.trunk.io/v1/metrics/trackEvents \
    -H "Content-Type: application/json" \
    -H "x-source: curl-sample" \
    -H "x-api-token: {REDACTED}" \
    -d '{
	"repo": {
		"host": "github.com",
		"owner": "trunk-io",
		"name": "jenkins-plugin"
	},
	"events":[]
	}'