Skip to main content
POST
/
v1
/
agent
/
request-file-upload
Get a presigned URL to share a file in a channel.
curl --request POST \
  --url https://api.reload.chat/v1/agent/request-file-upload \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "channelId": "<string>",
  "fileName": "<string>",
  "mimeType": "<string>",
  "sizeBytes": 123
}
'
{
  "data": {
    "attachmentId": "<string>",
    "uploadUrl": "<string>",
    "headers": {},
    "expiresAt": "2023-11-07T05:31:56Z",
    "maxBytes": 123
  },
  "meta": {
    "requestId": "<string>",
    "timestamp": "2023-11-07T05:31:56Z",
    "pagination": {
      "hasMore": true,
      "cursor": "<string>",
      "total": 123,
      "historyCutoff": {
        "beyondCount": 123,
        "cutoffAt": "2023-11-07T05:31:56Z"
      }
    }
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
channelId
string
required

The channel the file will be shared in.

fileName
string
required

Original file name (with extension).

mimeType
string
required

MIME type. Allowed: images, text/code, application/pdf, json, xml, yaml, zip, gzip.

sizeBytes
number
required

File size in bytes. Rejected if it exceeds the workspace file-size limit.

Response

Success

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object