curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/assets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_name": "Logo-dark.png",
"file_url": "https://cdn.acme.com/brand/Logo-dark.png",
"file_type": "png"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/assets"
payload = {
"file_name": "Logo-dark.png",
"file_url": "https://cdn.acme.com/brand/Logo-dark.png",
"file_type": "png"
}
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_name: 'Logo-dark.png',
file_url: 'https://cdn.acme.com/brand/Logo-dark.png',
file_type: 'png'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/assets', 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://app.base44.com/api/apps/{app_id}/assets",
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_name' => 'Logo-dark.png',
'file_url' => 'https://cdn.acme.com/brand/Logo-dark.png',
'file_type' => 'png'
]),
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://app.base44.com/api/apps/{app_id}/assets"
payload := strings.NewReader("{\n \"file_name\": \"Logo-dark.png\",\n \"file_url\": \"https://cdn.acme.com/brand/Logo-dark.png\",\n \"file_type\": \"png\"\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://app.base44.com/api/apps/{app_id}/assets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_name\": \"Logo-dark.png\",\n \"file_url\": \"https://cdn.acme.com/brand/Logo-dark.png\",\n \"file_type\": \"png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/assets")
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_name\": \"Logo-dark.png\",\n \"file_url\": \"https://cdn.acme.com/brand/Logo-dark.png\",\n \"file_type\": \"png\"\n}"
response = http.request(request)
puts response.read_bodyCreate asset
Adds a file that’s already online to the app’s media library, by its URL. Base44 doesn’t download the file. To store a file with Base44, use Upload asset instead.
To retry safely, send an Idempotency-Key header. A retry with the same key and body within 24 hours returns the asset the first request added instead of adding another.
In this response, created_date and updated_date include a +00:00 offset. List assets returns them without one.
This endpoint is limited to 120 requests per minute, shared with Create asset, Rename asset and Delete asset. Some workspaces have a different limit.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/assets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_name": "Logo-dark.png",
"file_url": "https://cdn.acme.com/brand/Logo-dark.png",
"file_type": "png"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/assets"
payload = {
"file_name": "Logo-dark.png",
"file_url": "https://cdn.acme.com/brand/Logo-dark.png",
"file_type": "png"
}
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_name: 'Logo-dark.png',
file_url: 'https://cdn.acme.com/brand/Logo-dark.png',
file_type: 'png'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/assets', 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://app.base44.com/api/apps/{app_id}/assets",
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_name' => 'Logo-dark.png',
'file_url' => 'https://cdn.acme.com/brand/Logo-dark.png',
'file_type' => 'png'
]),
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://app.base44.com/api/apps/{app_id}/assets"
payload := strings.NewReader("{\n \"file_name\": \"Logo-dark.png\",\n \"file_url\": \"https://cdn.acme.com/brand/Logo-dark.png\",\n \"file_type\": \"png\"\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://app.base44.com/api/apps/{app_id}/assets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_name\": \"Logo-dark.png\",\n \"file_url\": \"https://cdn.acme.com/brand/Logo-dark.png\",\n \"file_type\": \"png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/assets")
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_name\": \"Logo-dark.png\",\n \"file_url\": \"https://cdn.acme.com/brand/Logo-dark.png\",\n \"file_type\": \"png\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Personal access token, sent as Authorization: Bearer <token>. Each operation lists the permission it needs: read_only or full_access. A full-access token can call every operation. A read-only token can call only the operations that list read_only; anything else returns 403 read_only_credential_route_not_allowed.
Scopes
Headers
Body
Public http or https URL of the file. Base44 doesn't download or copy it, so the asset stays a link to this URL. Addresses on private networks and Base44's own hosts, other than its media CDN, are refused.
"https://media.base44.com/files/public/6820f3a4e7b91d003c45a1f2/Logo-dark.png"
Response
The new asset.
A file in the app's media library.
Was this page helpful?