Theme resources and files
Creates a file resource
Uploads a file to the company’s asset library. Provide exactly one source: content for a text file, a multipart file upload, or dam_asset_code to link an existing digital asset; otherwise supply url with filename, content_type, and content_size. To attach the file to a theme or template, send both relateable_type (ApplicationTheme or ApplicationThemeTemplate) and relateable_id. Requires the file_resources update permission.
POST
/
api
/
file_resources
Creates a file resource
curl --request POST \
--url https://api.fluid.app/api/file_resources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_resource": {
"filename": "brand.css",
"content": ":root { --dm-blue: #1f4e79; }\n.btn-primary { background: var(--dm-blue); }",
"content_type": "text/css",
"relateable_type": "ApplicationTheme",
"relateable_id": 7310
}
}
'import requests
url = "https://api.fluid.app/api/file_resources"
payload = { "file_resource": {
"filename": "brand.css",
"content": ":root { --dm-blue: #1f4e79; }
.btn-primary { background: var(--dm-blue); }",
"content_type": "text/css",
"relateable_type": "ApplicationTheme",
"relateable_id": 7310
} }
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({
file_resource: {
filename: 'brand.css',
content: ':root { --dm-blue: #1f4e79; }\n.btn-primary { background: var(--dm-blue); }',
content_type: 'text/css',
relateable_type: 'ApplicationTheme',
relateable_id: 7310
}
})
};
fetch('https://api.fluid.app/api/file_resources', 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.fluid.app/api/file_resources",
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([
'file_resource' => [
'filename' => 'brand.css',
'content' => ':root { --dm-blue: #1f4e79; }
.btn-primary { background: var(--dm-blue); }',
'content_type' => 'text/css',
'relateable_type' => 'ApplicationTheme',
'relateable_id' => 7310
]
]),
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.fluid.app/api/file_resources"
payload := strings.NewReader("{\n \"file_resource\": {\n \"filename\": \"brand.css\",\n \"content\": \":root { --dm-blue: #1f4e79; }\\n.btn-primary { background: var(--dm-blue); }\",\n \"content_type\": \"text/css\",\n \"relateable_type\": \"ApplicationTheme\",\n \"relateable_id\": 7310\n }\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.fluid.app/api/file_resources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_resource\": {\n \"filename\": \"brand.css\",\n \"content\": \":root { --dm-blue: #1f4e79; }\\n.btn-primary { background: var(--dm-blue); }\",\n \"content_type\": \"text/css\",\n \"relateable_type\": \"ApplicationTheme\",\n \"relateable_id\": 7310\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/file_resources")
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 \"file_resource\": {\n \"filename\": \"brand.css\",\n \"content\": \":root { --dm-blue: #1f4e79; }\\n.btn-primary { background: var(--dm-blue); }\",\n \"content_type\": \"text/css\",\n \"relateable_type\": \"ApplicationTheme\",\n \"relateable_id\": 7310\n }\n}"
response = http.request(request)
puts response.read_body{
"file_resource": {
"id": 88215,
"url": "https://dunder-mifflin.fluid.app/assets/public.application_themes.7310/brand.css",
"preview_image_url": null,
"alt_text": null,
"handle": "brand-css",
"content_type": "text/css",
"content_size": 214,
"content": ":root { --dm-blue: #1f4e79; }\n.btn-primary { background: var(--dm-blue); }",
"relateable_id": 7310,
"relateable_type": "ApplicationTheme",
"metadata": {},
"created_at": "2026-09-21T16:05:47Z",
"updated_at": "2026-09-21T16:05:47Z",
"filename": "brand.css",
"version": "1",
"non_binary": true,
"dam_ready": true,
"dam_processing_status": "ready",
"dam_tags": [],
"dam_upload_queued": false
},
"meta": {
"request_id": "4f1c2a9e-7b3d-4e8a-9c61-2d5f8a0b3e17",
"timestamp": "2026-09-22T15:04:12Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer token authentication
Body
application/json
Request payload
Show child attributes
Show child attributes
⌘I
Creates a file resource
curl --request POST \
--url https://api.fluid.app/api/file_resources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_resource": {
"filename": "brand.css",
"content": ":root { --dm-blue: #1f4e79; }\n.btn-primary { background: var(--dm-blue); }",
"content_type": "text/css",
"relateable_type": "ApplicationTheme",
"relateable_id": 7310
}
}
'import requests
url = "https://api.fluid.app/api/file_resources"
payload = { "file_resource": {
"filename": "brand.css",
"content": ":root { --dm-blue: #1f4e79; }
.btn-primary { background: var(--dm-blue); }",
"content_type": "text/css",
"relateable_type": "ApplicationTheme",
"relateable_id": 7310
} }
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({
file_resource: {
filename: 'brand.css',
content: ':root { --dm-blue: #1f4e79; }\n.btn-primary { background: var(--dm-blue); }',
content_type: 'text/css',
relateable_type: 'ApplicationTheme',
relateable_id: 7310
}
})
};
fetch('https://api.fluid.app/api/file_resources', 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.fluid.app/api/file_resources",
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([
'file_resource' => [
'filename' => 'brand.css',
'content' => ':root { --dm-blue: #1f4e79; }
.btn-primary { background: var(--dm-blue); }',
'content_type' => 'text/css',
'relateable_type' => 'ApplicationTheme',
'relateable_id' => 7310
]
]),
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.fluid.app/api/file_resources"
payload := strings.NewReader("{\n \"file_resource\": {\n \"filename\": \"brand.css\",\n \"content\": \":root { --dm-blue: #1f4e79; }\\n.btn-primary { background: var(--dm-blue); }\",\n \"content_type\": \"text/css\",\n \"relateable_type\": \"ApplicationTheme\",\n \"relateable_id\": 7310\n }\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.fluid.app/api/file_resources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_resource\": {\n \"filename\": \"brand.css\",\n \"content\": \":root { --dm-blue: #1f4e79; }\\n.btn-primary { background: var(--dm-blue); }\",\n \"content_type\": \"text/css\",\n \"relateable_type\": \"ApplicationTheme\",\n \"relateable_id\": 7310\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/file_resources")
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 \"file_resource\": {\n \"filename\": \"brand.css\",\n \"content\": \":root { --dm-blue: #1f4e79; }\\n.btn-primary { background: var(--dm-blue); }\",\n \"content_type\": \"text/css\",\n \"relateable_type\": \"ApplicationTheme\",\n \"relateable_id\": 7310\n }\n}"
response = http.request(request)
puts response.read_body{
"file_resource": {
"id": 88215,
"url": "https://dunder-mifflin.fluid.app/assets/public.application_themes.7310/brand.css",
"preview_image_url": null,
"alt_text": null,
"handle": "brand-css",
"content_type": "text/css",
"content_size": 214,
"content": ":root { --dm-blue: #1f4e79; }\n.btn-primary { background: var(--dm-blue); }",
"relateable_id": 7310,
"relateable_type": "ApplicationTheme",
"metadata": {},
"created_at": "2026-09-21T16:05:47Z",
"updated_at": "2026-09-21T16:05:47Z",
"filename": "brand.css",
"version": "1",
"non_binary": true,
"dam_ready": true,
"dam_processing_status": "ready",
"dam_tags": [],
"dam_upload_queued": false
},
"meta": {
"request_id": "4f1c2a9e-7b3d-4e8a-9c61-2d5f8a0b3e17",
"timestamp": "2026-09-22T15:04:12Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}