curl --request POST \
--url https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate', 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}/pages/{page_id}/duplicate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate"
req, _ := http.NewRequest("POST", 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.post("https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"created_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"draft_version": 123,
"hub_id": "<string>",
"icon": "<string>",
"is_homepage": true,
"last_published_at": "2023-11-07T05:31:56Z",
"meta": {},
"parent_page_id": "<string>",
"position": 123,
"privacy": "<string>",
"purge_at": "2023-11-07T05:31:56Z",
"settings": {},
"slug": "<string>",
"title": "<string>",
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"id": "<string>",
"links": {
"self": "<string>"
},
"type": "pages"
}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Admin Duplicate Page
Duplicate a page into a new, unpublished page in the same hub.
The copy gets the title with ” copy” appended, the same type, privacy,
settings, icon and position, and the source’s content tree (its draft if
it has one, else its published tree) as its draft. It is never the
homepage and has never been published. Its slug is <slug>-copy, or
<slug>-copy-2, -copy-3 and so on when that is taken.
Access gates are cloned, not shared: each gated node in the copy gets a new node id and its own new access rule with the same operator and conditions, so editing a gate on one page never changes the other. Content and media the tree references are shared, not copied.
No request body. Returns 201 with the new page and a Location header.
curl --request POST \
--url https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate', 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}/pages/{page_id}/duplicate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate"
req, _ := http.NewRequest("POST", 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.post("https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"created_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"draft_version": 123,
"hub_id": "<string>",
"icon": "<string>",
"is_homepage": true,
"last_published_at": "2023-11-07T05:31:56Z",
"meta": {},
"parent_page_id": "<string>",
"position": 123,
"privacy": "<string>",
"purge_at": "2023-11-07T05:31:56Z",
"settings": {},
"slug": "<string>",
"title": "<string>",
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"id": "<string>",
"links": {
"self": "<string>"
},
"type": "pages"
}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"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.
Response
Successful Response
Single-resource JSON:API response for admin page reads.
JSON:API resource object for admin page reads (includes draft_version).
Show child attributes
Show child attributes