API Authentication

The snapnedit API authenticates every request with an API key, sent as a bearer token.

Creating a key

  1. Sign in and go to your dashboard.
  2. Under "API keys," give the key a name and create it.
  3. Copy the key immediately — it's shown in full exactly once (sk_...) and can't be retrieved again after you leave the page. If you lose it, revoke it and create a new one.

Authenticating a request

Send the key as a Bearer token in the Authorization header:

Authorization: Bearer sk_your_key_here

Every endpoint below requires this header unless noted otherwise.

Core endpoints

Upload an image

POST /uploads
{ "mime": "image/png", "bytes": 123456 }

Returns a presigned upload URL:

{ "assetId": "...", "upload": { "url": "...", "expiresAt": "..." } }

PUT the raw image bytes directly to upload.url (no Authorization header on that request — the URL itself is the credential), then confirm the upload:

POST /uploads/:assetId/confirm

Create a job

POST /jobs
{ "operation": "remove-background", "inputAssetId": "...", "params": {} }

Returns { "jobId": "...", "status": "..." }.

Poll job status

GET /jobs/:id

Returns one of:

{ "state": "queued" }
{ "state": "processing", "startedAt": "..." }
{ "state": "succeeded", "outputAssetId": "...", "download": { "url": "...", "expiresAt": "..." } }
{ "state": "failed", "errorCode": "...", "message": "..." }
{ "state": "canceled" }

Once state is "succeeded", download the result from download.url.

Operations

GET /operations returns the full catalog. The operation ids are:

remove-background, upscale, unblur, colorize, style-transfer, retouch, magic-eraser, generative-fill

Using the SDK instead

The @snapnedit/sdk package wraps the upload → create job → poll → download flow above into a single call — see Using the SDK.