curl --request POST \
--url https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/content/reconcile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "content_node_reconciliations",
"attributes": {
"playlist_ids": [
"<string>"
]
}
}
}
'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/content/reconcile"
payload = { "data": {
"type": "content_node_reconciliations",
"attributes": { "playlist_ids": ["<string>"] }
} }
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: {type: 'content_node_reconciliations', attributes: {playlist_ids: ['<string>']}}
})
};
fetch('https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/content/reconcile', 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}/content/reconcile",
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' => [
'type' => 'content_node_reconciliations',
'attributes' => [
'playlist_ids' => [
'<string>'
]
]
]
]),
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}/content/reconcile"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"content_node_reconciliations\",\n \"attributes\": {\n \"playlist_ids\": [\n \"<string>\"\n ]\n }\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}/content/reconcile")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"content_node_reconciliations\",\n \"attributes\": {\n \"playlist_ids\": [\n \"<string>\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/content/reconcile")
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 \"type\": \"content_node_reconciliations\",\n \"attributes\": {\n \"playlist_ids\": [\n \"<string>\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"hub_id": "<string>",
"results": [
{
"legacy_hash": "<string>",
"node_type": "<string>",
"outcome": "<string>",
"member_visible": true,
"node_id": "<string>",
"reason": "<string>"
}
]
},
"id": "<string>",
"type": "content_node_reconciliations"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Reconcile Hub Content
Materialize content_nodes for a hub’s provenance-scoped playlists (D4).
A bodyless POST (or a body with attributes omitted / playlist_ids
omitted) derives the playlist set from this hub’s OWN
HubTemplateApplication history — the common case, and the intended
default usage for both an operator running this after a data issue and
mio-cli re-running it after its own step sequence. Passing an
explicit playlist_ids list is for the one case provenance cannot
cover (a hub with no application record at all — see the plan’s §6 open
question); every id in that list must belong to THIS hub.
Idempotent by construction: ContentService.ensure_nodes hash-first
resolves every spec (D6), so calling this twice in a row with the SAME
resolved playlist set adopts everything the first call created rather
than creating it again — zero duplicate rows, zero duplicate INSERT
attempts on the second call.
Returns 200 with one result per resolved NodeSpec, in the full D7
outcome vocabulary (created / adopted / adopted_not_member_visible /
skipped_*, including skipped_identity_mismatch) — nothing is log-only,
so a caller can tell exactly what happened without diffing the hub.
skipped_identity_mismatch names the locked row when one was found, and
carries no node id when the lesson’s media is missing or soft-deleted.
Error codes
404 hub_not_found — hub_id does not exist, or belongs to
a different team than team_id
(enumeration-safe: both cases 404
identically).
409 reconcile_conflict — playlist membership changed while this
reconcile was taking its locks. Nothing
was written. Retry the request.
422 no_playlist_provenance — the hub has no HubTemplateApplication
row carrying any playlist ids, AND no
playlist_ids were supplied in the
request body.
422 playlist_not_in_hub — one or more ids in an explicit
playlist_ids list do not resolve to
a Playlist scoped to THIS hub
(meta.invalid_playlist_ids lists
which).
429 — rate limit (60/hr/IP) exceeded.
RAISE, NEVER RETURN: every rejection above is an AppException
subclass (NotFoundError / ValidationError / ConflictError,
app/infrastructure/exceptions.py) raised out of
HubContentReconcileService.reconcile and left to propagate uncaught
— never caught here and turned into a hand-rolled JSONResponse. They
are mapped by the centrally-registered app_exception_handler
(app/main.py), which runs AFTER get_db()’s except-branch has
already rolled back anything ensure_nodes flushed before the
rejection. A handler that instead caught one of these and RETURNED an
error response would return NORMALLY from this route, sending
get_db() down its commit branch instead — durably persisting
whatever partial work happened before the error. See
app/hub_scaffold/reconcile_service.py’s module docstring for the
same contract stated from the service side.
curl --request POST \
--url https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/content/reconcile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "content_node_reconciliations",
"attributes": {
"playlist_ids": [
"<string>"
]
}
}
}
'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/content/reconcile"
payload = { "data": {
"type": "content_node_reconciliations",
"attributes": { "playlist_ids": ["<string>"] }
} }
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: {type: 'content_node_reconciliations', attributes: {playlist_ids: ['<string>']}}
})
};
fetch('https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/content/reconcile', 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}/content/reconcile",
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' => [
'type' => 'content_node_reconciliations',
'attributes' => [
'playlist_ids' => [
'<string>'
]
]
]
]),
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}/content/reconcile"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"content_node_reconciliations\",\n \"attributes\": {\n \"playlist_ids\": [\n \"<string>\"\n ]\n }\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}/content/reconcile")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"content_node_reconciliations\",\n \"attributes\": {\n \"playlist_ids\": [\n \"<string>\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/content/reconcile")
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 \"type\": \"content_node_reconciliations\",\n \"attributes\": {\n \"playlist_ids\": [\n \"<string>\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"hub_id": "<string>",
"results": [
{
"legacy_hash": "<string>",
"node_type": "<string>",
"outcome": "<string>",
"member_visible": true,
"node_id": "<string>",
"reason": "<string>"
}
]
},
"id": "<string>",
"type": "content_node_reconciliations"
}
}{
"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.
Body
Show child attributes
Show child attributes
Response
Successful Response
Show child attributes
Show child attributes