Photo Quality APIs
The Photo Quality API provides real-time feedback on the quality of inspection photos, ensuring that only valid and usable images are captured. It is designed specifically for customers using their own applications (rather than Inspektlabs’ web apps) and helps validate whether images are ready for inspection by checking factors such as clarity, framing, and lighting. With instant responses, typically delivered within seconds, users can quickly recapture photos if needed, improving both efficiency and overall inspection accuracy.
There are two Photo Quality APIs:
- Photo Quality API (V1 - synchronous and detailed output)
- Generates Q Score from images and provides synchronous response (file upload or URLs).
- Rejects videos, corrupted files, or invalid inputs.
- Photo Quality API (V2 – asynchronous and less detailed but accurate output)
- Generates Q Score from images and provides an asynchronous response (file upload or URLs).
- Rejects videos, corrupted files, or invalid inputs.
Photo Quality API (V1)
Processes uploaded images or image URLs, validates them, and generates a Q Score. For certain clients, image mappings are also returned.
Method | Base URL | Endpoint |
POST | https://q-score.inspektlabs.com | /api/q_score |
Authentication
- Requires JWT token in
Authorization: Bearer <token>header. - The Bearer token is obtained from the Authentication API.
Click the button below to download the field description and Postman collection for the API
Request Types
1. File Upload (Multipart Form Data)
Headers
Key | Value | Description |
Authorization | Bearer <jwt_token> | JWT token obtained from the Authentication API |
Content-Type | multipart/form-data | Required for file upload requests |
curl -X POST "https://q-score.inspektlabs.com/api/q_score" \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: multipart/form-data" \
-F "type=file" \
-F "session=abc123sessionid" \
-F "case_id=case001" \
-F "photo_tag=front_side" \
-F "files=@/path/to/image1.jpg" \
-F "files=@/path/to/image2.jpg"Parameters
Field | Type | Required | Description |
type | string | Yes | Must be "file" |
files | file[] | Yes | One or more image files |
session | string | Yes | Unique session/inspection ID |
case_id | string | Yes | Client unique ID |
photo_tag | string | Optional | Optional |
Note: Only image files are allowed. Videos (.mp4, .webm, .mov, .mkv) are rejected, and duplicate images in a batch are removed and flagged.
Click the button below to respond to the field description.
2. URL Input (JSON Body)
Headers
Key | Value | Description |
Authorization | Bearer <jwt_token> | JWT token obtained from the Authentication API |
Content-Type | application/json | Required for URL-based requests |
Payload
{
"session": "<session_id>",
"urls": ["<image_url_1>", "<image_url_2>"],
"case_id": "<optional_case_id>",
"photo_tag": "<optional_photo_tag>",
"auth": "<optional_header_token>"
}
Responses
{ "status": "success", "q_score": { ... }, "img_mapping": { "img1.jpg": "<sas_url>" }, "original_img_mapping": {} }Error message and status code
Scenario | Status Code | Response Example |
Video uploaded or URL points to video | 400 | video not allowed |
Corrupted/unsupported image(s) in batch | 400 | unsupported/corrupted image in batch |
Unsupported file type (not image/video) | 415 | unsupported file type only images or videos |
Invalid input (neither file nor URL) | 400 | only image file or url allowed |
Image URL request returned non-200 status | 400 | <error_from_remote_server> |
Missing urls field in JSON | 400 | { "status": "error |
Curl
curl -X POST "https://q-score.inspektlabs.com/api/q_score" \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-d '{
"session": "abc123sessionid",
"case_id": "case001",
"urls": [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"
]
}'Photo Quality API (V2)
Generates Q Score from images and provides an asynchronous response (file upload or URLs).
Method | Base URL | Endpoint |
POST | https://reports.inspektlabs.com | /api/q_score |
Authentication
- Requires JWT token in
Authorization: Bearer <token>header. - The Bearer token is obtained from the Authentication API.
Request Types
1. File Upload (Multipart Form Data)
Headers
Key | Value | Description |
Authorization | Bearer <jwt_token> | JWT token obtained from the Authentication API |
Content-Type | multipart/form-data | Required for file upload requests |
Click the button below to download the field description and Postman collection for the API
curl -X POST "https://reports.inspektlabs.com/api/q_score" \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: multipart/form-data" \
-F "type=file" \
-F "session=abc123sessionid" \
-F "case_id=case001" \
-F "files=@/path/to/image1.jpg" \
-F "files=@/path/to/image2.jpg"Parameters
Field | Type | Required | Description |
type | string | Yes | Must be "file" |
files | file[] | Yes | One or more image files |
session | string | Yes | Unique session/inspection ID |
case_id | string | Yes | Client unique Id |
Note: Only image files are allowed. Videos (.mp4, .webm, .mov, .mkv) are rejected, and duplicate images in a batch are removed and flagged.
2. URL Input (JSON Body)
Headers
Key | Value | Description |
Authorization | Bearer <jwt_token> | JWT token obtained from the Authentication API |
Content-Type | application/json | Required for URL-based requests |
Payload
{
"session": "<session_id>",
"urls": ["<image_url_1>", "<image_url_2>"],
"case_id": "<optional_case_id>",
"auth": "<optional_header_token>"
}
Responses
{ "status": "success", "q_score": { ... }, "img_mapping": { "img1.jpg": "<sas_url>" }, "original_img_mapping": {} }Error message and status code
Scenario | Status Code | Response Example |
Reused session ID | 400 | please generate new token and session |
Video uploaded or URL points to video | 400 | video not allowed |
Corrupted/unsupported image(s) in batch | 400 | unsupported/corrupted image in batch |
Unsupported file type (not image/video) | 415 | unsupported file type only images or videos |
Invalid input (neither file nor URL) | 400 | only image file or url allowed |
Image URL request returned non-200 status | 400 | <error_from_remote_server> |
Missing urls field in JSON | 400 | { "status": "error |
Curl
curl -X POST "https://reports.inspektlabs.com/api/q_score" \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-d '{
"session": "abc123sessionid",
"case_id": "case001",
"urls": [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"
]
}'←Feedback API
Incremental Damage API→
On this page
- Photo Quality APIs
- Photo Quality API (V1)
- Authentication
- Request Types
- 1. File Upload (Multipart Form Data)
- Parameters
- 2. URL Input (JSON Body)
- Payload
- Responses
- Error message and status code
- Curl
- Photo Quality API (V2)
- Authentication
- Request Types
- 1. File Upload (Multipart Form Data)
- Parameters
- 2. URL Input (JSON Body)
- Payload
- Responses
- Error message and status code
- Curl