PostMantis
ApiUploads

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

Metadata for the file to upload. The returned artifactId is reserved but not usable until /uploads/complete succeeds.

TypeScript Definitions

Use the request body type in TypeScript.

fileName*string

Original file name including extension.

Length1 <= length <= 255
mimeType*string

IANA media type the upload will be stored as, e.g. image/png or video/mp4.

Length1 <= length <= 255
fileSize*integer

File size in bytes. Must match the byte count PUT to uploadUrl. Max 150 MB.

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://example.com/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"    }  }}