Global embeds
Create a global embed
Creates a global embed. name and content are required; status defaults to active, placement defaults to head, and target defaults to storefront. Requires the developer update permission.
POST
/
api
/
global_embeds
Create a global embed
curl --request POST \
--url https://api.fluid.app/api/global_embeds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"global_embed": {
"name": "Dunder Mifflin analytics tag",
"content": "<script async src=\"https://cdn.fluid.app/tags/dunder-mifflin/analytics.js\"></script>",
"status": "active",
"placement": "head",
"target": "storefront"
}
}
'import requests
url = "https://api.fluid.app/api/global_embeds"
payload = { "global_embed": {
"name": "Dunder Mifflin analytics tag",
"content": "<script async src=\"https://cdn.fluid.app/tags/dunder-mifflin/analytics.js\"></script>",
"status": "active",
"placement": "head",
"target": "storefront"
} }
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({
global_embed: {
name: 'Dunder Mifflin analytics tag',
content: '<script async src="https://cdn.fluid.app/tags/dunder-mifflin/analytics.js"></script>',
status: 'active',
placement: 'head',
target: 'storefront'
}
})
};
fetch('https://api.fluid.app/api/global_embeds', 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/global_embeds",
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([
'global_embed' => [
'name' => 'Dunder Mifflin analytics tag',
'content' => '<script async src="https://cdn.fluid.app/tags/dunder-mifflin/analytics.js"></script>',
'status' => 'active',
'placement' => 'head',
'target' => 'storefront'
]
]),
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/global_embeds"
payload := strings.NewReader("{\n \"global_embed\": {\n \"name\": \"Dunder Mifflin analytics tag\",\n \"content\": \"<script async src=\\\"https://cdn.fluid.app/tags/dunder-mifflin/analytics.js\\\"></script>\",\n \"status\": \"active\",\n \"placement\": \"head\",\n \"target\": \"storefront\"\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/global_embeds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"global_embed\": {\n \"name\": \"Dunder Mifflin analytics tag\",\n \"content\": \"<script async src=\\\"https://cdn.fluid.app/tags/dunder-mifflin/analytics.js\\\"></script>\",\n \"status\": \"active\",\n \"placement\": \"head\",\n \"target\": \"storefront\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/global_embeds")
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 \"global_embed\": {\n \"name\": \"Dunder Mifflin analytics tag\",\n \"content\": \"<script async src=\\\"https://cdn.fluid.app/tags/dunder-mifflin/analytics.js\\\"></script>\",\n \"status\": \"active\",\n \"placement\": \"head\",\n \"target\": \"storefront\"\n }\n}"
response = http.request(request)
puts response.read_body{
"global_embed": {
"id": 7342,
"name": "Dunder Mifflin analytics tag",
"content": "<script async src=\"https://cdn.fluid.app/tags/dunder-mifflin/analytics.js\"></script>",
"status": "active",
"placement": "head",
"target": "storefront",
"created_at": "2026-09-14T15:32:08Z",
"updated_at": "2026-09-14T15:32:08Z"
},
"meta": {
"request_id": "3f9c1a7e-5b2d-4c8e-9a61-2d7f0b4e8c13",
"timestamp": "2026-09-21T09:12:45Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"scheduled_date": "2026-12-10",
"last_bill_date": "2026-11-10",
"requested_date": "2026-11-30",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"scheduled_date": "2026-12-10",
"last_bill_date": "2026-11-10",
"requested_date": "2026-11-30",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}⌘I
Create a global embed
curl --request POST \
--url https://api.fluid.app/api/global_embeds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"global_embed": {
"name": "Dunder Mifflin analytics tag",
"content": "<script async src=\"https://cdn.fluid.app/tags/dunder-mifflin/analytics.js\"></script>",
"status": "active",
"placement": "head",
"target": "storefront"
}
}
'import requests
url = "https://api.fluid.app/api/global_embeds"
payload = { "global_embed": {
"name": "Dunder Mifflin analytics tag",
"content": "<script async src=\"https://cdn.fluid.app/tags/dunder-mifflin/analytics.js\"></script>",
"status": "active",
"placement": "head",
"target": "storefront"
} }
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({
global_embed: {
name: 'Dunder Mifflin analytics tag',
content: '<script async src="https://cdn.fluid.app/tags/dunder-mifflin/analytics.js"></script>',
status: 'active',
placement: 'head',
target: 'storefront'
}
})
};
fetch('https://api.fluid.app/api/global_embeds', 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/global_embeds",
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([
'global_embed' => [
'name' => 'Dunder Mifflin analytics tag',
'content' => '<script async src="https://cdn.fluid.app/tags/dunder-mifflin/analytics.js"></script>',
'status' => 'active',
'placement' => 'head',
'target' => 'storefront'
]
]),
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/global_embeds"
payload := strings.NewReader("{\n \"global_embed\": {\n \"name\": \"Dunder Mifflin analytics tag\",\n \"content\": \"<script async src=\\\"https://cdn.fluid.app/tags/dunder-mifflin/analytics.js\\\"></script>\",\n \"status\": \"active\",\n \"placement\": \"head\",\n \"target\": \"storefront\"\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/global_embeds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"global_embed\": {\n \"name\": \"Dunder Mifflin analytics tag\",\n \"content\": \"<script async src=\\\"https://cdn.fluid.app/tags/dunder-mifflin/analytics.js\\\"></script>\",\n \"status\": \"active\",\n \"placement\": \"head\",\n \"target\": \"storefront\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/global_embeds")
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 \"global_embed\": {\n \"name\": \"Dunder Mifflin analytics tag\",\n \"content\": \"<script async src=\\\"https://cdn.fluid.app/tags/dunder-mifflin/analytics.js\\\"></script>\",\n \"status\": \"active\",\n \"placement\": \"head\",\n \"target\": \"storefront\"\n }\n}"
response = http.request(request)
puts response.read_body{
"global_embed": {
"id": 7342,
"name": "Dunder Mifflin analytics tag",
"content": "<script async src=\"https://cdn.fluid.app/tags/dunder-mifflin/analytics.js\"></script>",
"status": "active",
"placement": "head",
"target": "storefront",
"created_at": "2026-09-14T15:32:08Z",
"updated_at": "2026-09-14T15:32:08Z"
},
"meta": {
"request_id": "3f9c1a7e-5b2d-4c8e-9a61-2d7f0b4e8c13",
"timestamp": "2026-09-21T09:12:45Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"scheduled_date": "2026-12-10",
"last_bill_date": "2026-11-10",
"requested_date": "2026-11-30",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"scheduled_date": "2026-12-10",
"last_bill_date": "2026-11-10",
"requested_date": "2026-11-30",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}