Change a website page
Rewrites the document, the metadata or the address of one page. Needs content: write, and is a write.
Send at least one of path, html and meta. An omitted property is left alone; html replaces the whole document, because a page is one document and there is nothing in it Commune understands well enough to patch.
kind and status are not here. The kind decides whether path is a path or a pattern, so changing it would make a valid page invalid in one statement; the state has two operations of its own, so that an edit to your text cannot put a page live by accident.
If the page is published the change is live immediately. Changing an article pattern keeps the old URLs working: a request to one of them is redirected to the article's new address.
Publishes no event.
Request
- Base URL: https://api.usecommune.com
- URL: https://api.usecommune.com/website-pages/{page}
- Auth: one of:
- HTTP bearer
- OAuth 2 (authorization code, authorization URL https://usecommune.com/api/oauth/authorize, token URL https://usecommune.com/api/oauth/token, scopes: content:write)
Headers
A value of your choosing naming the change this request is making.
Send the same value again to retry the same request. Commune replays the answer the first attempt gave instead of making the change twice, and marks the replay with an Idempotent-Replay: true response header. Send a different value for a different change: a key reused for a request that differs in any way answers 409, because replaying an answer to a question you did not ask is a wrong answer you could not detect.
A UUID per change is the usual choice. Remembered for 24 hours, per credential, so two credentials choosing the same value never see each other's answers.
Required, not optional.
Request body
Response
The page as it stands after the change.
Example response
{
"newsletter": {
"object": "newsletter",
"id": "9a4c1c6e-0f2b-4f47-9d3f-6d1b1a2c3d4e"
},
"path": "/about"
}Changes
No recorded changes to this operation across all 1 revision of this API.