squidX logo

Media

Images for posts. Bytes wait in squidX storage and reach X at publish time, because X media ids expire after about a day and a scheduled post can wait for weeks.

Upload an image

POSTsquidx.io/api/v1/mediaposts:write

Multipart upload of one JPEG, PNG, WebP or GIF, 4MB max. Put the returned id in a segment's media list when creating or editing a post. Up to four images per segment, or one GIF alone.

Upload an image parameters
NameInTypeDescription
filerequiredform-datafileThe image. image/jpeg, image/png, image/webp or image/gif.
Request
curl -X POST https://squidx.io/api/v1/media \
  -H "Authorization: Bearer sqx_your_key" \
  -F "file=@./launch.png"
Response · 201
{
  "data": {
    "id": "3c1c9e5a-0d2b-4f6e-8a7c-1b2d3e4f5a6b/7d2e1f0a-9b8c-4d7e-a6f5-4e3d2c1b0a99.png",
    "path": "3c1c9e5a-0d2b-4f6e-8a7c-1b2d3e4f5a6b/7d2e1f0a-9b8c-4d7e-a6f5-4e3d2c1b0a99.png",
    "type": "photo"
  }
}
  • Attaching media needs a paid workspace, like everything that can end up on X.
  • Then: POST /posts with segments: [{ text: "...", media: [{ id: "<id>" }] }].