Skip to main content

Create Webhooks

You can receive our processing results as soon as they are completed.
To do this, it is necessary to create a Webhook that will receive our request.
Only one Webhook type can be created at a time, so if you want to change its configuration, you must delete the existing Webhook first.

Below you will find how to register a Webhook via API.
It is important to note that the webhook URL must follow the pattern using ":id".
This is the parameter where we will send the processed document ID. See the examples below.

Document Service - Webhook Creation

POST Environment URL/document_webhooks

IdentifierValue
Content-typeapplication/json
IDEXA-API-KEY[api_key]

Payload

ParameterDescriptionRequiredTypeExamples
nameDescriptive name of the WebhookYesStringWebhook 1
typeInternal Webhook type code (0-Document finished)YesInteger0
methodHTTP method to be sent (POST, PUT, GET, DELETE)YesString"POST"
headersHeaders to be sentNoJSON{"Content-Type": "application/json"}
headerAuthAuthorization header type (Bearer)NoString"Bearer"
urlURL to be calledYesString"http://localhost:5000/ocr_feedback/:id"
authorizationAuthorization header (if you want a fixed authorization)NoString"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJI..."
authorizationUrlAuthentication URL for webhook execution timeNoString"http://localhost:5000/login"
authorizationMethodAuthentication method for webhook execution timeNoString"POST"
authorizationHeadersHeaders for authentication at webhook execution timeNoJSON{"Content-Type": "application/x-www-form-urlencoded"}
authorizationBodyBody for authentication at webhook execution timeNoJSON{"username": "root", "password": "root"}
authorizationResponseTokenAttrName of the attribute in the authenticat
{
"id": "a7046a49-1fe0-483d-b220-cd93fe50a3a9",
"clientId": "113d37ed-6b47-46b6-bc50-bf5d64ad3a94",
"name": "Webhook 1",
"type": 0,
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"headerAuth": "Bearer",
"url": "http://localhost:5000/ocr_feedback/:id",
"authorization": null,
"authorizationUrl": "http://localhost:5000/login",
"authorizationMethod": "POST",
"authorizationHeaders": {
"Content-Type": "application/x-www-form-urlencoded"
},
"authorizationResponseTokenAttr": "access_token",
"createdAt": "2024-04-11T14:12:33.741194-03:00",
"updatedAt": "2024-04-11T14:12:33.741194-03:00"
}