PUT
/
v1
/
files
/
{id}
cURL
curl --request PUT \
  --url https://api.botpress.cloud/v1/files/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-bot-id: <api-key>' \
  --data '{
  "metadata": "<any>",
  "tags": {},
  "accessPolicies": [
    "integrations"
  ],
  "expiresAt": "2023-11-07T05:31:56Z"
}'
{
  "file": {
    "id": "<string>",
    "botId": "<string>",
    "key": "<string>",
    "url": "<string>",
    "size": 123,
    "contentType": "<string>",
    "tags": {},
    "metadata": {},
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "accessPolicies": [
      "integrations"
    ],
    "index": true,
    "status": "upload_pending",
    "failedStatusReason": "<string>",
    "expiresAt": "<string>",
    "owner": {
      "type": "bot",
      "id": "<string>",
      "name": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

x-bot-id
string
header
required

Your bot ID.

Path Parameters

id
string
required

File ID or Key

Body

application/json

File metadata to update.

metadata
any

Custom metadata for the file expressed as an object of key-value pairs. Omit to keep existing metadata intact. Any existing metadata keys not included will be preserved. New keys will be added. To delete a metadata key, set its value to null.

tags
object

The file tags to update as an object of key-value pairs with string (text) values. Omit to keep existing tags intact. Any existing tags not included will be preserved. New tags will be added. To delete a tag, set its value to null.

accessPolicies
enum<string>[]

New access policies to set for the file. Omit to keep existing policies intact.

expiresAt
string<date-time> | null

Expiry timestamp in ISO 8601 format with UTC timezone. After expiry, the File will be deleted. Must be in the future. Cannot be more than 90 days from now. The value up to minutes is considered. Seconds and milliseconds are ignored. Omit to keep the existing expiry intact. Set to null to remove the expiry.

Response

An object containing the updated file metadata.

file
object
required