Upload an image
Hosts an image on files.charchy.krd and returns its permanent public URL, for `<img src>` in your emails. PNG, JPEG, GIF or WebP (no SVG), up to 2 MB, up to 200 per workspace.
POST
Hosts an image on files.charchy.krd and returns its permanent public
URL, for <img src> in your emails. PNG, JPEG, GIF or WebP (no SVG),
up to 2 MB, up to 200 per workspace.
apiKeyheader
AuthorizationBearer <token>Authorization: Bearer chy_live_… (or chy_test_…). A live key may
be sending-only, and may be locked to one domain.
multipart/form-data- body
file*fileThe image file.
Format
binaryUploaded.
application/json- response
id*stringurl*stringFormat
uricontent_type*stringValue in
"image/png""image/jpeg""image/gif""image/webp"size*integerBytes.
import { readFile } from "node:fs/promises"import { CharchySend } from "@charchy/send"const send = new CharchySend() // reads CHARCHY_SEND_KEYconst { data, error } = await send.images.upload(await readFile("logo.png"), { filename: "logo.png" })Example Response
{ "id": "img_4t8w2k6m1q3n5p6r0s2t4v9x", "url": "https://files.charchy.krd/i/4t8w2k6m1q3n5p6r0s2t4v9x/logo.png", "content_type": "image/png", "size": 0}