Webhooks

Celantur Cloud API v2 uses webhooks to notify your application when a file has been processed.

Overview

By setting a webhook URL in the request to Create anonymization task, a HTTPS POST request will be sent to the specified URL, as soon as the submitted file has finished processing.
payload = {
"anonymization_method": "blur",
"face": True,
"webhook": "https://example.com/webhook/dev?param=test"
}
response = requests.post(
"https://api.celantur.com/v2/task/",
data=json.dumps(payload),
headers={'Authorization': auth_token}
)
The payload sent to the webhook URL looks like this:
{
"customer_id": "247d7a0f-f03c-40b9-bed6-b2c4a00c5d80",
"task_id": 1693295888421318,
"task_status": "done",
"anonymized_url": "https://cloudapi-customer-uploads-v2-dev-eu-central-1.s3.amazonaws.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxxxxxxxxxxxxxxx/1/anonymized.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVKZ73AQDINGO3STH%2F20230829%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20230829T080023Z&X-Amz-Expires=14400&X-Amz-SignedHeaders=host&X-Amz-Signature=5c99b77982c11da5e9889d3c88c0d2a109270d8c2b0f17d61566ccxxx0495xxx”
}
Webhooks are especially useful to trigger the download of a file, right after it has finished processing.

Webhook status

The task’s webhook status is either:
  • empty
  • set
  • sent
  • failed
The webhook status can be retrieved from the response bodies of Get task and Get task status endpoint.

Prerequisites for webhooks

  • Make sure you have a publicly available HTTPS endpoint (URL) on your server.
  • Set the webhook URL in the Create anonymization task request's JSON body.