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
  1. body
file*file

File to upload

Formatbinary

Response Body

File uploaded

application/json
  1. response
url*string

Public URL of the uploaded file

Formaturi
key*string

Storage key

size*integer

File size in bytes

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

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

Upload configuration

application/json
  1. response
maxUploadSize*integer

Maximum upload size in bytes

allowedTypes*array<string>

Allowed MIME types

Example Request
curl -X GET 'https://example.com/api/uploads/config'
Example Response
{  "maxUploadSize": 0,  "allowedTypes": [    "string"  ]}