Create a File
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>"
}Files
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.
POST
/
v1
/
files
/
{fileType}
Create a File
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>"
}Path Parameters
Body
application/json
File to create
Response
OK