Appearance
Headshot API
Product overview: Headshot API.
Generate a professional portrait from a selfie with POST /v2/makeIdPhoto. Select a predefined photographic style with specCode; each portrait- code defines the setting, clothing, lighting and composition. You do not need to write a prompt or supply a seed.
Before you start
- Get an API key and API secret from the Dashboard.
- Contact support@idphoto.ai to enable portrait styles for your account.
- Send requests from your server. Keep credentials, source images and full image payloads out of browser code and logs. See Data Privacy.
Intended use
These are creative portraits for team pages, directories and professional profiles. They are not passport, visa or identity-document photos. For document-photo processing, use the Passport Photo API.
Style examples
All six examples below were generated from the same test selfie. The images show each style's visual direction, not a guaranteed result. Review generated portraits for recognizable features and visual artifacts before delivery.

One person, face clearly visible, with room around the head and shoulders. Select any image to open the full-size WebP in a new tab.

Modern Executive
portrait-executive-grayBright, very light neutral-gray studio backdrop; a simple light blouse with a charcoal-gray blazer; soft directional studio light. A composed pose shows both shoulders and the lower chest.

Classic Corporate
portrait-corporate-blueLight blue-gray studio backdrop; a navy or charcoal suit or tailored blazer; controlled, soft studio light. A formal chest-up portrait with direct eye contact.

Natural Office
portrait-office-naturalA contemporary office beside a window; smart casual clothing; indirect daylight. A wider environmental composition shows more of the torso and the setting.

Outdoor Professional
portrait-outdoor-professionalMuted green foliage in open shade; relaxed professional clothing; diffuse daylight. A chest-up portrait with both shoulders visible and a natural, approachable presence.

LinkedIn Clean
portrait-linkedin-cleanNear-white studio backdrop; a simple navy or charcoal blazer; bright, soft studio light. Tight head-and-shoulders framing keeps the hairstyle and chin within a circular profile crop.

LinkedIn Warm
portrait-linkedin-warmWarm ivory or pale oatmeal backdrop; relaxed knitwear or an open-collar shirt; gentle window-like light. Tight head-and-shoulders framing with room for a circular profile crop.
Style codes
Send the code exactly as written. To generate a second style from the same selfie, send another request with a different specCode.
| Style | specCode |
|---|---|
| Modern Executive | portrait-executive-gray |
| Classic Corporate | portrait-corporate-blue |
| Natural Office | portrait-office-natural |
| Outdoor Professional | portrait-outdoor-professional |
| LinkedIn Clean | portrait-linkedin-clean |
| LinkedIn Warm | portrait-linkedin-warm |
Presets are designed to retain recognizable features and natural texture while changing the scene and styling. Results vary between people and requests. The selected specification determines output dimensions; read widthPx and heightPx from the response.
Endpoint and authentication
Choose the API region configured for your account:
| Region | Base URL |
|---|---|
| United States | https://api-us.idphotoapp.com |
| European Union | https://api-eu.idphotoapp.com |
http
POST /v2/makeIdPhoto
Content-Type: application/jsonPass apiKey and apiSecret in the JSON request body, using the same authentication as the Passport Photo API.
Quickstart
Replace the placeholders with your credentials and a Base64-encoded selfie. This example requests the Modern Executive style and returns image data directly.
bash
curl --request POST \
--url https://api-us.idphotoapp.com/v2/makeIdPhoto \
--header 'Content-Type: application/json' \
--data '{
"apiKey": "your-api-key",
"apiSecret": "your-api-secret",
"imageBase64": "your-base64-encoded-selfie",
"specCode": "portrait-executive-gray",
"outputFormat": "IMAGE_BASE64"
}'Request fields
| Field | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Your API key, enabled for portrait styles. |
apiSecret | string | Yes | Your API secret. |
imageBase64 | string | Yes | Base64-encoded source image. A data URI prefix is optional. |
specCode | string | Yes | One of the six portrait- codes listed above. |
outputFormat | string | No | S3_URL (default) for an image URL, or IMAGE_BASE64 for image data. |
Style and composition are controlled by the preset. There are no custom prompt, seed or sample-count fields in this workflow. The endpoint generates one portrait per request.
Response and image handling
The response uses the shared Passport Photo API response format. These are the fields most useful for headshot integrations; other shared fields may also be present.
| Field | Description |
|---|---|
photoUuid | Identifier for the generated photo. |
specCode | The selected portrait style. |
idPhotoUrl | Generated image URL when outputFormat is S3_URL. |
idPhotoImageBase64 | Base64 image data when outputFormat is IMAGE_BASE64. |
widthPx, heightPx | Actual output dimensions in pixels. |
issues | Shared response field. Portrait generation does not run document-photo issue checks. |
- Confirm that the request succeeded and the chosen output field is present.
- Retrieve the image from
idPhotoUrl, or decodeidPhotoImageBase64as image bytes. - Use the returned dimensions when displaying or saving the image.
- Review the portrait for identity preservation, framing and generation artifacts before delivery.
Validation limits
The portrait workflow detects and crops the source face before applying the selected style. It does not run document-photo issue checks or a post-generation face match. An empty issues array is not a compliance, identity-match or quality approval.
Input photo guidance
- Use a sharp, well-lit photo with one person and a clearly visible face.
- Leave room around the head and shoulders. Office portraits use a wider composition than LinkedIn headshots.
- Avoid severe blur, heavy obstruction, extreme poses and faces that are too small in the frame.
- Show users the source and generated portrait together when reviewing the result.
Errors and integration guidance
| Situation | What to check |
|---|---|
403 access denied | Confirm that the credentials and account status are valid and portrait access is enabled. Contact support if the response says the specification is not permitted. |
400 unsupported portrait code | Use one of the exact six codes listed on this page. |
| Request fails or the expected image is missing | Handle the failure explicitly. Allow time for AI image processing and do not treat missing image data as success. |
For teams, use the same specCode across people to keep a shared visual direction; identical composition is not guaranteed. For a preview followed by final-image delivery, see Watermarked preview and keep the portrait code and account region consistent throughout the flow.
