Skip to content

API reference

Create a media upload

media_create_upload — Get a short-lived signed upload URL for one image (JPG/PNG/WEBP ≤ 5 MB), GIF (≤ 15 MB) or video (MP4/MOV ≤ 50 MB).

media_create_upload · Changes an X-Buddy setting

Get a short-lived signed upload URL for one image (JPG/PNG/WEBP ≤ 5 MB), GIF (≤ 15 MB) or video (MP4/MOV ≤ 50 MB). PUT the file bytes to upload_url with the given content-type, then pass media_id in post_publish / post_schedule parts (up to 4 per part) or x_profile_update (purpose=profile) or dm_send media_ids (purpose=dm). Files are private to the workspace and removed some days after the post went out.

REST POST /api/public/v1/media/uploads
MCP tool media_create_upload
Permission needed posts.manage — Owner, Manager, Operator
Scope group x:publish
Group Posts
Shown up front in profiles Operate X accounts, Contacts & lists, Infrastructure

Input

Field Type Required Description
mime_type image/jpeg · image/png · image/webp · image/gif · video/mp4 · video/quicktime Yes The file's type.
size_bytes integer (1–52428800) Yes The file's size in bytes.
purpose post · profile · dm No profile = avatar / banner for x_profile_update (images only); dm = the attachment of dm_send.

Result

Returns the operation's result in the { data, meta } envelope.

Needs an idempotency key (Idempotency-Key, 8–128 characters). Retrying with the same key never repeats the action.

Example

Call over REST

curl -X POST "https://reach-link-craft.lovable.app/api/public/v1/media/uploads" \
  -H "Authorization: Bearer $XBUDDY_API_KEY" \
  -H "Idempotency-Key: 6f1c2a90-example-key" \
  -H "Content-Type: application/json" \
  -d '{"mime_type":"image/jpeg","size_bytes":1}'

Call over MCP

{
  "method": "tools/call",
  "params": {
    "name": "media_create_upload",
    "arguments": {
      "mime_type": "image/jpeg",
      "size_bytes": 1,
      "idempotency_key": "6f1c2a90-example-key"
    }
  }
}

Errors you may get

Back to all operations