API reference
Assets
Images for templates. Uploading is two steps: create the asset to get a signed upload form, POST the file to it, then mark the asset complete. Files up to 5 MB: JPEG, PNG, GIF or WebP.
The Asset object
type Asset = {
id: string; url: string; filename: string;
content_type: string; size: number;
width: number | null; height: number | null;
created_at: string;
};curl https://api.mailpark.io/v1/assets \
-H "Authorization: Bearer $MAILPARK_API_KEY"Response · 200
{
"data": [
{
"id": "ast_4Fk9",
"url": "https://assets.mailpark.io/acc_demo/ast_4Fk9/hero.png",
"filename": "hero.png",
"content_type": "image/png",
"size": 182044,
"width": 1200,
"height": 600,
"created_at": "2026-10-22T10:02:11Z"
}
],
"next_cursor": null
}Start an upload
POST
/v1/assetsCreates the asset and returns a signed form. POST a multipart form to upload.url with every entry of upload.fields, then the file. The form expires in 10 minutes.
scope
templates:writeBody
filenamestringrequirede.g.
hero.png.content_typestringrequiredimage/jpeg,image/png,image/giforimage/webp.sizeintegerrequiredBytes, up to 5 MB.
widthintegerPixels.
heightintegerPixels.
curl -X POST https://api.mailpark.io/v1/assets \
-H "Authorization: Bearer $MAILPARK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filename": "hero.png",
"content_type": "image/png",
"size": 182044,
"width": 1200,
"height": 600
}'Response · 200
{
"asset": {
"id": "ast_4Fk9",
"url": "https://assets.mailpark.io/acc_demo/ast_4Fk9/hero.png",
"filename": "hero.png",
"content_type": "image/png",
"size": 182044,
"width": 1200,
"height": 600,
"created_at": "2026-10-22T10:02:11Z"
},
"upload": {
"url": "https://mailpark-assets.s3.amazonaws.com/",
"fields": {
"key": "acc_demo/ast_4Fk9/hero.png",
"Content-Type": "image/png",
"Policy": "eyJ…",
"X-Amz-Signature": "3f1c…"
}
}
}Finish an upload
POST
/v1/assets/{id}/completeCall after the file is uploaded. Returns the asset with its public url.
scope
templates:writePath parameters
idstringrequiredast_…
Errors
curl -X POST https://api.mailpark.io/v1/assets/ast_4Fk9/complete \
-H "Authorization: Bearer $MAILPARK_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Response · 200
{
"id": "ast_4Fk9",
"url": "https://assets.mailpark.io/acc_demo/ast_4Fk9/hero.png",
"filename": "hero.png",
"content_type": "image/png",
"size": 182044,
"width": 1200,
"height": 600,
"created_at": "2026-10-22T10:02:11Z"
}Remove an asset
DELETE
/v1/assets/{id}Hides the image from the library. The file stays, so emails already sent keep their images.
scope
templates:writePath parameters
idstringrequiredast_…
curl -X DELETE https://api.mailpark.io/v1/assets/ast_4Fk9 \
-H "Authorization: Bearer $MAILPARK_API_KEY"Response · 200
{
"removed": true
}