Every tool is one REST endpoint. You send a request with your API key and your file or settings, and you get JSON back. Examples use your own key in the variable DAVIX_H2I_API_KEY.
Your first call
curl -X POST "https://app.h2i.davixlabs.io/v1/images/resize" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'images=@photo.jpg' \
-F 'width=800' \
-F 'height=600' \
-F 'resizeMode=fit'
File tools take multipart/form-data. The answer holds a results list with one entry per file, including a download link for each result.
Find the endpoint and its options
- Every tool has a page in the API reference with all its fields, limits and errors. The tool id
images.resizeis the path/v1/images/resize. - The machine-readable description is at
GET /v1/contract, with small slices such as/v1/contract/endpoints/images.resize/fields. An OpenAPI document is available too: OpenAPI and the API contract. - Limits that depend on your plan are not fixed: read them from
GET /v1/limits(Find formats, limits and capabilities).
Choose how you get the result
Image tools take a response field: url (the default, a download link), binary (the file itself) or base64. With several results, output_bundle=zip returns one ZIP.
Work from an address instead of a file
Where a tool allows it, send source_url instead of a file. Only public http and https addresses are accepted, and your plan must include address input.
Test without running
Add validate_only=true to check your settings without doing the work.
Background jobs
Send async=true to get an answer straight away with a job id and a status address. Poll GET /v1/jobs/{id} until the status is completed (or failed); the finished job holds the result. You can cancel a job that is still queued with POST /v1/jobs/{id}/cancel. Jobs need a personal customer key.
Retry safely
Send an Idempotency-Key header (8 to 128 letters, digits and ._:-) so a retry of the same request is not run twice. Reusing a key for a different request answers idempotency_key_conflict.
Several files
Most tools take several files in one request and return one result each: a failing file does not stop the others. Merge-type tools combine all files into one result. The plan sets how many files per request you may send.
Name your app
Send an app value (or the X-Davix-App header) to label calls in your History.
If a call fails, see Error codes and rate limits. Prefer a library? See Use the Node SDK.
Checked against API contract 3.0.0.
