v4

OpenAPI 3.1.02026-07-3163216290.7 KB
Uploads

Create an upload

Request a pre-signed URL to upload an image asset. Upload the file with an HTTP PUT to the returned presignedUrl (sending the same Content-Type and Content-Length), then call /uploads/{emailAssetId}/complete to finalize the asset.

post/v1/uploads

Request body

contentTypestring required

The MIME type of the file to upload. Supported types are image/jpeg, image/png, image/gif and image/webp.

contentLengthinteger required

The size of the file in bytes. Must be a positive integer no greater than 4,000,000 bytes.

Example request

{
  "contentType": "image/png",
  "contentLength": 102400
}

Response

Pre-signed upload URL created.

emailAssetIdstring required

The ID of the created asset. Pass this as emailAssetId to POST /v1/uploads/{emailAssetId}/complete once the file has been uploaded.

presignedUrlstring required

The pre-signed URL to upload the file to with an HTTP PUT request. Send the same Content-Type and Content-Length used in the create request.

Example response

{
  "emailAssetId": "cla3s5s7e9t1i3d5f7g9h1j3",
  "presignedUrl": "https://loops-assets.s3.amazonaws.com/uploads/cla3s5s7e9t1i3d5f7g9h1j3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=..."
}