> For the complete documentation index, see [llms.txt](https://gyrinx.gitbook.io/gyrinx/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gyrinx.gitbook.io/gyrinx/technical-reference/api.md).

# API

The API app provides minimal webhook endpoints for external integrations. Currently, it's primarily used for handling webhooks from Patreon to manage supporter benefits.

## Overview

The API is intentionally minimal and focused on specific integration needs rather than being a general-purpose REST API. The main application is designed as a server-rendered Django application, not an API-first application.

## Endpoints

### Webhook Handling

The primary purpose of the API app is to handle webhooks from external services:

* **Patreon Webhooks**: Handles subscription events from Patreon to manage supporter benefits and access levels

## Models

The API app includes basic models for tracking webhook requests:

* `WebhookRequest`: Logs incoming webhook requests for debugging and audit purposes

## Security

Webhook endpoints include proper signature verification to ensure requests are legitimate and coming from expected sources.

## Future Considerations

While the current API is minimal, future expansion might include:

* Read-only endpoints for public data (lists, content)
* Mobile app support APIs
* Third-party integration APIs

However, any API expansion should maintain the principle of server-rendered HTML as the primary interface.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://gyrinx.gitbook.io/gyrinx/technical-reference/api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
