Images
Ce contenu n’est pas encore disponible dans votre langue.
Upload images to AutoRetouch before creating workflow executions. Uploaded images are identified by their content hash (SHA256).
Upload Image
Section titled “Upload Image”Upload an image file to receive a content hash for use in workflow executions.
POST https://api.autoretouch.com/uploadQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
organization | string | Recommended | Organization ID to upload to |
Request Body
Section titled “Request Body”Multipart form data with:
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | Image file to upload |
filesize | integer | No | File size in bytes (recommended) |
Input Limitations
Section titled “Input Limitations”- Supported formats: JPEG, PNG, TIFF, WebP
- Maximum resolution: 10,000 x 10,000 pixels
- Images larger than 4,096 x 4,096 pixels will be scaled down
Request
Section titled “Request”curl -X POST "https://api.autoretouch.com/upload?organization={organizationId}" \ -H "Authorization: Bearer {accessToken}" \ -F "file=@image.jpg"import requests
with open("image.jpg", "rb") as f: response = requests.post( "https://api.autoretouch.com/upload", params={"organization": organization_id}, headers={"Authorization": f"Bearer {access_token}"}, files={"file": f} )
content_hash = response.textprint(f"Content hash: {content_hash}")Success Response (201 Created)
Section titled “Success Response (201 Created)”Returns the content hash as plain text:
d4d4a63a03c9543f4f21d474500a95d7bb5704c83c139ddc6e005eaba6d54b22Performance Tips
Section titled “Performance Tips”For high-volume processing:
- Upload images in parallel (concurrent requests)
- Separate upload from execution creation
- The upload endpoint may validate file content before returning, which can slow sequential uploads
Check Image Existence
Section titled “Check Image Existence”Check if an image with a specific content hash has already been uploaded.
HEAD https://api.autoretouch.com/uploadQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
contentHash | string | Yes | SHA256 hash of the image content |
organization | string | Recommended | Organization ID |
Request
Section titled “Request”curl -I "https://api.autoretouch.com/upload?contentHash={contentHash}&organization={organizationId}" \ -H "Authorization: Bearer {accessToken}"import requests
response = requests.head( "https://api.autoretouch.com/upload", params={ "contentHash": content_hash, "organization": organization_id }, headers={"Authorization": f"Bearer {access_token}"})
if response.status_code == 200: print("Image exists")elif response.status_code == 404: print("Image not found - needs upload")Response
Section titled “Response”| Status | Description |
|---|---|
200 OK | Image exists and is available |
404 Not Found | Image has not been uploaded or has been removed |
Use this endpoint to avoid re-uploading images you’ve already uploaded. This is especially useful when retrying failed executions or reprocessing images.