A read/write REST API for Wagtail CMS
Project description
wagtail-write-api
A read/write REST API for Wagtail CMS, built on Django Ninja.
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
- Page CRUD with draft/publish workflow, revision history, copy, and move
- Image management with multipart upload and configurable renditions
- StreamField read/write with full round-trip fidelity
- Rich text input in Markdown, HTML, or Wagtail's internal format
- Schema discovery so clients can inspect page types and their fields
- Wagtail permissions enforced exactly 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.
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.
Licence
BSD 3-Clause. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wagtail_write_api-0.2.2.tar.gz.
File metadata
- Download URL: wagtail_write_api-0.2.2.tar.gz
- Upload date:
- Size: 116.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c87422297d21143f57ded679245f491b02bcf10dc059469b683404c58391534b
|
|
| MD5 |
9b8e2a3afd11226d7f4b7d89f54763d4
|
|
| BLAKE2b-256 |
158fd399edb6eb024a254156d501b9519b980e86cabdf44adf2cca3cf7c46da5
|
Provenance
The following attestation bundles were made for wagtail_write_api-0.2.2.tar.gz:
Publisher:
publish.yml on tomdyson/wagtail-write-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wagtail_write_api-0.2.2.tar.gz -
Subject digest:
c87422297d21143f57ded679245f491b02bcf10dc059469b683404c58391534b - Sigstore transparency entry: 1247032141
- Sigstore integration time:
-
Permalink:
tomdyson/wagtail-write-api@18f2fa32e04d53fb062e9d518d428431792922d6 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/tomdyson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@18f2fa32e04d53fb062e9d518d428431792922d6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file wagtail_write_api-0.2.2-py3-none-any.whl.
File metadata
- Download URL: wagtail_write_api-0.2.2-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ee4b1207c5bcfd39c7f30382fa57f480df9c3bea9a49b2b602fc1432a61b44d
|
|
| MD5 |
fee69ef47c91a32e08bf5f451520f2d0
|
|
| BLAKE2b-256 |
98cbfb6c2fc7e045d33bc3e5b0a219ca24993ba87b162767e43d2a013977a231
|
Provenance
The following attestation bundles were made for wagtail_write_api-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on tomdyson/wagtail-write-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wagtail_write_api-0.2.2-py3-none-any.whl -
Subject digest:
2ee4b1207c5bcfd39c7f30382fa57f480df9c3bea9a49b2b602fc1432a61b44d - Sigstore transparency entry: 1247032142
- Sigstore integration time:
-
Permalink:
tomdyson/wagtail-write-api@18f2fa32e04d53fb062e9d518d428431792922d6 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/tomdyson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@18f2fa32e04d53fb062e9d518d428431792922d6 -
Trigger Event:
release
-
Statement type: