PostMantis
API ReferenceUploads

Create a media upload session

Creates a presigned upload session for a media file.

POST
/api/uploads

Creates a presigned upload session for a media file.

Authorization

BearerAuth
AuthorizationBearer <token>

API key from the PostMantis dashboard.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

filename*string
Length1 <= length <= 255
content_type*string
Length1 <= length <= 255
size_bytes*integer
Range0 < value <= 1073741824

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/json

curl -X POST "https://postmantis.com/api/uploads" \  -H "Content-Type: application/json" \  -d '{    "filename": "launch-card.png",    "content_type": "image/png",    "size_bytes": 481233  }'
{  "data": {    "asset_id": "8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1",    "status": "pending",    "filename": "launch-card.png",    "content_type": "image/png",    "size_bytes": 481233,    "upload_url": "https://storage.postmantis.com/uploads/8f5f3f18-3cf7-4aa8-a0ea-6fd204d4c4f1",    "upload_method": "PUT",    "upload_headers": {      "Content-Type": "image/png"    },    "expires_at": "2026-03-29T10:00:00Z",    "url": null,    "created_at": "2026-03-29T09:30:00Z",    "completed_at": null  }}
{  "type": "https://postmantis.com/problems/invalid-request",  "title": "Invalid request",  "status": 400,  "detail": "The request payload failed validation.",  "code": "invalid_request"}
{  "type": "https://postmantis.com/problems/unauthorized",  "title": "Unauthorized",  "status": 401,  "detail": "Missing or invalid API key.",  "code": "unauthorized"}
{  "type": "https://postmantis.com/problems/forbidden",  "title": "Forbidden",  "status": 403,  "detail": "The authenticated API key is not allowed to perform this action.",  "code": "forbidden"}
{  "error": "Too Many Requests"}