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));
"<string>"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));
"<string>"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
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));
Authorizations
APIKeyBearerAuth
API key for machine-to-machine authentication
Body
application/json
Response
ZIP archive of PNG code images.
The response is of type file.

