wagtail-write-api
A read/write REST API for Wagtail CMS.
Wagtail's built-in API is read-only, designed for headless frontends. This plugin adds full content management: create, edit, publish, and delete pages and images via a REST API with automatic OpenAPI documentation.
Features
- Schema discovery so clients can inspect page types, snippet types, and their fields
- Page CRUD with draft/publish workflow, revision history, copy, and move
- Snippet CRUD for models registered with
@register_snippet(categories, tags, reusable content) - Image management with multipart upload and configurable renditions
- StreamField read/write with round-trip fidelity
- Rich text input in Markdown, HTML, or Wagtail's internal format
- Wagtail permissions enforced as in the admin
- OpenAPI docs generated automatically from Pydantic schemas
Quick start
pip install wagtail-write-api
# settings.py
INSTALLED_APPS = [
...
"wagtail_write_api",
]
# urls.py
urlpatterns = [
path("api/write/v1/", include("wagtail_write_api.urls")),
...
]
Create a token and start using the API:
python manage.py create_api_token admin
curl -H "Authorization: Bearer <token>" http://localhost:8000/api/write/v1/pages/
Interactive API docs are served at /api/write/v1/docs.
Note: All API URLs require a trailing slash (e.g.
/pages/,/pages/3/). Requests without a trailing slash will receive a301redirect.
Client
wagapi is a CLI client for this API, optimised for LLM orchestration. It translates CLI commands into HTTP calls and returns structured output:
uvx wagapi schema # discover content model
uvx wagapi pages create testapp.BlogPage \
--parent /blog/ --title "Hello" --field "body:..." # create a page
uvx wagapi snippets list testapp.Category # list snippets
Requirements
- Python 3.10+
- Wagtail 6.0+
Documentation
Full documentation is at tomdyson.github.io/wagtail-write-api, covering:
- Installation
- Quickstart
- Configuration
- Pages API reference
- Images API reference
- Rich text guide
- StreamField guide
- Permissions guide
Development
git clone https://github.com/tomdyson/wagtail-write-api.git
cd wagtail-write-api
uv venv && uv pip install -e ".[dev]"
uv run pytest
Run the example app:
cd example
uv run python manage.py migrate
uv run python manage.py seed_demo
uv run python manage.py runserver
Releasing to PyPI
- Update the version in
pyproject.tomlandsrc/wagtail_write_api/__init__.py - Commit, push to
main - Create a GitHub release:
gh release create v0.2.0 --generate-notes
The publish workflow builds and uploads to PyPI automatically via trusted publishing.
Not yet supported
The following Wagtail features are not yet covered by the API:
- Documents —
DocumentChooserBlockand document uploads. Only images have API support currently. - Multi-site — the API assumes a single default site. Path resolution and
url_pathmay behave unexpectedly with multipleSiteobjects. - Locales / translations — no support for
wagtail-localizeor Wagtail's built-in locale features. Pages are created in the default locale only. - TableBlock, EmbedBlock, RawHTMLBlock — StreamField round-trip works for common block types, but these specialised blocks are untested and may not serialise correctly.
- Scheduled publishing —
go_live_at/expire_atfields are not exposed. - Search promotion and redirects — no API coverage.
Contributions welcome — see CONTRIBUTING.
Licence
BSD 3-Clause. See LICENSE.
Release files for wagtail-write-api 0.8.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wagtail_write_api-0.8.4.tar.gz | 134.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wagtail_write_api-0.8.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 163.8 kB
Release files / wagtail_write_api-0.8.4.tar.gz
| Download URL | wagtail_write_api-0.8.4.tar.gz |
|---|---|
| Size | 134.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e130c3ea0ae725ad00246f20aa52a76ec929954a2f950eada5f60e0aa2d9057
|
|
BLAKE2b-256 checksum How to use checksums |
a85b9cc7512056a76b4c00eb1877af1e33bd64b2e7d479040bbeaa580384c9d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 9, 2026.
Transparency logRelease files / wagtail_write_api-0.8.4-py3-none-any.whl
| Download URL | wagtail_write_api-0.8.4-py3-none-any.whl |
|---|---|
| Size | 29.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c3179807eebfedab2c9b68a2c842df6895a432be76c6c3ab6f4e0d6fd754a2f0
|
|
BLAKE2b-256 checksum How to use checksums |
66072440527892c809fdd5672a2d1ac949dd191d23bc52aef1b9ba9bf2822288
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 9, 2026.
Transparency log