Batch Processing
Batch Processing
The VEC.digital API allows you to create and issue certificates in batches, which is an efficient way to generate multiple certificates at once. This guide explains how to work with batches through the API.
Batch Lifecycle
A certificate batch in VEC.digital goes through several states:
- Pending: The batch has been created but processing hasn’t started
- Processing: The certificates are being generated
- Waiting for Approval: The batch requires signatures or approvals
- Completed: All certificates in the batch have been successfully created
- Partially Completed: Some certificates were created successfully, but others failed
- Failed: The batch processing failed
Creating a Batch
To create a batch, you need:
- A template ID (from an existing certificate template)
- A CSV file containing recipient information
- Optional signatories if your certificates require signatures
CSV File Format
Your CSV file must include at least these headers:
RecipientsEmail: Email address of the certificate recipientRecipientsName: Full name of the certificate recipient
You can also include additional columns for custom data to be included in the certificates.
Example CSV:
RecipientsEmail,RecipientsName,CourseTitle,CompletionDatejohn@example.com,John Smith,Advanced Web Development,2025-02-15mary@example.com,Mary Johnson,Advanced Web Development,2025-02-15API Request
Create a batch using a POST request to /business/batches:
curl -X POST \ 'https://api.vec.digital/business/batches' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -F 'name=Web Development Graduates 2025' \ -F 'template_id=9e3b101f-c264-4f97-945f-20dfa7163768' \ -F 'csv_file=@/path/to/recipients.csv'If your certificates require signatures, you can specify signatories:
curl -X POST \ 'https://api.vec.digital/business/batches' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -F 'name=Web Development Graduates 2025' \ -F 'template_id=9e3b101f-c264-4f97-945f-20dfa7163768' \ -F 'csv_file=@/path/to/recipients.csv' \ -F 'signatories[0][institution_user_id]=3' \ -F 'signatories[0][signatory_index]=1' \ -F 'signatories[1][institution_user_id]=17' \ -F 'signatories[1][signatory_index]=2'Monitoring Batch Status
After creating a batch, you can monitor its status using the batch status endpoint:
curl -X GET \ 'https://api.vec.digital/business/batches/9e7860e3-7c0a-401f-98f6-b98e316934f4/status' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_TOKEN'The response will include:
- Current batch status
- Total number of certificates
- Number of processed certificates
- Number of failed certificates
- Progress percentage
Example response:
{ "status": "processing", "total_certificates": 50, "processed_certificates": 25, "failed_certificates": 0, "progress": 50.0}Retrieving Batch Details
To get detailed information about a batch, including its associated template:
curl -X GET \ 'https://api.vec.digital/business/batches/9e7860e3-7c0a-401f-98f6-b98e316934f4' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_TOKEN'Listing Certificates in a Batch
To view all certificates created from a specific batch:
curl -X GET \ 'https://api.vec.digital/business/certificates?batch_id=9e7860e3-7c0a-401f-98f6-b98e316934f4' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_TOKEN'Common Issues and Troubleshooting
Batch Creation Failures
If batch creation fails, check:
- CSV Format: Ensure your CSV has the required headers and is properly formatted
- Template ID: Verify the template ID exists and is accessible to your institution
- Balance: Confirm you have sufficient certificate credits in your account
Signature Requirements
If your certificates are in the “Waiting for Approval” status:
- Signatories must log in to the VEC.digital platform
- They should navigate to their pending signatures
- They can approve or reject the certificates
Failed Certificates
If some certificates fail in a batch:
- Check the CSV data for any errors or missing information
- Verify that all recipients have valid email addresses
- Consider recreating the batch with corrected data
Best Practices
- Name batches descriptively: Use naming conventions that help you identify batches easily
- Keep CSVs manageable: Limit batches to a reasonable size (we recommend up to 1000 certificates per batch)
- Test small batches first: Before uploading large batches, test with a small number of recipients
- Monitor status: Regularly check batch status for long-running batches
- Include custom data: Leverage the CSV to include custom data for more personalized certificates