Direct Upload API

tiny[stash] Direct Upload API allows you to upload files using various HTTP libraries for programming languages or HTTP clients such as curl.


For file uploads:

For text uploads:

The only difference between them is that the latter always sets content-type to text/plain, whereas the former keeps the header value passed when the file is uploaded.


app-id: Required. An arbitrary string.

content-length: Required. The size of a body in bytes. Maximum file size is 20 MiB.

content-type: Optional. The default value for file uploads is application/octet-stream. Ignored for text uploads.

accept: Optional. Set to application/json to get a JSON response (plain text will be used otherwise).


Raw file content or text. Compressed or chunked transfer encodings are not supported.


# Upload video (.mp4) file $ curl -H app-id:myapp -H content-type:video/mp4 --data-binary @/path/to/video.mp4 # Upload text from pipe, get JSON response $ echo 'This is my first text upload' | curl -H app-id:myapp -H accept:application/json --data-binary @-