Charchy Senddocs

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
/images

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.

apiKey
headerAuthorizationBearer <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
  1. body
file*file

The image file.

Formatbinary

Response Body

Uploaded.

application/json
  1. response
id*string
url*string
Formaturi
content_type*string
Value in"image/png""image/jpeg""image/gif""image/webp"
size*integer

Bytes.

Example Request
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}