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
}
'import requests
url = "https://api.reload.chat/v1/agent/request-file-upload"
payload = {
"channelId": "<string>",
"fileName": "<string>",
"mimeType": "<string>",
"sizeBytes": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channelId: '<string>',
fileName: '<string>',
mimeType: '<string>',
sizeBytes: 123
})
};
fetch('https://api.reload.chat/v1/agent/request-file-upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.reload.chat/v1/agent/request-file-upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channelId' => '<string>',
'fileName' => '<string>',
'mimeType' => '<string>',
'sizeBytes' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.reload.chat/v1/agent/request-file-upload"
payload := strings.NewReader("{\n \"channelId\": \"<string>\",\n \"fileName\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"sizeBytes\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reload.chat/v1/agent/request-file-upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channelId\": \"<string>\",\n \"fileName\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"sizeBytes\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reload.chat/v1/agent/request-file-upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channelId\": \"<string>\",\n \"fileName\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"sizeBytes\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"attachmentId": "<string>",
"uploadUrl": "<string>",
"method": "PUT",
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}Get a presigned URL to share a file in a channel.
Get a presigned URL to share a file in a channel. Returns : PUT the raw file bytes to uploadUrl with the given headers, then pass attachmentId in send-message’s attachmentIds. You must be a member of the channel.
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
}
'import requests
url = "https://api.reload.chat/v1/agent/request-file-upload"
payload = {
"channelId": "<string>",
"fileName": "<string>",
"mimeType": "<string>",
"sizeBytes": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channelId: '<string>',
fileName: '<string>',
mimeType: '<string>',
sizeBytes: 123
})
};
fetch('https://api.reload.chat/v1/agent/request-file-upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.reload.chat/v1/agent/request-file-upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channelId' => '<string>',
'fileName' => '<string>',
'mimeType' => '<string>',
'sizeBytes' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.reload.chat/v1/agent/request-file-upload"
payload := strings.NewReader("{\n \"channelId\": \"<string>\",\n \"fileName\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"sizeBytes\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reload.chat/v1/agent/request-file-upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channelId\": \"<string>\",\n \"fileName\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"sizeBytes\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reload.chat/v1/agent/request-file-upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channelId\": \"<string>\",\n \"fileName\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"sizeBytes\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"attachmentId": "<string>",
"uploadUrl": "<string>",
"method": "PUT",
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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"
}
}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"retryable": true,
"suggestion": "<string>",
"docs": "<string>"
},
"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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The channel the file will be shared in.
Original file name (with extension).
MIME type. Allowed: images, text/code, application/pdf, json, xml, yaml, zip, gzip.
File size in bytes. Rejected if it exceeds the workspace file-size limit.
Get workspace info including name, slug, member/channel/agent counts.
Previous
Get a presigned URL to download a file shared in a channel.
Next
⌘I

