Publish Entity
curl --request PATCH \
--url https://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/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://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/publish"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyEntity Endpoints
Publish Entity
Publish a draft entity, making it publicly visible
Publish Entity
curl --request PATCH \
--url https://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/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://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/publish"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/entities/:entityId/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyRequires the
entities bundle. A project without the entities bundle returns 403 database/tables-not-available. See Bundles.isDraft field is set to false and createdAt is reset to the current time.
Authentication required. Only the entity’s author, or a request with a service or master key, can publish a draft.
Path Parameters
string
required
The UUID of the draft entity to publish.
Response
Returns the published Entity object withisDraft: false.
Publishing resets
createdAt to the current time, so the entity appears as “new” in chronological feeds regardless of when the draft was created.Mention notifications are sent when publishing, not when the draft is created. Users mentioned in the entity receive notifications at publish time.
Error Responses
Not Found — 404
Not Found — 404
{ "error": "Draft entity not found", "code": "entity/not-found" }
Unauthorized — 403
Unauthorized — 403
{ "error": "Not authorized to publish this draft.", "code": "entity/unauthorized" }

