curl --request POST \
--url https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"attributes": {
"hub": {
"branding": {},
"clear_settings_keys": [
"<string>"
],
"expected_etag": "<string>",
"navigation": {},
"settings": {}
},
"media": [
{
"file_id": "<string>",
"published_at": "2023-11-07T05:31:56Z"
}
],
"pages": [
{
"expected_draft_version": 1073741823,
"page_id": "<string>"
}
],
"pending_ops_remaining": [
"<unknown>"
],
"playlists": [
{
"playlist_id": "<string>"
}
]
},
"type": "hub_publishes"
}
}
'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes"
payload = { "data": {
"attributes": {
"hub": {
"branding": {},
"clear_settings_keys": ["<string>"],
"expected_etag": "<string>",
"navigation": {},
"settings": {}
},
"media": [
{
"file_id": "<string>",
"published_at": "2023-11-07T05:31:56Z"
}
],
"pages": [
{
"expected_draft_version": 1073741823,
"page_id": "<string>"
}
],
"pending_ops_remaining": ["<unknown>"],
"playlists": [{ "playlist_id": "<string>" }]
},
"type": "hub_publishes"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
attributes: {
hub: {
branding: {},
clear_settings_keys: ['<string>'],
expected_etag: '<string>',
navigation: {},
settings: {}
},
media: [{file_id: '<string>', published_at: '2023-11-07T05:31:56Z'}],
pages: [{expected_draft_version: 1073741823, page_id: '<string>'}],
pending_ops_remaining: ['<unknown>'],
playlists: [{playlist_id: '<string>'}]
},
type: 'hub_publishes'
}
})
};
fetch('https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes', 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.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes",
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([
'data' => [
'attributes' => [
'hub' => [
'branding' => [
],
'clear_settings_keys' => [
'<string>'
],
'expected_etag' => '<string>',
'navigation' => [
],
'settings' => [
]
],
'media' => [
[
'file_id' => '<string>',
'published_at' => '2023-11-07T05:31:56Z'
]
],
'pages' => [
[
'expected_draft_version' => 1073741823,
'page_id' => '<string>'
]
],
'pending_ops_remaining' => [
'<unknown>'
],
'playlists' => [
[
'playlist_id' => '<string>'
]
]
],
'type' => 'hub_publishes'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes"
payload := strings.NewReader("{\n \"data\": {\n \"attributes\": {\n \"hub\": {\n \"branding\": {},\n \"clear_settings_keys\": [\n \"<string>\"\n ],\n \"expected_etag\": \"<string>\",\n \"navigation\": {},\n \"settings\": {}\n },\n \"media\": [\n {\n \"file_id\": \"<string>\",\n \"published_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"pages\": [\n {\n \"expected_draft_version\": 1073741823,\n \"page_id\": \"<string>\"\n }\n ],\n \"pending_ops_remaining\": [\n \"<unknown>\"\n ],\n \"playlists\": [\n {\n \"playlist_id\": \"<string>\"\n }\n ]\n },\n \"type\": \"hub_publishes\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+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.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"attributes\": {\n \"hub\": {\n \"branding\": {},\n \"clear_settings_keys\": [\n \"<string>\"\n ],\n \"expected_etag\": \"<string>\",\n \"navigation\": {},\n \"settings\": {}\n },\n \"media\": [\n {\n \"file_id\": \"<string>\",\n \"published_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"pages\": [\n {\n \"expected_draft_version\": 1073741823,\n \"page_id\": \"<string>\"\n }\n ],\n \"pending_ops_remaining\": [\n \"<unknown>\"\n ],\n \"playlists\": [\n {\n \"playlist_id\": \"<string>\"\n }\n ]\n },\n \"type\": \"hub_publishes\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes")
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/vnd.api+json'
request.body = "{\n \"data\": {\n \"attributes\": {\n \"hub\": {\n \"branding\": {},\n \"clear_settings_keys\": [\n \"<string>\"\n ],\n \"expected_etag\": \"<string>\",\n \"navigation\": {},\n \"settings\": {}\n },\n \"media\": [\n {\n \"file_id\": \"<string>\",\n \"published_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"pages\": [\n {\n \"expected_draft_version\": 1073741823,\n \"page_id\": \"<string>\"\n }\n ],\n \"pending_ops_remaining\": [\n \"<unknown>\"\n ],\n \"playlists\": [\n {\n \"playlist_id\": \"<string>\"\n }\n ]\n },\n \"type\": \"hub_publishes\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"actor_id": "<string>",
"actor_type": "user",
"cleared_settings_keys": [
"<string>"
],
"hub_etag": "<string>",
"hub_fields_changed": [
"<string>"
],
"hub_id": "<string>",
"media": [
{
"file_id": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"visibility": "members"
}
],
"pages": [
{
"gate_count": 123,
"page_id": "<string>",
"previous_revision": 123,
"published_revision": 123,
"section_count": 123,
"was_new": true
}
],
"pending_ops_version": 123,
"pending_ops_version_consumed": 123,
"playlists": [
{
"action": "publish",
"playlist_id": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"visibility": "members"
}
],
"published_at": "2023-11-07T05:31:56Z",
"skipped_page_ids": [
"<string>"
],
"skipped_playlist_ids": [
"<string>"
]
},
"id": "<string>",
"type": "hub_publishes"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Create Hub Publish
Publish all: the listed pages’ drafts, the hub fields, the media and playlist items, the pending-ops queue replace and the publish record — in ONE transaction. Any failure changes nothing.
Pages whose draft equals their published tree, or that have no draft, are
skipped (skipped_page_ids), never republished. If-Match is the
pending-ops version; the response’s ETag is the new one.
Errors: 428 precondition_required; 400 invalid_if_match /
invalid_hub_etag; 409 stale_pending_ops / stale_draft /
stale_hub / version_space_exhausted; 422 page_not_found /
media_target_not_found / input_bound_exceeded / duplicate_item /
nothing_to_publish / hub_etag_required / settings_key_not_clearable /
clear_key_conflict / navigation_target_unpublished /
navigation_page_invalid / compiler_invariant / unknown_access_rule;
503 media_module_disabled / publish_timed_out. Item errors carry
source.pointer (request order) and meta.item.
curl --request POST \
--url https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"attributes": {
"hub": {
"branding": {},
"clear_settings_keys": [
"<string>"
],
"expected_etag": "<string>",
"navigation": {},
"settings": {}
},
"media": [
{
"file_id": "<string>",
"published_at": "2023-11-07T05:31:56Z"
}
],
"pages": [
{
"expected_draft_version": 1073741823,
"page_id": "<string>"
}
],
"pending_ops_remaining": [
"<unknown>"
],
"playlists": [
{
"playlist_id": "<string>"
}
]
},
"type": "hub_publishes"
}
}
'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes"
payload = { "data": {
"attributes": {
"hub": {
"branding": {},
"clear_settings_keys": ["<string>"],
"expected_etag": "<string>",
"navigation": {},
"settings": {}
},
"media": [
{
"file_id": "<string>",
"published_at": "2023-11-07T05:31:56Z"
}
],
"pages": [
{
"expected_draft_version": 1073741823,
"page_id": "<string>"
}
],
"pending_ops_remaining": ["<unknown>"],
"playlists": [{ "playlist_id": "<string>" }]
},
"type": "hub_publishes"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
attributes: {
hub: {
branding: {},
clear_settings_keys: ['<string>'],
expected_etag: '<string>',
navigation: {},
settings: {}
},
media: [{file_id: '<string>', published_at: '2023-11-07T05:31:56Z'}],
pages: [{expected_draft_version: 1073741823, page_id: '<string>'}],
pending_ops_remaining: ['<unknown>'],
playlists: [{playlist_id: '<string>'}]
},
type: 'hub_publishes'
}
})
};
fetch('https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes', 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.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes",
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([
'data' => [
'attributes' => [
'hub' => [
'branding' => [
],
'clear_settings_keys' => [
'<string>'
],
'expected_etag' => '<string>',
'navigation' => [
],
'settings' => [
]
],
'media' => [
[
'file_id' => '<string>',
'published_at' => '2023-11-07T05:31:56Z'
]
],
'pages' => [
[
'expected_draft_version' => 1073741823,
'page_id' => '<string>'
]
],
'pending_ops_remaining' => [
'<unknown>'
],
'playlists' => [
[
'playlist_id' => '<string>'
]
]
],
'type' => 'hub_publishes'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes"
payload := strings.NewReader("{\n \"data\": {\n \"attributes\": {\n \"hub\": {\n \"branding\": {},\n \"clear_settings_keys\": [\n \"<string>\"\n ],\n \"expected_etag\": \"<string>\",\n \"navigation\": {},\n \"settings\": {}\n },\n \"media\": [\n {\n \"file_id\": \"<string>\",\n \"published_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"pages\": [\n {\n \"expected_draft_version\": 1073741823,\n \"page_id\": \"<string>\"\n }\n ],\n \"pending_ops_remaining\": [\n \"<unknown>\"\n ],\n \"playlists\": [\n {\n \"playlist_id\": \"<string>\"\n }\n ]\n },\n \"type\": \"hub_publishes\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+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.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"attributes\": {\n \"hub\": {\n \"branding\": {},\n \"clear_settings_keys\": [\n \"<string>\"\n ],\n \"expected_etag\": \"<string>\",\n \"navigation\": {},\n \"settings\": {}\n },\n \"media\": [\n {\n \"file_id\": \"<string>\",\n \"published_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"pages\": [\n {\n \"expected_draft_version\": 1073741823,\n \"page_id\": \"<string>\"\n }\n ],\n \"pending_ops_remaining\": [\n \"<unknown>\"\n ],\n \"playlists\": [\n {\n \"playlist_id\": \"<string>\"\n }\n ]\n },\n \"type\": \"hub_publishes\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/publishes")
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/vnd.api+json'
request.body = "{\n \"data\": {\n \"attributes\": {\n \"hub\": {\n \"branding\": {},\n \"clear_settings_keys\": [\n \"<string>\"\n ],\n \"expected_etag\": \"<string>\",\n \"navigation\": {},\n \"settings\": {}\n },\n \"media\": [\n {\n \"file_id\": \"<string>\",\n \"published_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"pages\": [\n {\n \"expected_draft_version\": 1073741823,\n \"page_id\": \"<string>\"\n }\n ],\n \"pending_ops_remaining\": [\n \"<unknown>\"\n ],\n \"playlists\": [\n {\n \"playlist_id\": \"<string>\"\n }\n ]\n },\n \"type\": \"hub_publishes\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"actor_id": "<string>",
"actor_type": "user",
"cleared_settings_keys": [
"<string>"
],
"hub_etag": "<string>",
"hub_fields_changed": [
"<string>"
],
"hub_id": "<string>",
"media": [
{
"file_id": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"visibility": "members"
}
],
"pages": [
{
"gate_count": 123,
"page_id": "<string>",
"previous_revision": 123,
"published_revision": 123,
"section_count": 123,
"was_new": true
}
],
"pending_ops_version": 123,
"pending_ops_version_consumed": 123,
"playlists": [
{
"action": "publish",
"playlist_id": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"visibility": "members"
}
],
"published_at": "2023-11-07T05:31:56Z",
"skipped_page_ids": [
"<string>"
],
"skipped_playlist_ids": [
"<string>"
]
},
"id": "<string>",
"type": "hub_publishes"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
Body of POST …/hubs/{hub_id}/publishes. The pending-ops queue version
travels in the If-Match header, not here.
Show child attributes
Show child attributes
Response
Successful Response
Show child attributes
Show child attributes