Toast
API Reference

Uploads

File upload endpoints for images and other media.

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://example.com/api/uploads" \  -F file="string"
{  "url": "http://example.com",  "key": "string",  "size": 0}
{  "error": "string"}
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://example.com/api/uploads/config"
{  "maxUploadSize": 0,  "allowedTypes": [    "string"  ]}
{  "error": "string"}