Office Editor API
Base path: /api/v1/office-editor/. Python: client.office. API-key scope: convert
(scopes).
An office document is a spreadsheet, text document or slide deck (kind is sheet, doc or
slide) stored as a JSON snapshot. Import turns an Office file into one, export turns one back
into a file. The office editor needs a paid plan (an active subscription or a completed
pay-as-you-go purchase); without one, every route answers 403.
Documents
| Method | Path | Python | Purpose |
|---|---|---|---|
POST | /documents/ | office.create_document(kind="sheet", title="...") | New empty document; answers 201 |
GET | /documents/ | office.list_documents(kind=None, page=None, page_size=None) | Your documents, without snapshots |
GET | /documents/{document_id}/ | office.get_document(document_id) | One document with its snapshot |
PUT | /documents/{document_id}/ | office.save_document(document_id, rev=..., snapshot={...}, title=None) | Save a new snapshot |
DELETE | /documents/{document_id}/ | office.delete_document(document_id) | Delete it |
A save must send the rev it last read. A stale rev answers 409, and an oversized snapshot
answers 413.
Import and export
Import and export spend credits
Both run as background jobs and are charged at the office.convert price on the
rate card. With too few credits they answer 403
office_editor.insufficient_credits.
| Method | Path | Python | Purpose |
|---|---|---|---|
POST | /import/ | office.import_file(path, kind="doc") | Upload a .xlsx, .docx or .pptx as a new document; answers 202 {"job_id": ...} |
POST | /export/ | office.export(document_id, target_format="docx") | Export a document; answers 202 {"job_id": ...} |
GET | /jobs/{job_id}/ | office.job(job_id) | Poll an import or export job |
GET | /jobs/{job_id}/download/ | office.download(job_id, path) | The exported file |
The export format must match the document’s kind: xlsx for sheet, docx for doc, pptx
for slide. Any other value answers 422 with office_editor.unsupported_format.
from indox_client import Indox
with Indox() as client:
job = client.office.import_file("budget.xlsx", kind="sheet")
status = client.office.job(job["job_id"]) # poll until the job has finishedSlide decks drawn by AI Slide Decks are slide documents, so the same routes read
and export them. Exporting one runs the deck’s quality gate first and can answer 409 with the
deck’s project_id.