roasOS
API referenceUploads

Create an upload

Direct mode returns a one-use write target: POST the exact bytes to put_url with put_headers, then poll GET /v1/uploads/{id} until status is ready. Import mode gives a public https source_url instead; the worker fetches, checks, and stores the object and returns it ready.

POST
/v1/uploads

Direct mode returns a one-use write target: POST the exact bytes to put_url with put_headers, then poll GET /v1/uploads/{id} until status is ready. Import mode gives a public https source_url instead; the worker fetches, checks, and stores the object and returns it ready.

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication. Use your API key as the bearer token: Authorization: Bearer roasos_sk_...

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/uploads" \  -H "Content-Type: application/json" \  -d '{    "kind": "image"  }'
{  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "kind": "image",    "status": "pending",    "content_type": "string",    "byte_length": 0,    "url": "http://example.com",    "put_url": "http://example.com",    "put_headers": {      "property1": "string",      "property2": "string"    },    "expires_at": "2019-08-24T14:15:22Z",    "limits": {      "max_bytes": 1,      "allowed_content_types": [        "string"      ]    }  }}