> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trunk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

The Trunk API is a REST API for interacting with Trunk services. It accepts and returns JSON, and uses standard HTTP status codes.

The base URL is `https://api.trunk.io`, followed by the version (`/v2` for example).

```bash theme={"system"}
curl https://api.trunk.io/v2/merge-queues \
  -H "Authorization: Bearer $TRUNK_API_KEY"
```

## Getting started

> [card] [Authentication](https://docs.trunk.io/api/authentication)
>
> API keys, permissions, and GitHub Actions logins.

> [card] [Status codes and errors](https://docs.trunk.io/api/errors.md)
>
> What each status code means, the error envelope, and when to retry.

> [card] [Pagination](https://docs.trunk.io/api/pagination.md)
>
> Page through lists with cursors.

> [card] [Rate limits](https://docs.trunk.io/api/rate-limits.md)
>
> The request limits, and how to handle `429`.

## Request IDs

Every response from the API has an `X-Request-Id` header. Include it when you contact support about a request. Responses from Trunk's edge, such as some `401` and `429` responses, may not have it.

## Compatibility

On an API version, additions are not considered breaking changes:

* New endpoints.
* New optional request parameters.
* New optional response fields.
* New values in any enum, including new error codes.

A removal or a change in meaning needs a new major version. **Your client must accept fields and values that it doesn't know.** For example, a client that fails on an unknown enum value will break when a new value is added.

## Markdown for agents

Add `.md` to the URL of any page in this reference to get it as Markdown. An endpoint's Markdown page includes its OpenAPI definition.

## Support

Ask us in [Slack](https://slack.trunk.io) or email [support@trunk.io](mailto:support@trunk.io).
