curl --request POST \
--url https://api.member.dev/api/v1/teams/{team_id}/hubs/from-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"attributes": {
"catalog_digest": "<string>",
"hub_template_id": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"overrides": {
"favicon_url": "<string>",
"logo_url": "<string>",
"publish": false,
"registration_enabled": true
}
},
"type": "hub_scaffolds"
}
}
'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/hubs/from-template"
payload = { "data": {
"attributes": {
"catalog_digest": "<string>",
"hub_template_id": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"overrides": {
"favicon_url": "<string>",
"logo_url": "<string>",
"publish": False,
"registration_enabled": True
}
},
"type": "hub_scaffolds"
} }
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: {
catalog_digest: '<string>',
hub_template_id: '<string>',
name: '<string>',
slug: '<string>',
description: '<string>',
overrides: {
favicon_url: '<string>',
logo_url: '<string>',
publish: false,
registration_enabled: true
}
},
type: 'hub_scaffolds'
}
})
};
fetch('https://api.member.dev/api/v1/teams/{team_id}/hubs/from-template', 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/from-template",
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' => [
'catalog_digest' => '<string>',
'hub_template_id' => '<string>',
'name' => '<string>',
'slug' => '<string>',
'description' => '<string>',
'overrides' => [
'favicon_url' => '<string>',
'logo_url' => '<string>',
'publish' => false,
'registration_enabled' => true
]
],
'type' => 'hub_scaffolds'
]
]),
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/from-template"
payload := strings.NewReader("{\n \"data\": {\n \"attributes\": {\n \"catalog_digest\": \"<string>\",\n \"hub_template_id\": \"<string>\",\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"overrides\": {\n \"favicon_url\": \"<string>\",\n \"logo_url\": \"<string>\",\n \"publish\": false,\n \"registration_enabled\": true\n }\n },\n \"type\": \"hub_scaffolds\"\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/from-template")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"attributes\": {\n \"catalog_digest\": \"<string>\",\n \"hub_template_id\": \"<string>\",\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"overrides\": {\n \"favicon_url\": \"<string>\",\n \"logo_url\": \"<string>\",\n \"publish\": false,\n \"registration_enabled\": true\n }\n },\n \"type\": \"hub_scaffolds\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/hubs/from-template")
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 \"catalog_digest\": \"<string>\",\n \"hub_template_id\": \"<string>\",\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"overrides\": {\n \"favicon_url\": \"<string>\",\n \"logo_url\": \"<string>\",\n \"publish\": false,\n \"registration_enabled\": true\n }\n },\n \"type\": \"hub_scaffolds\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"created_resource_ids": {},
"hub_id": "<string>",
"replayed": true,
"summary": [
{
"action": "created",
"resource": "<string>",
"reason": "<string>"
}
]
},
"id": "<string>",
"type": "hub_scaffolds"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Admin Scaffold Hub From Template
Create a hub from a hubTemplate in ONE transaction (spec §5, create mode).
Returns 201 with the hub id plus the ordered per-resource summary
(created / skipped / reason), so a caller can tell what actually happened
without diffing the hub. A REPLAY (same Idempotency-Key, same request)
returns 201 with the SAME summary and replayed: true.
Error codes
405 Allow: DELETE, GET, PATCH — HUB_SCAFFOLD_ENABLED is False;
the route answers exactly like a
backend without this op. Enforced by
_FlagGatedAPIRoute BEFORE body
parsing, auth and the rate limiter
(module docstring).
400 idempotency_key_invalid — Idempotency-Key missing, empty, or
over 255 characters.
409 catalog_digest_mismatch — the client’s catalog digest is stale.
404 template_not_found — hubTemplateId/pageTemplateId unknown to
the served catalog.
409 template_not_scaffoldable— the hubTemplate’s lifecycle is not
scaffold-eligible.
422 invalid_scaffold_request — a malformed template block (spaces,
onboarding, policies, playlists,
navigation), an unresolved token, an
invalid page tree, a batch-limit or
payload-size breach, or an
unresolvable welcome-post space/author.
409 hub_slug_unavailable — no unique hub slug could be minted
after HubService.create’s race
retries.
409 hub_resource_conflict — a child resource (space slug, attribute
definition slug, playlist item) was
claimed concurrently mid-op.
409 page_conflict /
reserved_page_conflict — the page matrix’s own conflicts.
409 idempotency_fingerprint_mismatch — the Idempotency-Key was reused
with a different request, or lost a
concurrent claim race.
EVERY code above is a ScaffoldError subclass RAISED out of this handler
— never returned inline — and mapped by the centrally-registered
scaffold_error_handler, which runs AFTER get_db()’s except-branch
has rolled the whole transaction back. See the module docstring.
curl --request POST \
--url https://api.member.dev/api/v1/teams/{team_id}/hubs/from-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"attributes": {
"catalog_digest": "<string>",
"hub_template_id": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"overrides": {
"favicon_url": "<string>",
"logo_url": "<string>",
"publish": false,
"registration_enabled": true
}
},
"type": "hub_scaffolds"
}
}
'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/hubs/from-template"
payload = { "data": {
"attributes": {
"catalog_digest": "<string>",
"hub_template_id": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"overrides": {
"favicon_url": "<string>",
"logo_url": "<string>",
"publish": False,
"registration_enabled": True
}
},
"type": "hub_scaffolds"
} }
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: {
catalog_digest: '<string>',
hub_template_id: '<string>',
name: '<string>',
slug: '<string>',
description: '<string>',
overrides: {
favicon_url: '<string>',
logo_url: '<string>',
publish: false,
registration_enabled: true
}
},
type: 'hub_scaffolds'
}
})
};
fetch('https://api.member.dev/api/v1/teams/{team_id}/hubs/from-template', 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/from-template",
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' => [
'catalog_digest' => '<string>',
'hub_template_id' => '<string>',
'name' => '<string>',
'slug' => '<string>',
'description' => '<string>',
'overrides' => [
'favicon_url' => '<string>',
'logo_url' => '<string>',
'publish' => false,
'registration_enabled' => true
]
],
'type' => 'hub_scaffolds'
]
]),
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/from-template"
payload := strings.NewReader("{\n \"data\": {\n \"attributes\": {\n \"catalog_digest\": \"<string>\",\n \"hub_template_id\": \"<string>\",\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"overrides\": {\n \"favicon_url\": \"<string>\",\n \"logo_url\": \"<string>\",\n \"publish\": false,\n \"registration_enabled\": true\n }\n },\n \"type\": \"hub_scaffolds\"\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/from-template")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"attributes\": {\n \"catalog_digest\": \"<string>\",\n \"hub_template_id\": \"<string>\",\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"overrides\": {\n \"favicon_url\": \"<string>\",\n \"logo_url\": \"<string>\",\n \"publish\": false,\n \"registration_enabled\": true\n }\n },\n \"type\": \"hub_scaffolds\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/hubs/from-template")
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 \"catalog_digest\": \"<string>\",\n \"hub_template_id\": \"<string>\",\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"overrides\": {\n \"favicon_url\": \"<string>\",\n \"logo_url\": \"<string>\",\n \"publish\": false,\n \"registration_enabled\": true\n }\n },\n \"type\": \"hub_scaffolds\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"created_resource_ids": {},
"hub_id": "<string>",
"replayed": true,
"summary": [
{
"action": "created",
"resource": "<string>",
"reason": "<string>"
}
]
},
"id": "<string>",
"type": "hub_scaffolds"
}
}{
"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
Path Parameters
Body
Show child attributes
Show child attributes
Response
Successful Response
Show child attributes
Show child attributes