Fix: face position and crop
Align the face to the head size, eye line, and output size in the selected spec code.
Document-photo compliance · API
The job is document-photo compliance, not a white-background cutout. Apply the rules for a passport, visa, or ID spec, check the portrait, diagnose what failed, and return a file closer to submission-ready.
Read the API DocsSpec codes such as us-passport, uk-passport, and china-visa are the rules the API checks against.
POST /v2/makeIdPhoto
Example output
01 / Compliance path
A white background is one rule inside a spec. The API checks the portrait, reports what failed, and applies the fixes that move the file closer to submission-ready.
Align the face to the head size, eye line, and output size in the selected spec code.
Replace the backdrop with the color that spec calls for, including white where the rules require it. Edges around hair and clothing stay intact.
Return rejection reasons when the compliance check finds a turned head, uneven light, poor sharpness, eyeglasses, or a non-neutral expression.
Receive the checked image in the API response, from a temporary URL, or as a print layout. The reviewing authority still decides acceptance.
Need a rule set that is not listed? We can add a custom spec code for your compliance check.
Talk to us about a custom specification02 / Sample checks
These samples show a compliance check against a US passport photo, a UK passport photo, and a China visa photo. Switch the spec to see the crop those rules target.
us-passportBuild this compliance check into your product.Call it with a spec code. Primary step is an API key.
Checking one photo yourself? Try one photo.
Built for a fast integration
Send a portrait and a spec code. The response returns a file closer to submission-ready, plus any rejection reasons the check found.
Authentication, parameters, issue codes, and response schemas are in the API documentation. A clear issues list reduces rejection risk. It is not a decision by a reviewing authority.
POST /v2/makeIdPhoto
{
"apiKey": "••••••",
"apiSecret": "••••••",
"imageBase64": "...",
"specCode": "us-passport",
"outputFormat": "IMAGE_BASE64"
}
"issues": ["ISSUE_EXPRESSION_NOT_NEUTRAL"]03 / Rules
us-passport, uk-passport, and china-visa are rule sets for the compliance check: size, crop, background, and head position. Pass one as specCode on POST /v2/makeIdPhoto.
The same field covers a US passport photo, a UK passport photo, a China visa photo, and a Schengen visa photo, plus passport and visa photos for Canada, Australia, Japan, India, Singapore, New Zealand, Brazil, and South Korea — more than 150 specs in all.
Query specification data through the API so your product can show the rules for each document type.
View all photo specificationsRules the check runs against
us-passportuk-passportchina-visaThese specCode values are the rules for the three sample formats. The same field accepts the other passport, visa, and ID specifications.
04 / For developers
Pre-check a portrait before someone submits it. The same call covers a passport photo compliance check, the rejection reasons when something fails, and a KYC or onboarding pre-check.
Check
Call POST /v2/makeIdPhoto with a spec code. us-passport, uk-passport, and china-visa are the rules that check runs against — size, crop, background, and head position.
Diagnose
When something fails, the response issues list is what failed: head pose, lighting, sharpness, eyeglasses, expression, and related checks. Show those reasons so the person can correct the photo and reduce rejection risk.
Pre-check
Run the same compliance check before an identity, visa, or employee-photo step. Surface what failed while the person is still in the flow, before an application is submitted.
05 / Use cases
Use one compliance check across photo products, travel flows, studios, and identity onboarding. Adapt what you show. The rules, the issues, and the file stay the same.
Ship a compliance check with direct processing or a watermarked preview. Return the file and the rejection reasons together.
Pre-check the portrait and show what failed before the customer reaches submission.
Apply the spec rules at the counter: crop, background, a printable sheet, and the issues still worth a retake.
Pre-check an identity or employee photo during onboarding, before it is attached to an application or badge.
Privacy-conscious by design
Identity photos are sensitive. IDPhoto.ai supports workflows designed to reduce unnecessary image retention and give businesses greater control over delivery.
Read our Data Privacy policyReceive the generated image as Base64 data without storing the photo on our service.
Use temporary AWS S3 delivery, with documented retention ranging from 2 hours to 14 days.
Use US or EU API endpoints, with other regional deployment options available on request.
Data is encrypted during transmission. Our documented practices address GDPR and CCPA requirements.
More from IDPhoto.ai
Use focused APIs and services alongside the document-photo compliance check.
Process large groups of portraits for organizations, events, schools, or employee directories.
Explore batch generation →Generate UK passport photos and supported digital photo-code workflows through an API.
Explore UK photo codes →Use background removal independently when you do not need the complete ID photo workflow.
Explore background removal →Improve image clarity and visual quality before using photos in professional workflows.
Explore photo enhancement →Generate unique, customized AI or styled portraits for team pages, events, and profile photos.
Explore AI avatars →Streamline employee and corporate photo badges with consistent, compliant portraits via API or software.
Explore badge photos →Confirm a real person is present with live biometric checks for secure identity verification.
Explore biometric verification →Detect faces and analyze pose, expression, and attributes to check portrait quality automatically.
Explore face analysis →Print compliant passport photos and mail them directly to your customers through one API.
Explore print & mailing →Verify whether a photo matches the person on an ID document with precision and accuracy.
Explore photo match →Frequently asked questions
Still have a question or a custom requirement?
Contact support@idphoto.aiIDPhoto.ai checks portraits against more than 150 spec codes, including passport, visa, ID, driver's license, and application-photo rules from countries around the world. us-passport, uk-passport, and china-visa are three of those rule sets. You can query the available specification codes through the API.
The response includes the processed file when one can be produced, plus an issues list of rejection reasons — what failed, such as head pose, lighting, sharpness, eyeglasses, or expression. Use those codes to tell the person what to correct. The list is a pre-check. The reviewing authority still decides acceptance.
Yes. If the format you need is not currently available, contact us with the required dimensions, crop, background, and validation rules. We can review the specification for your use case.
Create or access your account in the IDPhoto.ai Dashboard. Your API credentials and account usage are managed separately from this website.
Yes. Create an account in the Dashboard to check the currently available trial access and account quota.
You can request Base64 output for a workflow that stores no images on our service. URL-based output uses temporary AWS S3 storage, with documented retention ranging from 2 hours to 14 days.
For the best result, provide a clear, front-facing portrait with the face and upper body visible. Avoid strong shadows, blur, extreme head angles, or obstructions around the face.
No. The compliance check applies the selected spec and reports detectable issues so you can reduce rejection risk. Final acceptance is determined by the relevant government agency, application platform, or reviewing authority.
US and EU API endpoints are currently documented. Other regional deployment options may be available for enterprise requirements.
Pricing depends on usage volume and workflow requirements. Start with a trial account in the Dashboard or contact us for volume pricing and custom deployment needs.
Start building
Create your API credentials in the Dashboard, then call the compliance check with a spec code such as us-passport.