Skip to content

Upload an image for a mailing

On this page
POST/v1/imagesupload_mailing_image
Riskwrite
AuthenticationAPI key or OAuth access token
Scopesmailings:write
Idempotencysupported: send an Idempotency-Key header to make retries safe
Dry runnot applicable
Success status201
Response typeapplication/json

What it does#

  • Use when: A mailing needs an image you hold as a file (a cover, a photo); send the bytes and use the returned url as the image src.
  • Do not use when: the image already has a public https address (use that address directly).
  • Side effects: Stores the image in your workspace's image storage.
  • Reversible: No.
  • Required scope: mailings:write.
  • Idempotency: supported (Idempotency-Key header).
  • Typical next step: use the url in an image or book section of create_mailing_draft.

Scopes#

  • mailings:write: Create, edit and delete draft mailings, and ask for a send to be approved.

Side effects#

  • Stores the image in your workspace's image storage

Request#

Path parameters#

None.

Query parameters#

None.

Body (application/octet-stream)#

The raw file bytes, up to 5120 KiB.

Response#

FieldTypeRequiredDescription
urlstringyesThe public address to use as an image src in a mailing. Stable and immutable.
keystringyes
content_typeone of "image/png", "image/jpeg", "image/webp"yesDetected from the file's bytes, never from the header you sent.
bytesinteger, min -9007199254740991, max 9007199254740991yes
widthinteger, min -9007199254740991, max 9007199254740991yes
heightinteger, min -9007199254740991, max 9007199254740991yes

Examples#

uploaded#

Request:

curl -X POST 'https://api.seemly.com/v1/images' \
  -H "Authorization: Bearer $SEEMLY_API_KEY" \
  -H "Content-Type: application/octet-stream" \
  --data-binary @file

Response: 201:

JSON
{
  "url": "https://seemly.com/email-img/ws_9f3k2m8a1b/0123456789abcdef0123456789abcdef.png",
  "key": "ws_9f3k2m8a1b/0123456789abcdef0123456789abcdef.png",
  "content_type": "image/png",
  "bytes": 20480,
  "width": 600,
  "height": 400
}

Errors#

Every error is an application/problem+json body with a code, a fix sentence and next_actions. See reading a problem response.

Typical next steps#

View this page as MarkdownReport a problem with this page

Type to search. Try a method and path, an operation name or an error code.