Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.manka.tz/llms.txt

Use this file to discover all available pages before exploring further.

If a callback_url was supplied when submitting via POST /analysis or POST /analysis-combined, Manka will POST the result to that URL when the job completes or fails.
Manka makes one delivery attempt with no retries. Your endpoint must respond with any 2xx status to acknowledge receipt.

Payload shape

Success

status
string
required
Always "completed" on success.
task_id
string
required
Matches the task_id returned on submission.
result
object
required
The full analysis output.
{
  "status": "completed",
  "task_id": "3f7a1c2e-8b4d-4e9f-a1b2-c3d4e5f60718",
  "result": { "...": "..." }
}

Failure

status
string
required
Always "failed" on failure.
task_id
string
required
Matches the task_id returned on submission.
error
string
required
Human-readable reason the analysis could not be completed.
{
  "status": "failed",
  "task_id": "3f7a1c2e-8b4d-4e9f-a1b2-c3d4e5f60718",
  "error": "Unable to process this PDF"
}

Receiver recommendations

  • Idempotency — key downstream actions on task_id so a duplicate delivery is harmless.
  • Respond fast — acknowledge with 2xx and process out-of-band; avoid blocking on long downstream work.
  • Fall back to polling — because there are no retries, treat the callback as best-effort and pair it with GET /analysis/:task_id if delivery is missed.

Minimal receiver

from flask import Flask, request

app = Flask(__name__)

@app.post("/manka/webhook")
def manka_webhook():
    payload = request.get_json()
    task_id = payload["task_id"]
    if payload["status"] == "completed":
        save_result(task_id, payload["result"])
    else:
        mark_failed(task_id, payload["error"])
    return "", 204