# API Reference

## 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](/flaky-tests/reference/api-reference.md): for accessing information like quarantined tests in your repo.
* [Merge API](/merge-queue/reference/merge.md) : for controlling the Trunk Merge Queue.

## Authentication

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

### Finding your API token

You can find your API token in the [Trunk App](https://app.trunk.io).

{% @supademo/embed url="<https://app.supademo.com/demo/BILCaBxa05Hkol0Ck4Z-y>" demoId="BILCaBxa05Hkol0Ck4Z-y" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trunk.io/setup-and-administration/apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
