Developers

Get a signed upload URL

POST
/uploads

A presigned URL for one file into the target: PUT the bytes to signedUrl with Content-Type set to mimeType and Content-Length to sizeBytes, within minutes. Then pass publicUrl, which is permanent, as a generation input or avatar. A file already at a public https URL needs no upload: pass that URL directly.

Authorization

headerAuthorizationBearer <token>

An API Key the User creates in account settings, sent as Authorization: Bearer <key>. It holds the Scopes chosen at creation.

Request Body

application/json
  1. body
fileName*string
Length1 <= length
mimeType*string
Length1 <= length
sizeBytes*integer
Range0 <= value <= 9007199254740991
target*||

Response Body

Success.

application/json
  1. response
key*string
signedUrl*string
Formaturi
publicUrl*string
Formaturi
Example request
curl -X POST 'https://ximagesplitter.com/api/v1/uploads' \
  -H 'Content-Type: application/json' \
  -d '{
  "fileName": "string",
  "mimeType": "string",
  "sizeBytes": 0,
  "target": {
    "kind": "profile-image"
  }
}'
Example response
{
  "key": "string",
  "signedUrl": "http://example.com",
  "publicUrl": "http://example.com"
}