Skip to content

Create upload

POST/admin/v1/stores/{store_id}/media/uploads
  • products:write
  • content:write
  • Idempotency-Key supported

Reserve a file and get the permission to upload it. Send the bytes to the files edge as upload says, then call POST /media/{media_id}/complete with the edge's receipt.

Path parameters

  • store_idstringrequired

    The store's ID, like store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.

Headers

  • Idempotency-Keystring

    Send the same key to retry safely: the first answer is replayed for 24 hours.

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • filenamestringrequired
  • content_typestringrequired

    JPEG, PNG, WebP, GIF, AVIF (≤ 20 MB), MP4, WebM (≤ 500 MB) or PDF (≤ 25 MB).

  • size_bytesintegerrequired
  • altstring · or null

Returns

201 Upload slot created.

Errors

  • 403forbiddenMissing permission.
  • 422validation_failedUnsupported type, size or name.