Skip to content

API Overview

The Mend Media Processing Engine provides a REST API for asynchronous media processing tasks. All jobs are queued and processed by worker processes.

http://localhost:8080/api/v1

Include your API key in one of the following ways:

Terminal window
curl -H "X-API-Key: your_api_key_here" \
http://localhost:8080/api/v1/jobs/image/resize
Recommended

For detailed authentication setup, see the Authentication Guide.

All endpoints return JSON responses.

Success Response 202 Accepted

Section titled “Success Response ”
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending",
"message": "Job queued for processing"
}
{
"error": "Error message description"
}
graph LR
A[Submit Job] --> B[pending]
B --> C[processing]
C --> D[completed]
C --> E[failed]

pending

Job is queued and waiting for a worker

processing

Worker is actively processing the job

completed

Job finished successfully

failed

Job encountered an error

All job types require source and destination parameters:

ParameterTypeRequiredDescription
source_bucketstringS3 bucket containing the source file
source_keystringS3 key (path) to the source file
dest_bucketstringS3 bucket for the output file
dest_keystringS3 key (path) for the output file
ParameterTypeDescription
webhook_urlstringURL to receive job completion notifications
webhook_stylestringdefault or discord for webhook format
request_idstringCustom ID for request tracing

Subscribe to job completion events by providing a webhook_url in your request:

{
"source_bucket": "my-bucket",
"source_key": "image.jpg",
"dest_bucket": "my-bucket",
"dest_key": "resized.jpg",
"width": 800,
"height": 600,
"webhook_url": "https://your-domain.com/webhook",
"webhook_style": "default"
}

Learn more in the Webhooks Guide.

Subscribe to real-time job updates via SSE:

Terminal window
curl -N http://localhost:8080/api/v1/jobs/{job_id}/stream

Learn more in the SSE Guide.

CodeDescription
200Success (for GET requests)
202Accepted (job queued)
400Bad Request (invalid parameters)
401Unauthorized (missing/invalid API key)
404Not Found (job doesn’t exist)
500Internal Server Error
503Service Unavailable (dependencies unhealthy)

These endpoints do not require authentication:

Health Check

GET /health - Check service health

Metrics

GET /metrics - Prometheus metrics

API Docs

GET /swagger/* - Interactive API documentation

Example with JavaScript:

const response = await fetch('http://localhost:8080/api/v1/jobs/image/resize', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
},
body: JSON.stringify({
source_bucket: 'my-bucket',
source_key: 'image.jpg',
dest_bucket: 'my-bucket',
dest_key: 'resized.jpg',
width: 800,
height: 600
})
});
const data = await response.json();
console.log('Job ID:', data.job_id);