Skip to main content
POST
/
media
Generate a presigned upload URL
curl --request POST \
  --url https://api.kelviq.com/api/v1/media/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fileName": "web-app-manifest-512x512.png",
  "fileType": "image/png"
}
'
{
  "url": "https://kelviq-uploads.s3.amazonaws.com/",
  "fields": {
    "Content-Type": "image/png",
    "key": "tmp/108713b0-1f81-42cf-a16c-c83b1d4d4148/web-app-manifest-512x512.png",
    "AWSAccessKeyId": "AKIA...",
    "policy": "eyJleHBpcmF0aW9uIjogIjIwMjYtMDUtMjFUMTI6MDA6MDBaIiwgImNvbmRpdGlvbnMiOiBbXX0=",
    "signature": "bWFkZS11cC1zaWduYXR1cmU="
  },
  "fileKey": "tmp/108713b0-1f81-42cf-a16c-c83b1d4d4148/web-app-manifest-512x512.png"
}

Documentation Index

Fetch the complete documentation index at: https://docs.kelviq.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

The Server API Key obtained from the kelviq application. Pass as a Bearer token in the Authorization header. Example: 'Authorization: Bearer YOUR_API_KEY'

Body

application/json

Request a presigned S3 POST policy for uploading a single file (max 5 GB). The returned fileKey is a temporary tmp/<uuid>/<fileName> path that can be passed to product/plan endpoints via imageKeys / fileKeys.

fileName
string
required

Name of the file being uploaded. Used as the suffix of the generated S3 object key.

Example:

"web-app-manifest-512x512.png"

fileType
string
required

MIME type of the file. Enforced by the presigned policy on upload.

Example:

"image/png"

Response

Presigned upload URL generated.

S3 presigned POST policy. Upload the file by sending a multipart/form-data POST to url with every key in fields as a form field, plus a final file field containing the binary. The returned fileKey is what you pass back to kelviq.

url
string<uri>

S3 endpoint to POST the upload to.

Example:

"https://kelviq-uploads.s3.amazonaws.com/"

fields
object

Form fields to include in the multipart/form-data POST (policy, signature, content-type, etc.). Send every field exactly as provided.

Example:
{
"Content-Type": "image/png",
"key": "tmp/108713b0-1f81-42cf-a16c-c83b1d4d4148/web-app-manifest-512x512.png",
"AWSAccessKeyId": "AKIA...",
"policy": "eyJleHBpcmF0aW9uIjogIjIwMjYtMDUtMjFUMTI6MDA6MDBaIiwgImNvbmRpdGlvbnMiOiBbXX0=",
"signature": "bWFkZS11cC1zaWduYXR1cmU="
}
fileKey
string

Temporary S3 key for the uploaded object. Pass this back to kelviq via imageKeys / fileKeys on the relevant catalog endpoint.

Example:

"tmp/108713b0-1f81-42cf-a16c-c83b1d4d4148/web-app-manifest-512x512.png"