---
title: "Call the attachImageToPost MCP tool"
method: POST
path: "/api/v1/actions/attachImageToPost"
tags: ["Actions"]
---

# Call the attachImageToPost MCP tool

`POST /api/v1/actions/attachImageToPost`

## Request

- Base URL: `https://app.reachium.io`
- URL: `https://app.reachium.io/api/v1/actions/attachImageToPost`
- Auth: HTTP bearer

Attach an image to a draft, planned, or approved post; refuses scheduled or published posts. If the post already has an image, this points it at the NEW one instead, it does not delete the previous upload (the old file becomes an orphaned storage object, not removed). Provide exactly one of image_url (fetched server-side, https only, up to 5 MB decoded), image_base64 (the base64 text is capped at 2 MB, which is roughly 1.5 MB of actual image once decoded because base64 inflates size by about 4/3, so use image_url for anything larger), or asset_name (a name from listAssets, loaded straight from storage with no bytes through the model). Every image is also checked against the 5 MB decoded cap. png/jpeg/webp/gif only, detected from the image bytes themselves, never from a Content-Type header.

Called through the Actions bridge: the response is that tool's own result, wrapped as `{ data: <tool result> }` under HTTP 200. Billing, daily-cap, and confirm-step outcomes are embedded INSIDE `data`, never remapped to an HTTP status (see the templated `/api/v1/actions/{toolName}` operation above for the full protocol, and `x-mcp-actions` for this tool's machine-readable scope/cap/confirm_behavior fields). Authentication, request-shape, and optional idempotency-protocol failures still use their documented non-200 statuses.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `post_id` string, uuid, required: The post to attach the image to.
  - `image_url` string, uri: Public https URL to fetch the image from. Pass exactly one of image_url, image_base64, or asset_name.
  - `image_base64` string: Base64-encoded image bytes, capped at 2 MB of base64 text which is roughly 1.5 MB decoded. Use image_url or asset_name for larger images. Pass exactly one of image_url, image_base64, or asset_name.
  - `asset_name` string: Name of a previously uploaded asset from listAssets (e.g. "starter-kit-cover-ab12cd34ef56aa00.png"). Loaded straight from storage - no bytes travel through the model. Pass exactly one of image_url, image_base64, or asset_name.

## Response `200`

The result of calling this tool.

- object
  - `data` unknown, required
  - `error` unknown, required

## Other responses

- `400`: The request body was not a JSON object (code invalid_request), or Idempotency-Key is malformed (code invalid_idempotency_key).
- `401`: Missing or invalid API key. Send `Authorization: Bearer rmcp_...` (code unauthorized).
- `403`: This tool is out of the key’s granted scope (code insufficient_scope).
- `409`: This Idempotency-Key has an unresolved in-flight or ambiguous result (code request_in_flight). Reconcile before using a new key.
- `422`: This Idempotency-Key was already used with a different request body (code idempotency_key_reuse).
- `429`: Rate limited: shared `mcp:ip:{ip}` (600/60s) or `mcp:key:{keyId}` (120/60s) bucket, the SAME buckets the MCP endpoint uses (code rate_limited).
- `500`: Unhandled server error (code internal_error).

---

[API](https://skmtc.dev/reachium/apis/reachium-api.md) · [All operations](https://skmtc.dev/reachium/apis/reachium-api/llms.txt) · [OpenAPI document](https://skmtc.dev/reachium/apis/reachium-api/revisions/11682826692b?raw)
