developer docs

Endpoints

Exports

Package a chapter's file and download it.

A chapter's file is packaged, then downloaded. What each format holds and which projects have it is in downloading files.

Prepare a file

POST/api/v1/chapters/:id/export/prepare

Packages one file. Called again until it answers done: true: each call renders what it can in its time budget, and keeps it for the next. Preparing is free, and so is a file prepared again.

JSON fieldTypeWhat it is
languagestringRequired. A target language's code.
formatstringRequired. zip, clean, txt, docx or source.
budgetMsintegerHow long one call may work before it answers, 0 to 30,000 milliseconds. 8,000 when left out. Each call renders at least a few pages, whatever the budget.
Shell
curl https://tinypica.com/api/v1/chapters/$CHAPTER/export/prepare \
  -H "Authorization: Bearer $TINYPICA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"language": "en", "format": "docx"}'
Answer, not done yet
{ "done": false, "rendered": 9, "total": 24 }
Answer, done
{
  "done": true,
  "languageCode": "en",
  "format": "docx",
  "filename": "chapter-1-en.docx",
  "byteSize": 991,
  "pageCount": 24,
  "preparedAt": "2026-09-28T12:46:52.102Z"
}
Type
type PrepareAnswer = PrepareProgress | PreparedFile

interface PrepareProgress {
  done: false
  rendered: number
  total: number
}

interface PreparedFile {
  done: true
  languageCode: string
  format: 'zip' | 'clean' | 'txt' | 'docx' | 'source'
  filename: string
  byteSize: number
  pageCount: number
  preparedAt: string
}

A file that is done is announced with export.ready.

StatusWhen
400The API exports zip, clean, txt, docx, source; A novel chapter exports as text only; a format the project stops before; Validation Error for a missing field.
404Chapter not found.
413The file would be over 90 MB.
425Nothing is translated into that language yet. clean and source are not held up by it.

Download a file

GET/api/v1/chapters/:id/export/download

The prepared file, as an attachment. For zip, the file the run packaged when none was prepared since.

QueryWhat it is
languageRequired. A target language's code.
formatRequired. zip, clean, txt, docx or source.
Shell
curl -OJ "https://tinypica.com/api/v1/chapters/$CHAPTER/export/download?language=en&format=docx" \
  -H "Authorization: Bearer $TINYPICA_KEY"
Answer
HTTP/1.1 200 OK
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Content-Length: 991
Content-Disposition: attachment; filename="chapter-1-en.docx"
formatContent-TypeFile name
zipapplication/zipchapter-1-en.zip
cleanapplication/zipchapter-1-clean.zip
txttext/plain; charset=utf-8chapter-1-en.txt
docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentchapter-1-en.docx
sourcetext/plain; charset=utf-8chapter-1-source.txt

The number in a name is the chapter's, and the code its language's.

StatusWhen
400A format the API does not hand out, or a missing query field.
404Chapter not found.
409This export has not been prepared yet; This chapter changed since the export was prepared, prepare it again; The prepared file is no longer available, prepare it again.