Publish an item to organization and/or marketplace
curl --request POST \
--url https://your-instance.example.com/api/marketplace/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"itemType": "prompt",
"itemId": "5f7b1c2e8a1d4e0012c3b4a5",
"scopes": {
"organization": {
"enabled": true,
"shareType": "copy",
"isContentVisible": true,
"allowEditableReferences": false
},
"marketplace": {
"enabled": false,
"shareType": "reference",
"isContentVisible": false,
"allowEditableReferences": false
}
},
"metadata": {
"name": "Acme Inbound Triage Prompt",
"description": "Routes inbound SMS to the right department.",
"usageInformation": "Set the {{org_name}} variable before applying."
}
}
'import requests
url = "https://your-instance.example.com/api/marketplace/publish"
payload = {
"itemType": "prompt",
"itemId": "5f7b1c2e8a1d4e0012c3b4a5",
"scopes": {
"organization": {
"enabled": True,
"shareType": "copy",
"isContentVisible": True,
"allowEditableReferences": False
},
"marketplace": {
"enabled": False,
"shareType": "reference",
"isContentVisible": False,
"allowEditableReferences": False
}
},
"metadata": {
"name": "Acme Inbound Triage Prompt",
"description": "Routes inbound SMS to the right department.",
"usageInformation": "Set the {{org_name}} variable before applying."
}
}
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({
itemType: 'prompt',
itemId: '5f7b1c2e8a1d4e0012c3b4a5',
scopes: {
organization: {
enabled: true,
shareType: 'copy',
isContentVisible: true,
allowEditableReferences: false
},
marketplace: {
enabled: false,
shareType: 'reference',
isContentVisible: false,
allowEditableReferences: false
}
},
metadata: {
name: 'Acme Inbound Triage Prompt',
description: 'Routes inbound SMS to the right department.',
usageInformation: 'Set the {{org_name}} variable before applying.'
}
})
};
fetch('https://your-instance.example.com/api/marketplace/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://your-instance.example.com/api/marketplace/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([
'itemType' => 'prompt',
'itemId' => '5f7b1c2e8a1d4e0012c3b4a5',
'scopes' => [
'organization' => [
'enabled' => true,
'shareType' => 'copy',
'isContentVisible' => true,
'allowEditableReferences' => false
],
'marketplace' => [
'enabled' => false,
'shareType' => 'reference',
'isContentVisible' => false,
'allowEditableReferences' => false
]
],
'metadata' => [
'name' => 'Acme Inbound Triage Prompt',
'description' => 'Routes inbound SMS to the right department.',
'usageInformation' => 'Set the {{org_name}} variable before applying.'
]
]),
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://your-instance.example.com/api/marketplace/publish"
payload := strings.NewReader("{\n \"itemType\": \"prompt\",\n \"itemId\": \"5f7b1c2e8a1d4e0012c3b4a5\",\n \"scopes\": {\n \"organization\": {\n \"enabled\": true,\n \"shareType\": \"copy\",\n \"isContentVisible\": true,\n \"allowEditableReferences\": false\n },\n \"marketplace\": {\n \"enabled\": false,\n \"shareType\": \"reference\",\n \"isContentVisible\": false,\n \"allowEditableReferences\": false\n }\n },\n \"metadata\": {\n \"name\": \"Acme Inbound Triage Prompt\",\n \"description\": \"Routes inbound SMS to the right department.\",\n \"usageInformation\": \"Set the {{org_name}} variable before applying.\"\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://your-instance.example.com/api/marketplace/publish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"itemType\": \"prompt\",\n \"itemId\": \"5f7b1c2e8a1d4e0012c3b4a5\",\n \"scopes\": {\n \"organization\": {\n \"enabled\": true,\n \"shareType\": \"copy\",\n \"isContentVisible\": true,\n \"allowEditableReferences\": false\n },\n \"marketplace\": {\n \"enabled\": false,\n \"shareType\": \"reference\",\n \"isContentVisible\": false,\n \"allowEditableReferences\": false\n }\n },\n \"metadata\": {\n \"name\": \"Acme Inbound Triage Prompt\",\n \"description\": \"Routes inbound SMS to the right department.\",\n \"usageInformation\": \"Set the {{org_name}} variable before applying.\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/marketplace/publish")
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 \"itemType\": \"prompt\",\n \"itemId\": \"5f7b1c2e8a1d4e0012c3b4a5\",\n \"scopes\": {\n \"organization\": {\n \"enabled\": true,\n \"shareType\": \"copy\",\n \"isContentVisible\": true,\n \"allowEditableReferences\": false\n },\n \"marketplace\": {\n \"enabled\": false,\n \"shareType\": \"reference\",\n \"isContentVisible\": false,\n \"allowEditableReferences\": false\n }\n },\n \"metadata\": {\n \"name\": \"Acme Inbound Triage Prompt\",\n \"description\": \"Routes inbound SMS to the right department.\",\n \"usageInformation\": \"Set the {{org_name}} variable before applying.\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"published": [
{
"id": "64d2f9c5e8a1d4e001a0b1c2",
"scope": "organization",
"shareType": "copy",
"isContentVisible": true,
"status": "active"
},
{
"id": "64d2f9c5e8a1d4e001a0b1c3",
"scope": "marketplace",
"shareType": "reference",
"isContentVisible": false,
"status": "active"
}
]
}
}{
"error": "Marketplace item not found"
}{
"error": "Marketplace item not found"
}{
"error": "Marketplace item not found"
}{
"error": "Marketplace item not found"
}Marketplace
Publish an item to organization and/or marketplace
Publish a prompt or template to the caller’s organization scope, the global marketplace scope, or both. Admin/Superadmin only; rejects duplicate publications of the same itemId.
POST
/
api
/
marketplace
/
publish
Publish an item to organization and/or marketplace
curl --request POST \
--url https://your-instance.example.com/api/marketplace/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"itemType": "prompt",
"itemId": "5f7b1c2e8a1d4e0012c3b4a5",
"scopes": {
"organization": {
"enabled": true,
"shareType": "copy",
"isContentVisible": true,
"allowEditableReferences": false
},
"marketplace": {
"enabled": false,
"shareType": "reference",
"isContentVisible": false,
"allowEditableReferences": false
}
},
"metadata": {
"name": "Acme Inbound Triage Prompt",
"description": "Routes inbound SMS to the right department.",
"usageInformation": "Set the {{org_name}} variable before applying."
}
}
'import requests
url = "https://your-instance.example.com/api/marketplace/publish"
payload = {
"itemType": "prompt",
"itemId": "5f7b1c2e8a1d4e0012c3b4a5",
"scopes": {
"organization": {
"enabled": True,
"shareType": "copy",
"isContentVisible": True,
"allowEditableReferences": False
},
"marketplace": {
"enabled": False,
"shareType": "reference",
"isContentVisible": False,
"allowEditableReferences": False
}
},
"metadata": {
"name": "Acme Inbound Triage Prompt",
"description": "Routes inbound SMS to the right department.",
"usageInformation": "Set the {{org_name}} variable before applying."
}
}
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({
itemType: 'prompt',
itemId: '5f7b1c2e8a1d4e0012c3b4a5',
scopes: {
organization: {
enabled: true,
shareType: 'copy',
isContentVisible: true,
allowEditableReferences: false
},
marketplace: {
enabled: false,
shareType: 'reference',
isContentVisible: false,
allowEditableReferences: false
}
},
metadata: {
name: 'Acme Inbound Triage Prompt',
description: 'Routes inbound SMS to the right department.',
usageInformation: 'Set the {{org_name}} variable before applying.'
}
})
};
fetch('https://your-instance.example.com/api/marketplace/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://your-instance.example.com/api/marketplace/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([
'itemType' => 'prompt',
'itemId' => '5f7b1c2e8a1d4e0012c3b4a5',
'scopes' => [
'organization' => [
'enabled' => true,
'shareType' => 'copy',
'isContentVisible' => true,
'allowEditableReferences' => false
],
'marketplace' => [
'enabled' => false,
'shareType' => 'reference',
'isContentVisible' => false,
'allowEditableReferences' => false
]
],
'metadata' => [
'name' => 'Acme Inbound Triage Prompt',
'description' => 'Routes inbound SMS to the right department.',
'usageInformation' => 'Set the {{org_name}} variable before applying.'
]
]),
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://your-instance.example.com/api/marketplace/publish"
payload := strings.NewReader("{\n \"itemType\": \"prompt\",\n \"itemId\": \"5f7b1c2e8a1d4e0012c3b4a5\",\n \"scopes\": {\n \"organization\": {\n \"enabled\": true,\n \"shareType\": \"copy\",\n \"isContentVisible\": true,\n \"allowEditableReferences\": false\n },\n \"marketplace\": {\n \"enabled\": false,\n \"shareType\": \"reference\",\n \"isContentVisible\": false,\n \"allowEditableReferences\": false\n }\n },\n \"metadata\": {\n \"name\": \"Acme Inbound Triage Prompt\",\n \"description\": \"Routes inbound SMS to the right department.\",\n \"usageInformation\": \"Set the {{org_name}} variable before applying.\"\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://your-instance.example.com/api/marketplace/publish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"itemType\": \"prompt\",\n \"itemId\": \"5f7b1c2e8a1d4e0012c3b4a5\",\n \"scopes\": {\n \"organization\": {\n \"enabled\": true,\n \"shareType\": \"copy\",\n \"isContentVisible\": true,\n \"allowEditableReferences\": false\n },\n \"marketplace\": {\n \"enabled\": false,\n \"shareType\": \"reference\",\n \"isContentVisible\": false,\n \"allowEditableReferences\": false\n }\n },\n \"metadata\": {\n \"name\": \"Acme Inbound Triage Prompt\",\n \"description\": \"Routes inbound SMS to the right department.\",\n \"usageInformation\": \"Set the {{org_name}} variable before applying.\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/marketplace/publish")
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 \"itemType\": \"prompt\",\n \"itemId\": \"5f7b1c2e8a1d4e0012c3b4a5\",\n \"scopes\": {\n \"organization\": {\n \"enabled\": true,\n \"shareType\": \"copy\",\n \"isContentVisible\": true,\n \"allowEditableReferences\": false\n },\n \"marketplace\": {\n \"enabled\": false,\n \"shareType\": \"reference\",\n \"isContentVisible\": false,\n \"allowEditableReferences\": false\n }\n },\n \"metadata\": {\n \"name\": \"Acme Inbound Triage Prompt\",\n \"description\": \"Routes inbound SMS to the right department.\",\n \"usageInformation\": \"Set the {{org_name}} variable before applying.\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"published": [
{
"id": "64d2f9c5e8a1d4e001a0b1c2",
"scope": "organization",
"shareType": "copy",
"isContentVisible": true,
"status": "active"
},
{
"id": "64d2f9c5e8a1d4e001a0b1c3",
"scope": "marketplace",
"shareType": "reference",
"isContentVisible": false,
"status": "active"
}
]
}
}{
"error": "Marketplace item not found"
}{
"error": "Marketplace item not found"
}{
"error": "Marketplace item not found"
}{
"error": "Marketplace item not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
What's being published: prompt or template.
Available options:
prompt, template Mongo ObjectId of the source prompt or template the caller owns and wants to publish.
Per-scope publish settings (organization, marketplace) — each carries enabled, shareType, isContentVisible, allowEditableReferences.
Show child attributes
Show child attributes
Optional display overrides for the listing; when omitted the underlying item's own name/description are used.
Show child attributes
Show child attributes
⌘I