Toast
API Reference

Uploads

File upload endpoints for images and other media.

Upload file

POST
/api/uploads

Uploads a file to the server storage via the configured storage driver.

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://loading/api/uploads" \  -F file="string"
{
  "url": "http://example.com",
  "key": "string",
  "size": 0
}
{
  "error": "string"
}

Get upload configuration

GET
/api/uploads/config

Returns the server-side upload limits and allowed file types for client-side validation before upload.

Response Body

application/json

application/json

curl -X GET "https://loading/api/uploads/config"
{
  "maxUploadSize": 0,
  "allowedTypes": [
    "string"
  ]
}
{
  "error": "string"
}