Constaia
Integrations

Make

Validate documents in Make with the HTTP module using multipart/form-data, route by verdict with a Router and receive Constaia events by webhook.

Cette page n'est pas encore traduite dans votre langue. Voici la version anglaise.

In Make (formerly Integromat) you call Constaia with the HTTP → Make a request module, split the result with a Router based on the verdict, and receive asynchronous events with Webhooks → Custom webhook. No dedicated connector is needed.

Prerequisites

  • A Make account with a scenario.
  • A test key ck_test_… from the dashboard. See Authentication.
  • A previous module that outputs the file (Google Drive Download a file, Gmail attachment, Dropbox, a form…). In Make, files are passed as file name + data.

Analyze a document

Add the HTTP module

Add HTTP → Make a request after the module that provides the file and fill in:

FieldValue
URLhttps://api.constaia.com/v1/analyze
MethodPOST
HeadersName Authorization, Value Bearer ck_test_…
Body typeMultipart/form-data
Parse responseYes

Define the form fields

Under Fields add two entries:

KeyField typeValue
fileFilemap File name and Data from the previous module
optionsTextthe options JSON
options
{
  "expect": "medical_certificate_sport",
  "checks": { "max_age_days": 365, "require_signature": true, "require_stamp": true },
  "language": "en",
  "metadata": { "source": "make" }
}

You can map values from previous modules inside the text, for example the holder's name in checks.holder.full_name. Make sure the result is still valid JSON (quotes included); otherwise the API responds 400 invalid_options. All options are in POST /v1/analyze.

Route with a Router

With Parse response set to Yes, Make turns the response into fields you can map: Data → verdict → status, Data → fields → document_number → value, and so on. Add a Router with three routes and a filter on each:

RouteFilter (Text operators: Equal to)What to do
Válidoverdict.status = validStore the extracted fields, approve
No válidoverdict.status = invalidTell the user with verdict.reasons[].message
Revisarverdict.status = reviewCreate a human review task

Each extracted field is an object with value, confidence, validated and source. The statuses are explained in Verdicts.

Handle errors and 202 responses

If Constaia returns a 4xx or 5xx, the HTTP module ends with an error. Add an error handler (right click → Add error handler) to log the response's error.code and error.request_id. The codes are in Errors.

If the analysis takes longer than 30 s (long PDFs), the response is a 202 with status: "queued" or "processing" and no verdict. Add a filter status = completed before the Router, or use "async": true and receive the result by webhook (below).

Alternative: JSON body

If you have a downloadable https:// URL of the file, change Body type to Raw, Content type to JSON (application/json) and use as Request content:

Request content
{
  "file_url": "https://files.example.com/receipts/123.pdf",
  "filename": "payment_receipt.pdf",
  "options": {
    "expect": "payment_receipt",
    "checks": { "expected_amount": 45, "expected_reference": "INSCRIPCION 123" }
  }
}

file_url must be https, with no private IPs, up to 20 MB and a 15 s download. filename is optional and replaces the name Constaia derives from the URL.

Test in test mode

With a ck_test_… key no credits are used and the response depends on the file name. In Make you can set the File name of the file field by hand, for example dni_valid.jpg, dni_expired.jpg or blurry.jpg, even if the content is another image (it must be a real JPEG, PNG, WEBP, HEIC or PDF). In JSON, use "filename": "dni_valid.jpg".

FileWith expect: "es_dni"
dni_valid.jpgVálido
dni_expired.jpgNo válido (not_expired, severity error)
blurry.jpgRevisar (low_quality, severity warning)

With those three names you exercise every Router route. More scenarios in Test mode.

Receive events by webhook

The Webhooks → Custom webhook module gives you a URL Constaia sends events to. Make offers no native way to verify the Standard Webhooks HMAC signature over the raw body, so the safe integration is to not trust the event content and read the resource again with your key.

Create the webhook and register it

Create a scenario that starts with Custom webhook, copy the URL and register it in the dashboard or through the API:

Terminal
curl https://api.constaia.com/v1/webhook-endpoints \
  -H "Authorization: Bearer $CONSTAIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://hook.eu1.make.com/…","events":["analysis.completed","analysis.failed"]}'

Send a test analysis with "async": true so Make detects the event structure (type, created_at, data). In the webhook's advanced options you can enable getting the request headers to read webhook-id.

Drop duplicates

Constaia retries each failed delivery for about 3 days with the same webhook-id. Store it in a Data store and use a filter to stop if it already exists. If you don't read the headers, use type + data.id as the key.

Read the analysis again

Add an HTTP → Make a request with:

FieldValue
URLhttps://api.constaia.com/v1/analyses/ + the webhook's data.id
MethodGET
HeadersAuthorization: Bearer ck_test_…
Parse responseYes

Before it, filter that data.id starts with an_. The API only returns analyses of your account, so a forged event can at most make you re-read one of your own analyses. Use this response, not the webhook's, to decide in the Router. For batch.completed, data.id starts with bat_ and the read is GET /v1/batches/{id}.

This pattern needs the analysis to still be stored: don't use keep_results: false on analyses you want to receive by webhook, or the re-read returns 404.

Security

  • Don't paste a ck_live_… key into scenarios you share or export as a blueprint: the header travels with the module. Restrict who can view and edit the scenario and, if your Make plan offers saved connections or keys for the HTTP module, store it there.
  • Use a test key while building the scenario and switch to the live key only when you activate it.
  • Make keeps each execution's data in the history. If you process identity documents, review the scenario's data retention. More in Storage and privacy.

Limits

  • 20 MB per file; PDFs up to 30 pages synchronously and up to 200 with async: true.
  • 2 requests per second per key on the free plan (10 on paid). If an iterator fires many requests in a row you may get 429 with Retry-After; add a pause (Sleep module) or use batches. See Rate limits.

Next steps

Sur cette page