Skip to Content
Open Retainer
Files

Create a file upload intent

POST
/v1/files/intents

Upload the bytes to the signed transfer URL, then finalize the file before referencing it. Requires the write scope.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A workspace API key.

Header Parameters

Idempotency-Key*string

Reuse the same key with the same request to retry.

Length1 <= length <= 200

Request Body

application/json
  1. body
name*string
Length1 <= length <= 200
mediaType*string
Match^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$
Lengthlength <= 150
bytes*integer
Range1 <= value <= 26214400
sha256*string
Match^[a-f0-9]{64}$
sourceItemId?string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Response Body

Successful response.

application/json
  1. response
id*string
Formatuuid
upload*
Example Request
curl -X POST 'https://retainer.tamloot.cc/v1/files/intents' \  -H 'Idempotency-Key: string' \  -H 'Authorization: Bearer YOUR_WORKSPACE_API_KEY' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "mediaType": "string",  "bytes": 1,  "sha256": "string"}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "upload": {    "url": "string",    "headers": {      "property1": "string",      "property2": "string"    },    "expiresAt": "2019-08-24T14:15:22Z"  }}