<a id="api"></a>

# Wagtail API

Wagtail includes a built-in API module, currently with two coexisting versions for programmatic access to your content:

- **v2**: a battle-tested read-only API, built on [Django REST Framework](https://www.django-rest-framework.org/). It exposes content as raw field data for serving content to non-web clients (such as a mobile phone app), or pulling content out of Wagtail for use in another site. It’s widely used for headless projects.
- **v3** — [Wagtail 8.0’s new API](v3/index.html.md#api-v3), built on [Django Ninja](https://django-ninja.dev/). Beyond reading content, it supports a wide range of authenticated CMS operations such as creating and editing pages, media, documents, and snippets, plus revisions, rich text, and StreamField. It offers OpenAPI 3.1 schema output and RFC 7807 errors.

See [RFC 8: Wagtail API](https://github.com/wagtail/rfcs/blob/main/text/008-wagtail-api.md#12---stable-and-unstable-versions)
for full details on our stabilization policy.

Wagtail is built on Django, so you can also use other Django solutions for building APIs such as [with Django Ninja](https://github.com/sinnwerkstatt/wagtail-ninja) or [with GraphQL](https://github.com/torchbox/wagtail-grapple).

The v2 read API remains available and unchanged, while v3 is under active development. See the configuration guides below for more usage information.

* [Wagtail API v2 configuration guide](v2/configuration.html.md)
  * [Basic configuration](v2/configuration.html.md#basic-configuration)
  * [Additional settings](v2/configuration.html.md#additional-settings)
* [Wagtail API v2 usage guide](v2/usage.html.md)
  * [Fetching content](v2/usage.html.md#fetching-content)
  * [Default endpoint fields](v2/usage.html.md#default-endpoint-fields)
  * [Changes since v1](v2/usage.html.md#changes-since-v1)
* [Wagtail API v3](v3/index.html.md)
  * [v3 API authentication](v3/authentication.html.md)
  * [Pages](v3/pages.html.md)
  * [Images](v3/images.html.md)
  * [Documents](v3/documents.html.md)
  * [Snippets](v3/snippets.html.md)
  * [Redirects](v3/redirects.html.md)
  * [StreamField and relations in the API](v3/streamfield.html.md)
  * [Rich text in the API](v3/rich_text.html.md)
  * [Sites](v3/sites.html.md)
  * [Locales and translations](v3/locales.html.md)
  * [Schema discovery](v3/schema.html.md)
  * [v3 API reference](v3/reference.html.md)
  * [Migrating from the v2 API](v3/migration.html.md)
  * [Quick start](v3/index.html.md#quick-start)
  * [What’s included](v3/index.html.md#what-s-included)
  * [Pagination](v3/index.html.md#pagination)
  * [Error handling](v3/index.html.md#error-handling)
* [How to set up Django Ninja](django-ninja.html.md)
  * [Basic configuration](django-ninja.html.md#basic-configuration)
  * [OpenAPI documentation](django-ninja.html.md#openapi-documentation)
