curl --request POST \
--url https://api.assembly.com/v1/files/{fileType} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"channelID": "a8f2c1d4-1234-4abc-9def-0123456789ab",
"type": "file",
"clientPermissions": "read_write",
"duplicateBehavior": "append",
"fileKey": "files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf",
"linkUrl": "https://example.com/brochure.pdf",
"path": "/contracts/2024"
}
'import requests
url = "https://api.assembly.com/v1/files/{fileType}"
payload = {
"channelID": "a8f2c1d4-1234-4abc-9def-0123456789ab",
"type": "file",
"clientPermissions": "read_write",
"duplicateBehavior": "append",
"fileKey": "files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf",
"linkUrl": "https://example.com/brochure.pdf",
"path": "/contracts/2024"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channelID: 'a8f2c1d4-1234-4abc-9def-0123456789ab',
type: 'file',
clientPermissions: 'read_write',
duplicateBehavior: 'append',
fileKey: 'files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf',
linkUrl: 'https://example.com/brochure.pdf',
path: '/contracts/2024'
})
};
fetch('https://api.assembly.com/v1/files/{fileType}', 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.assembly.com/v1/files/{fileType}",
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' => 'a8f2c1d4-1234-4abc-9def-0123456789ab',
'type' => 'file',
'clientPermissions' => 'read_write',
'duplicateBehavior' => 'append',
'fileKey' => 'files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf',
'linkUrl' => 'https://example.com/brochure.pdf',
'path' => '/contracts/2024'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.assembly.com/v1/files/{fileType}"
payload := strings.NewReader("{\n \"channelID\": \"a8f2c1d4-1234-4abc-9def-0123456789ab\",\n \"type\": \"file\",\n \"clientPermissions\": \"read_write\",\n \"duplicateBehavior\": \"append\",\n \"fileKey\": \"files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf\",\n \"linkUrl\": \"https://example.com/brochure.pdf\",\n \"path\": \"/contracts/2024\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.assembly.com/v1/files/{fileType}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"channelID\": \"a8f2c1d4-1234-4abc-9def-0123456789ab\",\n \"type\": \"file\",\n \"clientPermissions\": \"read_write\",\n \"duplicateBehavior\": \"append\",\n \"fileKey\": \"files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf\",\n \"linkUrl\": \"https://example.com/brochure.pdf\",\n \"path\": \"/contracts/2024\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assembly.com/v1/files/{fileType}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channelID\": \"a8f2c1d4-1234-4abc-9def-0123456789ab\",\n \"type\": \"file\",\n \"clientPermissions\": \"read_write\",\n \"duplicateBehavior\": \"append\",\n \"fileKey\": \"files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf\",\n \"linkUrl\": \"https://example.com/brochure.pdf\",\n \"path\": \"/contracts/2024\"\n}"
response = http.request(request)
puts response.read_body{
"additionalFields": {},
"channelId": "a8f2c1d4-1234-4abc-9def-0123456789ab",
"clientPermissions": "read_write",
"createdAt": "<string>",
"creatorId": "f4a1b2c3-1234-4abc-9def-0123456789ab",
"data": "<string>",
"downloadUrl": "<string>",
"fields": {
"eSignatureStatus": "done",
"linkUrl": "https://example.com/brochure.pdf",
"name": "brochure.pdf",
"path": "/contracts/2024",
"size": 20480,
"status": "complete"
},
"id": "<string>",
"identityId": "<string>",
"lastModifiedBy": {
"id": "f4a1b2c3-1234-4abc-9def-0123456789ab",
"object": "internalUser"
},
"object": "<string>",
"previousAttributes": {},
"ref": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"uploadUrl": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}Create a File
Creates a file, folder, or link record within a file channel. channelID is
required; path is required for folders and linkUrl for links. Files default
to “append” behavior (keep both, adding a numbered suffix) when a file with the
same name already exists at the path.
curl --request POST \
--url https://api.assembly.com/v1/files/{fileType} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"channelID": "a8f2c1d4-1234-4abc-9def-0123456789ab",
"type": "file",
"clientPermissions": "read_write",
"duplicateBehavior": "append",
"fileKey": "files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf",
"linkUrl": "https://example.com/brochure.pdf",
"path": "/contracts/2024"
}
'import requests
url = "https://api.assembly.com/v1/files/{fileType}"
payload = {
"channelID": "a8f2c1d4-1234-4abc-9def-0123456789ab",
"type": "file",
"clientPermissions": "read_write",
"duplicateBehavior": "append",
"fileKey": "files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf",
"linkUrl": "https://example.com/brochure.pdf",
"path": "/contracts/2024"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channelID: 'a8f2c1d4-1234-4abc-9def-0123456789ab',
type: 'file',
clientPermissions: 'read_write',
duplicateBehavior: 'append',
fileKey: 'files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf',
linkUrl: 'https://example.com/brochure.pdf',
path: '/contracts/2024'
})
};
fetch('https://api.assembly.com/v1/files/{fileType}', 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.assembly.com/v1/files/{fileType}",
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' => 'a8f2c1d4-1234-4abc-9def-0123456789ab',
'type' => 'file',
'clientPermissions' => 'read_write',
'duplicateBehavior' => 'append',
'fileKey' => 'files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf',
'linkUrl' => 'https://example.com/brochure.pdf',
'path' => '/contracts/2024'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.assembly.com/v1/files/{fileType}"
payload := strings.NewReader("{\n \"channelID\": \"a8f2c1d4-1234-4abc-9def-0123456789ab\",\n \"type\": \"file\",\n \"clientPermissions\": \"read_write\",\n \"duplicateBehavior\": \"append\",\n \"fileKey\": \"files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf\",\n \"linkUrl\": \"https://example.com/brochure.pdf\",\n \"path\": \"/contracts/2024\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.assembly.com/v1/files/{fileType}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"channelID\": \"a8f2c1d4-1234-4abc-9def-0123456789ab\",\n \"type\": \"file\",\n \"clientPermissions\": \"read_write\",\n \"duplicateBehavior\": \"append\",\n \"fileKey\": \"files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf\",\n \"linkUrl\": \"https://example.com/brochure.pdf\",\n \"path\": \"/contracts/2024\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assembly.com/v1/files/{fileType}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channelID\": \"a8f2c1d4-1234-4abc-9def-0123456789ab\",\n \"type\": \"file\",\n \"clientPermissions\": \"read_write\",\n \"duplicateBehavior\": \"append\",\n \"fileKey\": \"files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf\",\n \"linkUrl\": \"https://example.com/brochure.pdf\",\n \"path\": \"/contracts/2024\"\n}"
response = http.request(request)
puts response.read_body{
"additionalFields": {},
"channelId": "a8f2c1d4-1234-4abc-9def-0123456789ab",
"clientPermissions": "read_write",
"createdAt": "<string>",
"creatorId": "f4a1b2c3-1234-4abc-9def-0123456789ab",
"data": "<string>",
"downloadUrl": "<string>",
"fields": {
"eSignatureStatus": "done",
"linkUrl": "https://example.com/brochure.pdf",
"name": "brochure.pdf",
"path": "/contracts/2024",
"size": 20480,
"status": "complete"
},
"id": "<string>",
"identityId": "<string>",
"lastModifiedBy": {
"id": "f4a1b2c3-1234-4abc-9def-0123456789ab",
"object": "internalUser"
},
"object": "<string>",
"previousAttributes": {},
"ref": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"uploadUrl": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}Authorizations
Path Parameters
The type of file object to be created. This can be 'file', 'folder', or 'link'.
Body
File to create
ChannelID is the file channel the item is created in.
"a8f2c1d4-1234-4abc-9def-0123456789ab"
Type is the kind of item to create. Defaults to "file" when omitted on the path.
file, folder, link "file"
ClientPermissions sets the folder locking permissions for the created file/folder
read_write, read_only "read_write"
DuplicateBehavior specifies how to handle if a file with the same name already exists at the path. Defaults to "append" (keep both) when omitted.
append, replace "append"
FileKey is the S3 object key for an already-uploaded file's binary data.
"files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf"
FileURL is the external link target. Required when creating a link.
"https://example.com/brochure.pdf"
Path is the folder location for the item. Required when creating a folder.
"/contracts/2024"
Response
OK
ChannelID is the file channel the item belongs to.
"a8f2c1d4-1234-4abc-9def-0123456789ab"
ClientPermissions controls client read/write access for folders.
read_write, read_only "read_write"
CreatorId is the id of the user who created the file.
"f4a1b2c3-1234-4abc-9def-0123456789ab"
DownloadURL is a presigned URL for downloading the file's contents.
Fields holds the item's name, path, link target, size, and status.
Show child attributes
Show child attributes
LastModifiedBy identifies the user who last modified the file.
Show child attributes
Show child attributes
UpdatedDate is when the file was last updated.
UploadURL is a presigned URL for uploading the file's binary data, set on creation of an unuploaded file.