Transfer Asset to CDN
curl --request POST \
--url https://app.uselamina.ai/v1/publishing/transfer-asset \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"sourceUrl": "https://fal.media/files/generated/output-001.png",
"mediaType": "image",
"filename": "campaign-hero-image.png"
}
'import requests
url = "https://app.uselamina.ai/v1/publishing/transfer-asset"
payload = {
"sourceUrl": "https://fal.media/files/generated/output-001.png",
"mediaType": "image",
"filename": "campaign-hero-image.png"
}
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({
sourceUrl: 'https://fal.media/files/generated/output-001.png',
mediaType: 'image',
filename: 'campaign-hero-image.png'
})
};
fetch('https://app.uselamina.ai/v1/publishing/transfer-asset', 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.uselamina.ai/v1/publishing/transfer-asset",
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([
'sourceUrl' => 'https://fal.media/files/generated/output-001.png',
'mediaType' => 'image',
'filename' => 'campaign-hero-image.png'
]),
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://app.uselamina.ai/v1/publishing/transfer-asset"
payload := strings.NewReader("{\n \"sourceUrl\": \"https://fal.media/files/generated/output-001.png\",\n \"mediaType\": \"image\",\n \"filename\": \"campaign-hero-image.png\"\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://app.uselamina.ai/v1/publishing/transfer-asset")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sourceUrl\": \"https://fal.media/files/generated/output-001.png\",\n \"mediaType\": \"image\",\n \"filename\": \"campaign-hero-image.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.uselamina.ai/v1/publishing/transfer-asset")
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 \"sourceUrl\": \"https://fal.media/files/generated/output-001.png\",\n \"mediaType\": \"image\",\n \"filename\": \"campaign-hero-image.png\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"url": "https://media.getmason.io/api/assetlib/abc123-campaign-hero-image.png"
}
}{
"error": "mediaType must be one of: image, video, audio"
}{
"error": "Invalid API key"
}"Too many requests from this IP, please try again in a minute"Distribute
Transfer Asset to CDN
Transfer an asset from an external URL to the Lamina CDN for reliable, permanent access. Use this when you need a stable URL for publishing or downstream consumption.
Generated assets from executions are often stored on temporary provider URLs that may expire. Transfer them to CDN before publishing or sharing.
Returns the permanent CDN URL that can be used with POST /v1/publishing/publish
or any other system.
POST
/
v1
/
publishing
/
transfer-asset
Transfer Asset to CDN
curl --request POST \
--url https://app.uselamina.ai/v1/publishing/transfer-asset \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"sourceUrl": "https://fal.media/files/generated/output-001.png",
"mediaType": "image",
"filename": "campaign-hero-image.png"
}
'import requests
url = "https://app.uselamina.ai/v1/publishing/transfer-asset"
payload = {
"sourceUrl": "https://fal.media/files/generated/output-001.png",
"mediaType": "image",
"filename": "campaign-hero-image.png"
}
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({
sourceUrl: 'https://fal.media/files/generated/output-001.png',
mediaType: 'image',
filename: 'campaign-hero-image.png'
})
};
fetch('https://app.uselamina.ai/v1/publishing/transfer-asset', 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.uselamina.ai/v1/publishing/transfer-asset",
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([
'sourceUrl' => 'https://fal.media/files/generated/output-001.png',
'mediaType' => 'image',
'filename' => 'campaign-hero-image.png'
]),
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://app.uselamina.ai/v1/publishing/transfer-asset"
payload := strings.NewReader("{\n \"sourceUrl\": \"https://fal.media/files/generated/output-001.png\",\n \"mediaType\": \"image\",\n \"filename\": \"campaign-hero-image.png\"\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://app.uselamina.ai/v1/publishing/transfer-asset")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sourceUrl\": \"https://fal.media/files/generated/output-001.png\",\n \"mediaType\": \"image\",\n \"filename\": \"campaign-hero-image.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.uselamina.ai/v1/publishing/transfer-asset")
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 \"sourceUrl\": \"https://fal.media/files/generated/output-001.png\",\n \"mediaType\": \"image\",\n \"filename\": \"campaign-hero-image.png\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"url": "https://media.getmason.io/api/assetlib/abc123-campaign-hero-image.png"
}
}{
"error": "mediaType must be one of: image, video, audio"
}{
"error": "Invalid API key"
}"Too many requests from this IP, please try again in a minute"Transfer a generated asset from an external URL to the Lamina CDN for reliable, long-term access.
AI model providers often host generated assets on temporary URLs that expire. Use this endpoint to copy the asset to Lamina’s CDN before the source URL goes away. Returns the permanent CDN URL.
Supports
image, video, and audio assets.Authorizations
Workspace API key. Prefix: lma_. Example: lma_abc123...
Body
application/json
Response
CDN URL for the transferred asset
Show child attributes
Show child attributes