There are four honest ways to do more than one thing at a time in Davix H2I. Pick the one that matches your job.
1. Many files, one tool
Add several files to a tool and run it once. Most tools process each file on its own and return one result per file. One bad file never stops the others: each file gets its own status, and a summary tells you how many succeeded. A few tools combine all their files into a single result instead, for example Merge PDFs. How many files you can send at once is set by your plan.
2. Several steps on one image
The image pipeline runs an ordered chain of image operations in one call, so you can resize, add a watermark and convert the format in a single step.
3. Run in the background
Turn on Run in the background for big files or slow tools. Studio queues the job and you keep working. The result appears when it is ready, and the job is listed on the Dashboard under Jobs with its status: queued, running, done or failed. A queued job can be cancelled, but a running one cannot. Your plan sets how many jobs may be queued or running at once. Background jobs need a signed-in account or a personal API key.
4. Let the Assistant chain tools for you
When the job needs different tools in a row, describe it to the Assistant. It runs the tools step by step and gives you each result as a new version, leaving your original untouched.
From code
The same ideas apply to the API: send several files in one request, use async: true for background jobs, and call the next tool with the result of the last. See Call a tool over REST.
Try it in your language
Choose a tool and a language. The parameters are filled in for you and always match the current API.
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/pdfs/merge" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'files=@document.pdf' \
-F 'mode=concatenate' \
-F 'collateSize=1' \
-F 'response=url'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.pdfs.merge({
"files": 'document.pdf',
"mode": "concatenate",
"collateSize": 1,
"response": "url"
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->pdfs()->merge([
'files' => 'document.pdf',
'mode' => 'concatenate',
'collateSize' => 1,
'response' => 'url',
]);
echo $result->requestId;Checked against API contract 3.0.0 (uploads, jobs) and Studio.
