Create a presigned upload URL for a marketplace demo image asset

View as Markdown
Returns a presigned `PUT` URL for uploading an image asset into the marketplace demo's virtual folder in the publicly-accessible bucket. The URL is time-limited (default 2 hours) and may be reused until it expires; each successful `PUT` overwrites the object at the signed key. The URL is signed with the declared `size` as `Content-Length` and the declared `content_type` as `Content-Type`, so the client must upload exactly that many bytes (capped at 5000000 bytes) with a matching `Content-Type` header, otherwise the upload will be rejected. To intentionally overwrite an already-listed filename, request a new URL with `ignore_existing_image` set to `true` (or reuse an unexpired URL for that same key, size, and content type). Additionally, there is a 200 image per demo limit. The browser may show a limit of 100 images so a resized thumbnail can be stored too. See the boto3 docs for an example of uploading with `curl`: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-presigned-urls.html **Required scope:** `air:marketplace_demo_write` (roles: `air_demo_manager`, `air_org_admin`, `air_user`) **Additional permissions:** - Only members of the owning organization, Air admins, or SREs may perform this action on this marketplace demo. - Applies whether or not the demo is published.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

idstringRequiredformat: "uuid"
A UUID string identifying this marketplace demo.

Request

This endpoint expects an object.
namestringRequired1-255 characters

The filename of the image asset to upload, relative to the demo folder. Must not contain path separators or start with ..

sizeintegerRequired1-5000000

The size of the image asset in bytes. Signed into the presigned URL as Content-Length, so the client must upload exactly this many bytes. Capped at 5000000 bytes (5 MB).

content_typeenumRequired

The MIME type of the image asset. Signed into the presigned URL as Content-Type, so the client must upload with a matching header. Must be one of the following MIME types: image/gif, image/jpeg, image/png, image/svg+xml, image/webp, image/x-icon.

  • image/gif - image/gif
  • image/jpeg - image/jpeg
  • image/png - image/png
  • image/svg+xml - image/svg+xml
  • image/webp - image/webp
  • image/x-icon - image/x-icon
ignore_existing_imagebooleanOptionalDefaults to false

When true, skip the duplicate-name check and return a presigned URL that overwrites an existing image with the same name.

Response

urlstringRead-only

Time-limited presigned PUT URL for the image asset upload. Reusable until expiry within the signed key, Content-Length, and Content-Type constraints; each successful PUT overwrites the object at that key.

Errors

400
Bad Request Error
403
Forbidden Error
500
Internal Server Error