Host an image for use in emails
Host an image for use in emails and answer its hosted URL. Send it as multipart/form-data with the file in the image field, or as application/json for a caller that cannot send multipart: either { url } (a public http(s) address Sendly fetches) or { base64, filename, contentType }.
Only JPEG, PNG, GIF and WebP are accepted, up to 10 MB. The file's own bytes are checked against its declared type, so a mislabelled file is refused with 400 VALIDATION_ERROR, as is a call with no body, a body that is neither multipart nor valid JSON, or no image part. A larger file answers 413 PAYLOAD_TOO_LARGE. A JSON body that fits neither shape, or a url that cannot be fetched (private address, unreachable, or a non-2xx answer), answers 422 VALIDATION_ERROR.
Requires the templates:write scope — Create, edit, and delete your email templates.
AuthorizationBearer <API Key>API key authentication. Use a sk_* (FULL) or pk_* (SENDING_ONLY) key as the bearer token. Public keys (pk_*) are restricted to the email-send endpoints and the self-serve list subscribe/unsubscribe pair; every other endpoint — event tracking included — answers 403 for them. In scope terms (used by /api/v1/* operations): FULL keys hold every scope; SENDING_ONLY keys hold only emails:send.
- body
image*fileThe image file: JPEG, PNG, GIF or WebP.
binaryOK
application/json- response
url*stringWhere the image is hosted; use it in an email's HTML.
key*stringfilename*stringcontentType*stringsize*integercurl -X POST 'https://api.sendly.now/api/uploads/image' \ -H 'Content-Type: application/json' \ -d '{ "url": "http://example.com"}'{ "url": "string", "key": "string", "filename": "string", "contentType": "string", "size": 0}