WatermarkRemover

Documentation

API Reference

Base URL: http://localhost:8080/api/v1

Authentication

All endpoints require an API key. Generate one from the API Keys page. Include it in every request:

X-API-Key: wmr_your_key_here

Remove Watermark

The core endpoint. Send an image + mask in one request, get the clean result back instantly as base64.

POST/api/v1/images/remove

One-shot watermark removal. Provide an image (URL or base64) and a mask (base64 or template ID). Returns the processed image as base64 PNG. Costs 1 credit.

Parameters

image_urlstring (optional) - public URL to fetch the image from
image_base64string (optional) - base64-encoded image data
mask_datastring (optional) - base64 PNG mask, white = area to remove, black = keep
template_iduuid (optional) - use a saved template instead of mask_data
expand_maskboolean (default: true) - auto-dilate mask edges for cleaner results

Response

json
{
  "result_base64": "iVBORw0KGgo... (base64 PNG)",
  "width": 800,
  "height": 600,
  "credits_charged": 1,
  "duration_ms": 42
}

Example

curl
curl -X POST http://localhost:8080/api/v1/images/remove \
  -H "X-API-Key: wmr_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://example.com/watermarked.jpg",
    "mask_data": "data:image/png;base64,iVBOR..."
  }'

Templates

Save a mask as a reusable template. When applied to new images, the mask auto-resizes to match different dimensions.

GET/api/v1/templates

List all your saved templates, sorted by most used.

Response

json
{
  "templates": [{
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Shutterstock Logo",
    "mode": "basic",
    "expand_mask": true,
    "source_width": 800,
    "source_height": 600,
    "use_count": 42,
    "created_at": "2026-04-05T10:30:00Z"
  }]
}

Example

curl
curl http://localhost:8080/api/v1/templates \
  -H "X-API-Key: wmr_your_key"
POST/api/v1/templates

Save a new template from a mask. Include the original image dimensions so the mask can be auto-resized for different images later.

Parameters

namestring (required) - label for the template
mask_datastring (required) - base64 PNG mask
source_widthint (required) - width of the image the mask was drawn on
source_heightint (required) - height of the image the mask was drawn on
modestring (default: "basic")
expand_maskboolean (default: true)

Response

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Shutterstock Logo",
  ...
}

Example

curl
curl -X POST http://localhost:8080/api/v1/templates \
  -H "X-API-Key: wmr_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Shutterstock Logo",
    "mask_data": "data:image/png;base64,iVBOR...",
    "source_width": 800,
    "source_height": 600
  }'
POST/api/v1/images/remove (with template)

Apply a saved template instead of providing a raw mask. The mask auto-resizes if the target image has different dimensions.

Response

json
{
  "result_base64": "iVBOR...",
  "width": 1200,
  "height": 900,
  "credits_charged": 1,
  "duration_ms": 38
}

Example

curl
curl -X POST http://localhost:8080/api/v1/images/remove \
  -H "X-API-Key: wmr_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://example.com/new-photo.jpg",
    "template_id": "550e8400-e29b-41d4-a716-446655440000"
  }'
DELETE/api/v1/templates/{id}

Delete a template and its stored mask.

Response

json
204 No Content

Example

curl
curl -X DELETE http://localhost:8080/api/v1/templates/TEMPLATE_UUID \
  -H "X-API-Key: wmr_your_key"

Credits

Check your remaining balance and view transaction history.

GET/api/v1/credits

Returns current credit balance and last 50 transactions (debits, refunds, bonuses).

Response

json
{
  "balance": 9,
  "transactions": [
    {
      "id": "uuid",
      "amount": -1,
      "type": "processing",
      "description": "Basic fill - photo.jpg",
      "created_at": "2026-04-05T10:30:00Z"
    },
    {
      "amount": 10,
      "type": "signup_bonus",
      "description": "Welcome bonus credits"
    }
  ]
}

Example

curl
curl http://localhost:8080/api/v1/credits \
  -H "X-API-Key: wmr_your_key"

Jobs

Retrieve processing history and job results.

GET/api/v1/jobs

List your processing jobs with pagination. Each job includes status, mode, credits charged, and result URL.

Parameters

pageint (default: 1)
per_pageint (default: 20, max: 100)

Response

json
{
  "jobs": [{
    "job_id": "uuid",
    "status": "completed",
    "progress": 100,
    "mode": "basic",
    "credits_charged": 1,
    "result_url": "/storage/processed/...",
    "created_at": "2026-04-05T10:30:00Z"
  }],
  "total": 42,
  "page": 1,
  "per_page": 20
}

Example

curl
curl "http://localhost:8080/api/v1/jobs?page=1&per_page=10" \
  -H "X-API-Key: wmr_your_key"
GET/api/v1/jobs/{id}

Get a single job by ID.

Response

json
{
  "job_id": "uuid",
  "status": "completed",
  "progress": 100,
  "mode": "basic",
  "credits_charged": 1,
  "result_url": "/storage/processed/..."
}

Example

curl
curl http://localhost:8080/api/v1/jobs/JOB_UUID \
  -H "X-API-Key: wmr_your_key"