Public API/Posts/Upload post image
POST/api/upload

Upload post image

Upload a cover or inline content image for an existing post with an account API key.

Upload a cover (hero/listing) or content (inline markdown) image for an existing post using your account API key. Logo/favicon uploads remain dashboard-only.

Request

POST /api/upload Authorization: Bearer YOUR_ACCOUNT_API_KEY X-Blogizi-Project: your-project-slug Content-Type: multipart/form-data

Multipart fields

  • file — required (PNG, JPG, WebP, or SVG)
  • type — cover or content for API keys
  • projectId or projectSlug — optional when the account has exactly one project
  • postId or postSlug — required; post must already exist

Limits: cover max 2MB, content max 5MB. Recommended cover size: 1200×630 px.

Response

{ "data": { "url": "https://media.blogizi.com/content/…/….png", "markdown": "![](https://media.blogizi.com/content/…/….png)" } }

markdown is returned for type=content. For type=cover, the URL is saved on the post immediately.

Insert into a post

  1. POST /api/posts with status: "draft"
  2. POST /api/upload with type=content (or cover)
  3. For content: POST /api/posts with upsert: true and the markdown image in content

CLI: blogizi upload ./diagram.png --slug my-post --type content --alt "Diagram". MCP: upload_post_image.