The Update Page endpoint publishes an update to an existing Tettra page from the given arguments. At least one of the optional arguments must be provided to make any update.
URL: https://app.tettra.co/api/teams/{{team_id}}/pages/{{page_id}}
HTTP Method: PATCH
Arguments:
api_key
- required - your API key; this determines the author of the page updatepage_id
- required - the unique ID of the page you are updating; this is returned via the Create Page or Search endpoints.owner_id
- optional - the updated owner of the page.title
- optional - the updated title of the page.body
- optional - the updated body of the page formatted as HTML; this will completely replace the current page content, but the previous content can be restored via version history. category_id
- optional - the updated category to publish the page to.subcategory_id
- optional - the updated subcategory to publish the page to; this must be a subcategory of the category specified in category_id.Example of updating a page using all arguments:
curl --request PATCH \
--url https://app.tettra.co/api/teams/2/pages/1375772 \
--header 'Content-Type: application/json' \
--data '{
"api_key" : "xxxxxxxxxxxxxxxxxx1234567890",
"owner_id": 227149,
"title": "An Updated Awesome Page",
"body": "<h1>Hello World<\/h1><br><p>Something was updated<\/p>",
"category_id": 243068,
"subcategory_id": 125618
}'
Example Response:
{
"success": true,
"pageUrl": "https://app.tettra.co/teams/tettra/pages/an-updated-awesome-page",
"pageId": 1375772,
"revisionId": 3268639,
"categoryId": 243068,
"subcategoryId": 125618
}
Example of moving the page to a different subcategory using the category and subcategory arguments:
curl --request PATCH \
--url https://app.tettra.co/api/teams/2/pages/1375772 \
--header 'Content-Type: application/json' \
--data '{
"api_key" : "xxxxxxxxxxxxxxxxxx1234567890",
"category_id": 243068,
"subcategory_id": 125617
}'