Quickstart to Imagen API
Use our quickstart to learn how the Imagen API works and to customize your flow.
You need to sign up for Imagen, set up your environment, choose an AI Profile, and a few other steps before using this quickstart. See Onboarding. If you want to use the Imagen API with little coding, here’s the SDK in Python.
Get a list of available AI Profiles
Get a list of AI Profiles and their keys.
GET /v1/profiles/Response example
The response includes the available AI Profiles. Each AI Profile has a
profile_keythat identifies it. You need thisprofile_keyto edit the photos in your project.curl 'https://api.imagen-ai.com/v1/profiles/' \ --header 'x-api-key: $IMAGEN_API_KEY'{ "data": { "profiles": [ { "profile_key": <profile key of the Personal AI Profile>, "profile_name": "wedding", "profile_type": "Personal", "image_type": "RAW" }, { "profile_key": 14715, "profile_name": "LOVE & LIGHT", "profile_type": "Talent", "image_type": "RAW" }, { "profile_key": 163322, "profile_name": "ELEGANT HOME", "profile_type": "Talent", "image_type": "RAW" } ] } }Cull your photos without the API
Cull your photos before uploading them for editing. Culling isn’t part of the Imagen API.
Create a project and get a project ID
We recommend creating a project for each shoot. A project organizes your photos with the AI Profile you chose for editing these photos.
POST /v1/projects/Response example
The response is the
project_uuidused to identify this project. Use thisproject_uuiduntil you export your photos to JPEG.{ "data": { "project_uuid": "<project_uuid>" } }Create temporary upload links to upload photos
You need a temporary link to upload each photo. In the request, in the
files_listparam, include the file names of the photos to upload. Use list format.POST /v1/projects/PROJECT_UUID/get_temporary_upload_linksRequest example
curl -X POST \ 'https://api.imagen-ai.com/v1/projects/<PROJECT_UUID>/get_temporary_upload_links' \ --header 'x-api-key: $IMAGEN_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "files_list": [ {"file_name": "922A4846.CR2"}, {"file_name": "922A4832.CR2"}, {"file_name": "922A4818.CR2"}, {"file_name": "922A4809.CR2"} ] }'Response example
The response includes a temporary link for each photo to Imagen’s S3 bucket on AWS. This link is the AWS presigned URL.
{ "data": { "files_list": [ { "file_name": "922A4846.raw", "upload_link": "<presigned URL for 922A4846.raw>" }, { "file_name": "922A4832.raw", "upload_link": "<presigned URL for 922A4832.raw>" }, { "file_name": "922A4818.raw", "upload_link": "<presigned URL for 922A4818.raw>" }, { "file_name": "922A4809.raw", "upload_link": "<presigned URL for 922A4809.raw>" } ] } }Upload each photo to its temporary upload link
Upload photos with a PUT request to Imagen’s S3 bucket on AWS. Use the temporary upload links from the response in the previous step.
Content-Type requirementsTesting in Postman: Disable
Content-Typein the headers. Do not sendContent-Typein the query params.In code: Either omit
Content-Typeentirely, or set it to an empty string (""). Both work — see the language tabs above for the idiomatic approach per language.# PUT directly to the presigned URL — no x-api-key needed # The -H 'Content-Type;' flag removes the Content-Type header curl -X PUT "<presigned_upload_link>" \ -H 'Content-Type;' \ --upload-file 922A4846.CR2Edit the photos in your project
Before sending your photos to edit, you need:
- The value of your
project_uuid - The value of your
profile_key. See the response from step 1 for yourprofile_key. - AI tools. See AI tool reference for Imagen API to choose the right tools for your project.
- (Optional) Callback URL. See Add a callback URL to get status messages.
POST /v1/projects/PROJECT_UUID/editContent-Type must be emptyThis endpoint requires an empty
Content-Typeheader. The Python SDK handles this automatically.curl -X POST \ 'https://api.imagen-ai.com/v1/projects/$PROJECT_UUID/edit' \ --header 'x-api-key: $IMAGEN_API_KEY' \ --header 'Content-Type;' \ --data '{ "profile_key": 163322, "hdr_merge": true, "photography_type": "REAL_ESTATE", "callback_url": "https://your.app/imagen/hook", "perspective_correction": true, "sky_replacement": true, "sky_replacement_template_id": 2 }'The response is a message that the project was edited successfully. If there is an error, email our customer success team.
{"project_uuid": "<the project UUID>", "status": "Failed/Completed/Pending", "action": "edit/export"}Add a callback URL to get status messages
The
callback_urlis a POST endpoint that Imagen can use to send you status messages. This param is optional. If you use it, you don’t need to check the edit status. This endpoint must be open to Imagen.Possible statuses sent in the request are:
Failed: Email the customer success team.Completed: Imagen API has finished editing the photos. Continue to one of the following: Get temporary download links to download edited photos or XMPs to tweak edits and export photos with your editing software, OR Export photos for delivery to create exported JPEGs for customers.
- The value of your
Check the edit status
If you didn’t add a callback URL to your edit request, get the current status of the editing process. Continue calling this endpoint with long polling until the status is
Completed.GET /v1/projects/PROJECT_UUID/edit/statusHere are the statuses in the response:
Status What it means PendingThe editing process hasn’t started. Once the editing starts, the status will change to In Progress.
In ProgressImagen API is in the process of editing the photos. FailedEmail the customer success team. CompletedImagen API has finished editing the photos. Continue to step 8 or step 10.
# Poll until status is "Completed" or "Failed" curl 'https://api.imagen-ai.com/v1/projects/$PROJECT_UUID/edit/status' \ --header 'x-api-key: $IMAGEN_API_KEY'Get temporary download links to download edited photos or XMPs
After receiving a
Completedstatus, get the temporary download links to download the edited photos.GET /v1/projects/PROJECT_UUID/edit/get_temporary_download_linksRequest example
curl 'https://api.imagen-ai.com/v1/projects/$PROJECT_UUID/edit/get_temporary_download_links' \ --header 'x-api-key: $IMAGEN_API_KEY'Response example
The response includes a temporary link for each photo to Imagen’s S3 bucket on AWS. This link is the AWS presigned URL.
{ "data": { "files_list": [ { "file_name": "922A4846.DNG", "download_link": "<presigned URL for 922A4846.DNG>" }, { "file_name": "922A4832.DNG", "download_link": "<presigned URL for 922A4832.DNG>" }, { "file_name": "922A4818.DNG", "download_link": "<presigned URL for 922A4818.DNG>" }, { "file_name": "922A4809.DNG", "download_link": "<presigned URL for 922A4809.DNG>" } ] } }Download edited photos locally
When Imagen returns the edited files, these are the respective formats:
File format before edit File format returned after edit RAW XMP
Note: When editing photos with HDR Merge, the returned format is always DNG, even though the file format before editing was RAW.
RAW + DNG DNG with embedded XMP DNG DNG with embedded XMP JPEG JPEG with embedded XMP Download photos from Imagen’s S3 bucket on AWS with the temporary download links from the response in the previous step. Use any method you like.
Review the edits in Adobe editing software. If you open the photos with the default photo viewer on your computer, you won’t see the edits.
Optional: Export final JPEGs for delivery
Imagen API exports all the photos in a project to JPEG format. This step is optional. Some photographers tweak the edits and export them with their editing software. After exporting the final JPEGs, you deliver them or upload them to a gallery.
1. Export the photos in the project
POST /v1/projects/PROJECT_UUID/exportContent-Type must be emptyThis endpoint requires an empty
Content-Typeheader. The Python SDK handles this automatically.curl -X POST \ 'https://api.imagen-ai.com/v1/projects/$PROJECT_UUID/export' \ --header 'x-api-key: $IMAGEN_API_KEY' \ --header 'Content-Type;'The response includes the
project_uuidand a message that the export was successful. If there is an error, email our customer success team.2. Check the export status
If you didn’t add a callback URL in your edit request, get the export status.
GET /v1/projects/PROJECT_UUID/export/statusPossible statuses are:
- In Progress: Imagen API is in the process of editing the photos.
- Failed: Email the customer success team.
- Completed: Imagen API has finished exporting the photos to JPEG.
# Poll until status is "Completed" or "Failed" curl 'https://api.imagen-ai.com/v1/projects/$PROJECT_UUID/export/status' \ --header 'x-api-key: $IMAGEN_API_KEY'3. Get temporary download links to download final JPEG photos
Get the temporary download links when the export status is returned as
Completed.GET /v1/projects/PROJECT_UUID/export/get_temporary_download_linksIn the request, include the exported photos to download in the
files_listparam. Use list format.curl 'https://api.imagen-ai.com/v1/projects/$PROJECT_UUID/export/get_temporary_download_links' \ --header 'x-api-key: $IMAGEN_API_KEY'Response example
The response includes a temporary link for each photo to Imagen’s S3 bucket on AWS. This link is the AWS presigned URL.
{ "data": { "files_list": [ { "file_name": "922A4846.JPG", "download_link": "<presigned URL for 922A4846.JPG>" }, { "file_name": "922A4832.JPG", "download_link": "<presigned URL for 922A4832.JPG>" }, { "file_name": "922A4818.JPG", "download_link": "<presigned URL for 922A4818.JPG>" }, { "file_name": "922A4809.JPG", "download_link": "<presigned URL for 922A4809.JPG>" } ] } }4. Download final JPEG photos locally
Download photos from Imagen’s S3 bucket on AWS with the temporary download links from the response in the previous step. Use any method you like.