Skip to Content
Uploads

Prepare an upload

POST
/uploads

Reserves an upload and returns where to send the bytes. Pending uploads expire after 24 hours.

Authorization

headerAuthorizationBearer <token>

Authorization code with S256 PKCE. Discover issuer metadata at /.well-known/oauth-authorization-server/api/auth and resource metadata at /.well-known/oauth-protected-resource/api/v1. Request the /api/v1 resource explicitly. The same token endpoint also supports the advertised OAuth device grant.

Scope: documents:write

Request Body

application/json
  1. body
name*string
Length1 <= length
size*integer
Range1 <= value
lastModified?integer
Range1 <= value
author?string
language?string

Response Body

Transfer descriptor. PUT bytes to url using every returned header, then POST /documents.

application/json
  1. response
id*string
Formatuuid
url*string
headers*
expiresAt*number
Example Request
curl -X POST 'https://reader.example/api/v1/uploads' \  -H 'Content-Type: application/json' \  -d '{  "name": "paper.pdf",  "size": 482133}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "url": "string",  "headers": {    "property1": "string",    "property2": "string"  },  "expiresAt": 0}