---
title: "Upload a chapter file"
method: POST
path: "/chapter/{chapter_slug}/upload"
tags: ["Chapters"]
---

# Upload a chapter file

`POST /chapter/{chapter_slug}/upload`

Uploads a file for the chapter identified by the specified slug.

## Headers

- `Accept` 'application/vnd.Creative Force.v2.3+json' | 'application/vnd.Creative Force.v2.3+xml', required

## Request body

- object
  - `filename` string, required — Original filename of the uploaded file, including the extension.
  - `data` string, byte, required — Base64-encoded contents of the image file. The encoded payload must round-trip cleanly through standard base64 decoding; payloads with stray characters, incorrect padding, or other malformed encoding are rejected. Only image files are accepted: `gif`, `jpeg`, `jpg`, `png`, `tif`, `tiff`, `ico`, `webp`, and `avif`. The file size must not exceed the maximum file size for the account.

## Response `201`

Chapter file uploaded.

- UploadResult — Receipt returned when a file is uploaded to a category, chapter, entry, or user field. Carries the original filename, a short opaque token that addresses the stored file, and the canonical URL through which the file can be retrieved.
  - `filename` string — Original filename of the uploaded file, including the extension.
  - `token` string — Opaque identifier for the stored file. Used as the `{token}` path parameter on `/file/{token}`.
  - `link` string, uri — Canonical URL for retrieving the uploaded file.

## Other responses

- `400` — Request was rejected before the endpoint could process it. Common causes: invalid `Accept` header, unsupported `x-api-language` code, empty request body on `POST` / `PUT`, invalid JSON in the request body, or an invalid slug format in a path parameter.
- `401` — Missing `x-api-key` header.
- `403` — Authenticated request denied. Common causes: invalid or unknown API key, suspended account, or `api` feature not enabled for the account.
- `404` — Resource identified by the path slug does not exist. Returned when the slug is well-formed but no record matches it.
- `422` — Request was syntactically valid but could not be processed. Returned in two scenarios: - **Field-level validation failure** — one or more request fields violated the endpoint's validation rules. The body includes an `errors` map keyed by field name with one or more validation messages each. - **Resource-state precondition failure** — the request fields were all valid, but the target resource was in a state that does not permit the requested operation. The body carries only `message` and `status_code`; no `errors` map.
- `429` — Rate limit of 60 requests per minute exceeded.
- `503` — Service is temporarily unavailable due to regional maintenance.

## Changes

- **2026-07-07** (v2) `9b9103538ceb` — 2 info
  - api tag `Chapters` added
  - api tag `Chapter` removed
- **2026-07-01** (v2) `e96a96d4507e` — 8 info
  - added the media type `application/xml` for the response with the status `201`
  - added the media type `application/xml` for the response with the status `400`
  - added the media type `application/xml` for the response with the status `401`
  - added the media type `application/xml` for the response with the status `403`
  - …4 more

[Change history](https://skmtc.dev/tectonic/apis/award-force-api/changes/chapter/:chapter_slug/upload/post.md)

---

[API](https://skmtc.dev/tectonic/apis/award-force-api.md) · [All operations](https://skmtc.dev/tectonic/apis/award-force-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/tectonic/award-force-api/revisions/e2511e46f9f2/schema)
