Screenshot Capture Utility
API Contract
REST
/api/v1/screenshots
7 endpoints
GET
/api/v1/screenshots/api/v1/screenshots
List previously captured screenshots (metadata only)
Public
Response Example
{
"data": [
{
"id": "screenshot_xyz789",
"mentor_id": "mentor_001",
"slide_index": 1,
"pixel_ratio": 3,
"width": 1080,
"height": 1920,
"file_size_bytes": 312000,
"captured_at": "2026-01-06T09:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 4
}
}
GET
/api/v1/screenshots/api/v1/screenshots/:id
Get metadata and base64 image data for a specific screenshot
Public
Response Example
{
"id": "screenshot_xyz789",
"mentor_id": "mentor_001",
"slide_index": 1,
"pixel_ratio": 3,
"width": 1080,
"height": 1920,
"file_size_bytes": 312000,
"captured_at": "2026-01-06T09:00:00Z",
"image_data_base64": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/png"
}
POST
/api/v1/screenshots/api/v1/screenshots
Capture a widget/slide as an image
Public
Request Example
{
"mentor_id": "mentor_001",
"slide_index": 1,
"pixel_ratio": 3,
"compress": true,
"compression_quality": 90
}
Response Example
{
"id": "screenshot_new001",
"mentor_id": "mentor_001",
"slide_index": 1,
"pixel_ratio": 3,
"width": 1080,
"height": 1920,
"file_size_bytes": 245678,
"captured_at": "2026-01-06T09:05:00Z",
"image_data_base64": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/png"
}
PUT
/api/v1/screenshots/api/v1/screenshots/:id
Re-process a screenshot (compress or upscale)
Public
Request Example
{
"compression_quality": 75,
"pixel_ratio": 2
}
Response Example
{
"id": "screenshot_xyz789",
"mentor_id": "mentor_001",
"slide_index": 1,
"pixel_ratio": 2,
"width": 720,
"height": 1280,
"file_size_bytes": 145000,
"captured_at": "2026-01-06T09:10:00Z",
"image_data_base64": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/png"
}
DELETE
/api/v1/screenshots/api/v1/screenshots/:id
Delete a captured screenshot
Public
Response Example
{
"deleted": true,
"id": "screenshot_xyz789"
}
POST
/api/v1/screenshots/api/v1/screenshots/validate
Validate an image meets minimum size requirements
Public
Request Example
{
"image_data_base64": "iVBORw0KGgoAAAANSUhEUgAA...",
"min_width": 720,
"min_height": 1280
}
Response Example
{
"valid": true,
"actual_width": 1080,
"actual_height": 1920,
"min_width": 720,
"min_height": 1280
}
POST
/api/v1/screenshots/api/v1/screenshots/compress
Compress an image to a target quality level
Public
Request Example
{
"image_data_base64": "iVBORw0KGgoAAAANSUhEUgAA...",
"quality": 75
}
Response Example
{
"image_data_base64": "iVBORw0KGgoAAAANSUhEUgAB...",
"original_size_bytes": 312000,
"compressed_size_bytes": 145000,
"compression_ratio": 0.465,
"quality": 75,
"mime_type": "image/jpeg"
}