Skip to main content
Add doconda to your Lambda function’s package and call doconda.documents.create(format=..., prompt=...) (or with your Markdown in content). The call waits until the file is ready and returns its download links; documents.download gives you the bytes to store in S3 or send on.

Steps

  1. Put your Doconda API key (dashboard → API keys) in the function’s DOCONDA_API_KEY environment variable, preferably from a secret rather than in code.
  2. Package the dependency (Python 3.9 or later; its only dependency is httpx): pip install doconda -t package/ and add your lambda_function.py to the zip.
  3. Write the handler:
Test it with an event like {"format": "xlsx", "markdown": "# Budget\n\n| Item | Amount |\n|---|---|\n| Venue | 1200 |"}. To have the AI write it, pass prompt instead of content. Raise the function’s timeout: creating from your Markdown at fast quality takes a few seconds, but standard can take several minutes (see quality levels). If you don’t want the Lambda to wait, use create_in_background(...), which answers right away, and get notified with a webhook (doconda.webhooks.create(url)).

What you get back

  • outputs: the file and its PDF. Links expire after 5 minutes; documents.outputs(id) gives fresh ones.
  • To store the file in S3: doconda.documents.download(doc["id"], "xlsx") returns the bytes.
  • status: ready, ready_with_warnings, needs_review (check documents.report(id)) or failed (not charged).

FAQ

No. The SDK only makes the call; you get the finished, editable file with its PDF.
Yes: network errors, 429 and 5xx are retried automatically (max_retries=2 by default) before raising DocondaError.
In the European Union (Ireland), and the AI that processes them also runs in the EU.
You pay per delivered document; failed ones are not charged. See pricing.

Keep reading