Skip to main content
Package the doconda SDK with your function and call doconda.documents.create(...) in the handler. The call waits until the Word, PowerPoint or Excel file is ready, and documents.download returns its bytes to store in S3. The function needs no Office libraries: Doconda builds the file and its PDF.

Steps

  1. Put your Doconda API key (dashboard → API keys) in the function’s DOCONDA_API_KEY environment variable, preferably from a secret.
  2. Package the SDK. It needs Python 3.9 or later and its only dependency is httpx: pip install doconda -t package/, then add lambda_function.py to the zip.
  3. Write the handler:
Test it with this event:
The function returns:
To have the AI write the content, pass prompt instead of content.

Set the timeout for the quality level

How long the call takes depends on the quality level: Without quality, Doconda picks the level (auto); from content alone it uses standard. Raise the function’s timeout to cover the level you use; Lambda allows up to 15 minutes. To keep the function short, call doconda.documents.create_in_background(...), which answers at once with the document id, and register a webhook with doconda.webhooks.create(url) to hear when it finishes.

What you get back

  • status: ready, or failed with error.code and error.message. Failed documents are not charged.
  • doc["outputs"]: the file and its PDF, as links valid 5 minutes. documents.outputs(id) returns fresh ones.
  • documents.download(id, "xlsx") or "pdf": the bytes of that output.

FAQ

No. The SDK only makes HTTP calls; Doconda returns the finished, editable file and its PDF.
Yes. Network errors, 429 and 5xx on reads and create are retried twice by default (max_retries=2) before raising DocondaError. Conversions and uploads go out once, so they never run twice.
In the European Union (Ireland), and the AI that processes them also runs in the EU.