POST/api/v1/documents/{slug}/assets

Upload a page image

Uploads a PNG, JPEG, GIF or WebP image of up to 10 MB to a page, as multipart/form-data. Use the id it returns in the page as ![alt](asset:<id>). The image shows to exactly the page's readers.

Token optionalOr edit secret60 per minute per IPMCP: upload_page_image

Guide: Images in pages

Code samples and Try it

Path parameters

#
  • slugstringRequired

    The document's address: the part after markdrop.in/.

Headers

#
  • X-Edit-Secretstring

    The document's edit secret (sk_…), for a document published without an account. See Edit key.

Request body

#

multipart/form-data, required

  • filefileRequired

Responses

#
  • 201Created.
  • 422The request didn't validate. detail lists each problem, with where it is (loc) and why (msg).
  • 429Too many requests from your IP address. Wait the seconds in Retry-After.
Did this page help?