Publish Content
curl --request POST \
--url https://app.uselamina.ai/v1/publishing/publish \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"accountIds": [
"ch-001",
"ch-002"
],
"imageUrl": "https://media.getmason.io/api/assetlib/abc123.png",
"caption": "Discover our new spring collection -- where comfort meets style."
}
'import requests
url = "https://app.uselamina.ai/v1/publishing/publish"
payload = {
"accountIds": ["ch-001", "ch-002"],
"imageUrl": "https://media.getmason.io/api/assetlib/abc123.png",
"caption": "Discover our new spring collection -- where comfort meets style."
}
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({
accountIds: ['ch-001', 'ch-002'],
imageUrl: 'https://media.getmason.io/api/assetlib/abc123.png',
caption: 'Discover our new spring collection -- where comfort meets style.'
})
};
fetch('https://app.uselamina.ai/v1/publishing/publish', 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/publish",
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([
'accountIds' => [
'ch-001',
'ch-002'
],
'imageUrl' => 'https://media.getmason.io/api/assetlib/abc123.png',
'caption' => 'Discover our new spring collection -- where comfort meets style.'
]),
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/publish"
payload := strings.NewReader("{\n \"accountIds\": [\n \"ch-001\",\n \"ch-002\"\n ],\n \"imageUrl\": \"https://media.getmason.io/api/assetlib/abc123.png\",\n \"caption\": \"Discover our new spring collection -- where comfort meets style.\"\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/publish")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"accountIds\": [\n \"ch-001\",\n \"ch-002\"\n ],\n \"imageUrl\": \"https://media.getmason.io/api/assetlib/abc123.png\",\n \"caption\": \"Discover our new spring collection -- where comfort meets style.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.uselamina.ai/v1/publishing/publish")
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 \"accountIds\": [\n \"ch-001\",\n \"ch-002\"\n ],\n \"imageUrl\": \"https://media.getmason.io/api/assetlib/abc123.png\",\n \"caption\": \"Discover our new spring collection -- where comfort meets style.\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"results": [
{
"accountId": "ch-001",
"status": "published",
"postUrl": "https://facebook.com/mybrandpage/posts/123456"
},
{
"accountId": "ch-002",
"status": "published",
"postUrl": "https://instagram.com/p/ABC123"
}
]
}
}{
"error": "Provide at least one of: imageUrl, videoUrl, caption"
}{
"error": "Invalid API key"
}"Too many requests from this IP, please try again in a minute"Distribute
Publish Content
Publish content (image, video, or caption) to one or more connected social
accounts. Provide at least one of imageUrl, videoUrl, or caption.
Use GET /v1/publishing/channels to discover available channel IDs.
Important: URLs must point to publicly accessible media. If you have a
generated asset from an execution, you may need to transfer it to CDN first
using POST /v1/publishing/transfer-asset to ensure it remains available.
POST
/
v1
/
publishing
/
publish
Publish Content
curl --request POST \
--url https://app.uselamina.ai/v1/publishing/publish \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"accountIds": [
"ch-001",
"ch-002"
],
"imageUrl": "https://media.getmason.io/api/assetlib/abc123.png",
"caption": "Discover our new spring collection -- where comfort meets style."
}
'import requests
url = "https://app.uselamina.ai/v1/publishing/publish"
payload = {
"accountIds": ["ch-001", "ch-002"],
"imageUrl": "https://media.getmason.io/api/assetlib/abc123.png",
"caption": "Discover our new spring collection -- where comfort meets style."
}
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({
accountIds: ['ch-001', 'ch-002'],
imageUrl: 'https://media.getmason.io/api/assetlib/abc123.png',
caption: 'Discover our new spring collection -- where comfort meets style.'
})
};
fetch('https://app.uselamina.ai/v1/publishing/publish', 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/publish",
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([
'accountIds' => [
'ch-001',
'ch-002'
],
'imageUrl' => 'https://media.getmason.io/api/assetlib/abc123.png',
'caption' => 'Discover our new spring collection -- where comfort meets style.'
]),
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/publish"
payload := strings.NewReader("{\n \"accountIds\": [\n \"ch-001\",\n \"ch-002\"\n ],\n \"imageUrl\": \"https://media.getmason.io/api/assetlib/abc123.png\",\n \"caption\": \"Discover our new spring collection -- where comfort meets style.\"\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/publish")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"accountIds\": [\n \"ch-001\",\n \"ch-002\"\n ],\n \"imageUrl\": \"https://media.getmason.io/api/assetlib/abc123.png\",\n \"caption\": \"Discover our new spring collection -- where comfort meets style.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.uselamina.ai/v1/publishing/publish")
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 \"accountIds\": [\n \"ch-001\",\n \"ch-002\"\n ],\n \"imageUrl\": \"https://media.getmason.io/api/assetlib/abc123.png\",\n \"caption\": \"Discover our new spring collection -- where comfort meets style.\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"results": [
{
"accountId": "ch-001",
"status": "published",
"postUrl": "https://facebook.com/mybrandpage/posts/123456"
},
{
"accountId": "ch-002",
"status": "published",
"postUrl": "https://instagram.com/p/ABC123"
}
]
}
}{
"error": "Provide at least one of: imageUrl, videoUrl, caption"
}{
"error": "Invalid API key"
}"Too many requests from this IP, please try again in a minute"Publish content to one or more connected social channels.
Provide the asset (image URL, video URL, or both), a caption, and the target
accountIds from the list-channels endpoint. You must provide at least one of imageUrl, videoUrl, or caption.
Use the publish-history endpoint to track the status of past publishes.Authorizations
Workspace API key. Prefix: lma_. Example: lma_abc123...
Body
application/json
Response
Publish results per account
Publish result with per-account status.
⌘I