PostMantis
API ReferenceUploads

Request an upload URL

Starts a two-phase upload. Returns reserved artifact id and presigned PUT URL. Caller uploads bytes directly to storage, then calls `POST /uploads/complete` with artifact id. Max file size is 150 MB.

POST
/api/v1/uploads

Starts a two-phase upload. Returns reserved artifact id and presigned PUT URL. Caller uploads bytes directly to storage, then calls POST /uploads/complete with artifact id. Max file size is 150 MB.

Authorization

BearerAuth
AuthorizationBearer <token>

PostMantis API key from the dashboard. Include as Authorization: Bearer <key>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

fileName*string
Length1 <= length <= 255
mimeType*string
Length1 <= length <= 255
fileSize*integer
Range0 < value <= 157286400

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://loading/api/v1/uploads" \  -H "Content-Type: application/json" \  -d '{    "fileName": "launch-video.mp4",    "mimeType": "video/mp4",    "fileSize": 12345678  }'
{  "data": {    "artifactId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",    "uploadUrl": "https://storage.example.com/...",    "requiredHeaders": {      "content-type": "video/mp4"    }  }}
{  "type": "https://postmantis.com/problems/invalid-request",  "title": "Invalid request",  "status": 400,  "detail": "The request payload failed validation.",  "code": "invalidRequest"}
{  "type": "https://postmantis.com/problems/unauthorized",  "title": "Unauthorized",  "status": 401,  "detail": "Authentication required.",  "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"}
{  "type": "https://postmantis.com/problems/unsupported-media-type",  "title": "Unsupported media type",  "status": 415,  "detail": "Unsupported content type. Use application/json or multipart/form-data.",  "code": "unsupportedMediaType"}
{  "type": "https://postmantis.com/problems/rate-limited",  "title": "Too many requests",  "status": 429,  "detail": "Too many requests.",  "code": "rateLimited"}