🟢API for Webhooks
This page describe how to manage Webhooks via API>
Webhooks are automated notifications sent from one platform to another when a specific event occurs.
You can also read about webhooks here.
What can you do?
Create/update a webhook destination for a dataset
Create/update a webhook destination for a dataset
Create a new webhook
query
- Querybasic
- Basicbearer
- Bearer
post
- Postget
- Get
POST /api/v1/companies/{company_id}/datasets/{dataset_id}/webhooks/ HTTP/1.1
Host: saas.haut.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 188
{
"url": "https://example.com",
"authorization": "query",
"authorization_key": "text",
"authorization_value": "text",
"method": "post",
"enabled": true,
"add_survey_answers": true,
"merge_webhooks": true
}
{
"url": "https://example.com",
"authorization": "query",
"authorization_key": "text",
"authorization_value": "text",
"method": "post",
"enabled": true,
"secret_key": "text",
"add_survey_answers": true,
"merge_webhooks": true
}
It’s highly recommended to set up a webhook as soon as possible. Webhooks provide a more convenient and robust way to receive results for each skin analysis, using a push model for instant updates. This method is more efficient and requires fewer resources for both the client and server.
Webhooks are currently tied to datasets.
Each dataset can have only one webhook destination (this may be updated in the future).
Each payload includes an images object containing signed URLs. These signed URLs are temporary and will expire 1 hour after generation.
{ "images": { "original": { "signed_url": "https://..." }, "restored": { "signed_url": "https://..." } }
By configuring a webhook, you can automatically receive results without needing to constantly request updates.
Update webhook
If you need to update some values for webhook destination, you can just create it again (use POST method).
Authorization value
Basic authorization Webhook Request Format
When our system sends a webhook request to your specified endpoint, it will be formatted like this:
curl -X POST {url} \
-H "{Authorization key}: Basic {Authorization value}"
In your case, the Authorization header will contain a base64-encoded string of your credentials (in the format username:password
), used for authenticating the webhook request.
Example:
If your username is username
and your password is password
, the encoded string will look like this:
curl -X POST {url} \
-H "Authorization: Basic dXNlcm5hbWU6cGFzc3N3b3Jk"
Here, the value dXNlcm5hbWU6cGFzc3N3b3Jk
is the base64-encoded version of username:password
.

Explicit Authorization Value Support
Alternatively, if you prefer not to use base64 encoding, you can provide the entire Authorization value explicitly. We support both methods for flexibility in how you authenticate webhook requests from our side.

Webhook Request Format with Bearer Authorization
Our system can also send webhook requests using Bearer Token authorization. In this case, the request will be formatted like this:
curl -X POST {url} \
-H "Authorization: Bearer {token}"
Where {token}
is the token you provide to authenticate the webhook request.
Example:
If your token is your_bearer_token
, the request would look like this:
curl -X POST {url} \
-H "Authorization: Bearer your_bearer_token"
This method uses the Bearer scheme, which is widely used for token-based authorization, allowing secure and straightforward authentication without needing to send username and password information.

Explicit Authorization Value Support
Similar to basic authentication, we also support setting the Bearer token explicitly in the Authorization
header, giving you full control over the security and flexibility of your webhook authentication method.

Receiving webhook with survey answers from Skin Consultant app
If you want to receive answers for your survey from B2C Consultant app (assuming your dataset was created for Skin Consultant app and your Skin Consultant app has survey questions), you can use the webhook setting add_survey_answers
if set to true
you will start receiving survey answers from your customers in the body of webhook payload.
Receving webhook when all applications were calculated
If you don't want to receive webhooks with results on per-application basis, you can set the webhook setting merge_webhooks: true
on webhook creation or set it when you update webhook.
If this setting is enabled, you will receive a little different payload and only when all the algorithms applications were calculated for the image.
The data structure is very similar to per-app webhooks, but here you won't have any application info and the event will be photo_calculated_by_all_apps
.
Also in the area_results
field you will receive area results from all algorithms within all algorithms applications connected to image's dataset.
If you are using the merged webhook and some algorithm wasn't calculated (due to some internal error) you will receive a webhook with partial data which was calculated at the moment in 60 seconds after image upload.
Last updated
Was this helpful?