curl -X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"550e8400-e29b-41d4-a716-446655440000",
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"
],
"type": "both",
"size": 512
}' \
"https://api.truthlocks.com/v1/attestations/codes/batch" \
--output verification-codes.zip
const zipBuffer = await client.attestations.getBatchCodes(
['550e8400-e29b-41d4-a716-446655440000', '6ba7b810-9dad-11d1-80b4-00c04fd430c8'],
{ type: 'both', size: 512 }
);
fs.writeFileSync('verification-codes.zip', Buffer.from(zipBuffer));
Attestations
Batch Generate Codes
POST
/
v1
/
attestations
/
codes
/
batch
curl -X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"550e8400-e29b-41d4-a716-446655440000",
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"
],
"type": "both",
"size": 512
}' \
"https://api.truthlocks.com/v1/attestations/codes/batch" \
--output verification-codes.zip
const zipBuffer = await client.attestations.getBatchCodes(
['550e8400-e29b-41d4-a716-446655440000', '6ba7b810-9dad-11d1-80b4-00c04fd430c8'],
{ type: 'both', size: 512 }
);
fs.writeFileSync('verification-codes.zip', Buffer.from(zipBuffer));
Generate QR codes and/or barcodes for multiple attestations at once. Returns a ZIP file containing all requested code images.
Use cases
- Bulk certificate printing with QR codes
- Generating labels for an entire product batch
- Exporting verification codes for offline distribution
Request body
string[]
required
Array of attestation UUIDs. Maximum 100 per request.
string
default:"qr"
Type of codes to generate. Options:
qr, barcode, bothinteger
default:"256"
Size for QR codes in pixels (128 to 1024). Barcodes use default 300x80.
Response
Returns a ZIP file (Content-Type: application/zip) containing PNG images named:
{attestation_id}-qr.pngfor QR codes{attestation_id}-barcode.pngfor barcodes
Rate limits
Batch requests are rate-limited to 10 requests per minute. Each request can contain up to 100 attestation IDs.curl -X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"550e8400-e29b-41d4-a716-446655440000",
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"
],
"type": "both",
"size": 512
}' \
"https://api.truthlocks.com/v1/attestations/codes/batch" \
--output verification-codes.zip
const zipBuffer = await client.attestations.getBatchCodes(
['550e8400-e29b-41d4-a716-446655440000', '6ba7b810-9dad-11d1-80b4-00c04fd430c8'],
{ type: 'both', size: 512 }
);
fs.writeFileSync('verification-codes.zip', Buffer.from(zipBuffer));

