Create a website page
Writes a page of this newsletter's website. Needs content: write, and is a write.
A page is free-form HTML, CSS and JavaScript that you own outright. There is no template, no enforced layout and no deploy step: an edit to a published page is live the moment it commits.
kind decides what path means and cannot be changed afterwards.
- page is a fixed path. Anything you like: /about, /subscribe.
- newsletter is the article list, and its path is where a reader clicking the newsletter's name or avatar inside Commune arrives. A newsletter may have one.
- article is a URL pattern that renders every article. It has to contain :article, and may also use :year, :month, :day and :id. A token is a whole path segment. An unknown token answers 422; two patterns that could both serve one URL answer 409.
A fixed path always beats a pattern, so /about and /:article coexist and /about is the page.
status defaults to draft, which has no public address: it is reachable only through the signed preview_url this returns. Publish a website page puts it live.
No versioning. Commune keeps the page you last wrote and nothing else, so keep your site in a repository of your own.
A document over 2MB answers 422. Move images, fonts and shared stylesheets or scripts into Store a website asset and link them.
Publishes no event.
Request
- Base URL: https://api.usecommune.com
- URL: https://api.usecommune.com/newsletters/{newsletter}/website-pages
- 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
Example request
{
"path": "/about"
}Response
The page, with its document.
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.