Skip to main content
POST
/
webhooks
/
notification
Spec of webhook to be hosted by External Partners.
curl --request POST \
  --url https://sdp.suki.ai/webhooks/notification \
  --header 'Content-Type: application/json' \
  --data '
{
  "encounter_id": "29de56bc-960a-4cd5-b18f-79a798d62874",
  "error_code": "ERROR_CODE_TRANSCRIPTION",
  "error_detail": "Error in transcription",
  "session_id": "20965414-929a-4f71-a3e5-b92bec07d086",
  "status": "failure"
}
'
This response has no body data.
Use this endpoint specification to implement a endpoint in your application that receives notifications from the Suki platform. This endpoint should be hosted by your application to receive notifications about Form filling completion or failure.
Host this endpoint on your server. Suki sends a POST when Form filling processing completes or fails. The payload session_id is the Form filling session ID from Create Form Filling session.
Learn more about how webhooks work and how to implement your webhook endpoint in Notification webhook for partners.

Code examples

from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route('/webhooks/notification', methods=['POST'])
def handle_webhook():
    """
    Webhook endpoint for Form filling session notifications.
    Verify X-API-Key and generated-at before parsing JSON; see Signature verification guide.
    """
    # TODO: verify webhook signature (see /documentation/webhook/signature-verification)
    data = request.get_json()

    if not data:
        return jsonify({"error": "Invalid request"}), 400

    status = data.get("status")

    if status == "success":
        session_id = data.get("session_id")
        encounter_id = data.get("encounter_id")
        print(f"Form filling session {session_id} completed (encounter {encounter_id})")

        links = data.get("_links") or {}
        for link in links.get("structured_data") or []:
            print(f"  Structured data: {link.get('method')} {link.get('href')}")
        for link in links.get("status") or []:
            print(f"  Status: {link.get('method')} {link.get('href')}")

        return jsonify({"message": "Notification received"}), 200

    if status == "failure":
        session_id = data.get("session_id")
        encounter_id = data.get("encounter_id")
        error_code = data.get("error_code")
        error_detail = data.get("error_detail")
        print(
            f"Form filling session {session_id} failed (encounter {encounter_id}): "
            f"{error_code} - {error_detail}"
        )
        return jsonify({"message": "Failure notification received"}), 200

    return jsonify({"error": "Unknown status"}), 400

if __name__ == '__main__':
    app.run(port=3000)

Body

application/json

FailureNotification

encounter_id
string

Id of the encounter to which the payload belongs.

Example:

"29de56bc-960a-4cd5-b18f-79a798d62874"

error_code
string

Error code.

Example:

"ERROR_CODE_TRANSCRIPTION"

error_detail
string

Details of the error, if any.

Example:

"Error in transcription"

session_id
string

Id of the session that failed.

Example:

"20965414-929a-4f71-a3e5-b92bec07d086"

status
string
Example:

"failure"

Response

Last modified on June 30, 2026