Uploads

Initialize a multipart upload — returns image_id and R2 upload token

Creates a pending image record and a pre-authorized R2 multipart upload session. Callers upload directly to R2 using the returned upload token, then call /v1/images/complete-upload to queue processing. Requires authentication. Rate-limited per tier (daily quota and concurrent-pending cap) plus request pacing at 120/min per user (300/min for admin/creator); paced 429s return code RATE_LIMITED with a Retry-After header.

post/v1/images/init-upload

Request

  • Base URL: https://api.memestack.ai
  • URL: https://api.memestack.ai/v1/images/init-upload
  • Auth: HTTP bearer

Request body

mime_type'image/jpeg' | 'image/png' | 'image/webp' required

MIME type of the image to be uploaded.

sizeinteger required

File size in bytes (max 50 MB).

file_hashstring

SHA-256 hex digest of the file — used for pre-upload duplicate detection. Optional but strongly recommended.

mark_controversialboolean

Uploader self-label: true marks the image controversial from the moment it is created, so it is hidden from safe-mode browsing and blurred for signed-out viewers. Only the boolean true counts. An uploader can only raise a rating — there is no way to mark an image safe from here; that is an admin decision. Can also be set later with POST /v1/images/{id}/mark-controversial.

Response

Upload session created.

image_idstring uuid

Pending image record ID. Pass to /v1/images/complete-upload after the R2 upload finishes.

r2_keystring

R2 object key for the upload. Send the bytes with PUT /v1/images/upload, headers X-Image-ID and X-R2-Key.

expires_ininteger

Seconds until the upload session expires (900 = 15 minutes).

Changes

No recorded changes to this operation across all 1 revision of this API.