{"openapi":"3.1.0","info":{"title":"ShareHTML","version":"1.0.0","description":"Publish one HTML page as a link on ShareHTML. A page can be held before it goes live; follow the rules at https://sharehtml.org/acceptable-use."},"servers":[{"url":"https://sharehtml.org"}],"paths":{"/api/v1/pages":{"get":{"operationId":"listPages","summary":"List the owner’s pages","description":"The owner’s pages, newest first, with each one’s id, title, url, status and views.","responses":{"200":{"description":"The pages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageList"}}}},"default":{"description":"Refused. error.message is a plain sentence to pass on to the owner as it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"publishPage","summary":"Publish an HTML page","description":"Publishes one whole HTML page, its CSS and JavaScript inside it. Status: reviewing (not live yet, call getPage again), live (give the owner url) or held (tell the owner reasons exactly and stop; never change a held page to get it through).","parameters":[{"name":"listed","in":"query","required":false,"description":"true lists the page in search engines (Pro only). Leave it out unless the owner asks for that.","schema":{"type":"boolean"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageInput"}}}},"responses":{"201":{"description":"The new page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page"}}}},"default":{"description":"Refused. error.message is a plain sentence to pass on to the owner as it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-openai-isConsequential":false}},"/api/v1/pages/{id}":{"get":{"operationId":"getPage","summary":"Get one page","description":"One page: its status, the reasons when it is held, its url and its views this month.","parameters":[{"name":"id","in":"path","required":true,"description":"The page’s id, from publishPage or listPages.","schema":{"type":"string"}}],"responses":{"200":{"description":"The page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page"}}}},"default":{"description":"Refused. error.message is a plain sentence to pass on to the owner as it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"updatePage","summary":"Replace a page and keep its link","description":"Replaces the page’s HTML; the url stays the same. Read its status as after publishPage: the new version can be held too.","parameters":[{"name":"id","in":"path","required":true,"description":"The page’s id, from publishPage or listPages.","schema":{"type":"string"}},{"name":"listed","in":"query","required":false,"description":"true lists the page in search engines (Pro only). Leave it out unless the owner asks for that.","schema":{"type":"boolean"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageInput"}}}},"responses":{"200":{"description":"The page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page"}}}},"default":{"description":"Refused. error.message is a plain sentence to pass on to the owner as it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-openai-isConsequential":false},"patch":{"operationId":"changePageAccess","summary":"Change who can open a page, or its name","description":"Sets who can open the page, its password, its invited emails, the date its link ends, its listing or its name, with no new HTML. Locks, invites, end dates and names are part of Pro; taking them off never is. Locking a listed page unlists it.","parameters":[{"name":"id","in":"path","required":true,"description":"The page’s id, from publishPage or listPages.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageAccessInput"}}}},"responses":{"200":{"description":"The page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page"}}}},"default":{"description":"Refused. error.message is a plain sentence to pass on to the owner as it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-openai-isConsequential":false},"delete":{"operationId":"deletePage","summary":"Delete a page for good","description":"Deletes the page: its link stops working at once and is never reused. Ask the owner to confirm, naming the page, first.","parameters":[{"name":"id","in":"path","required":true,"description":"The page’s id, from publishPage or listPages.","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted."},"default":{"description":"Refused. error.message is a plain sentence to pass on to the owner as it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-openai-isConsequential":true}},"/api/v1/pages/{id}/invites":{"get":{"operationId":"listPageInvites","summary":"List the emails invited to a page","description":"For a page with access invite: each email on its list, alphabetically, with when it was added and when that person first and last opened the page (null until they do).","parameters":[{"name":"id","in":"path","required":true,"description":"The page’s id, from publishPage or listPages.","schema":{"type":"string"}}],"responses":{"200":{"description":"The invited emails.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageInviteList"}}}},"default":{"description":"Refused. error.message is a plain sentence to pass on to the owner as it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pages/{id}/versions":{"get":{"operationId":"listPageVersions","summary":"List a page’s kept versions","description":"Newest first. Pro keeps the current version and the two before it, Free only the current one. wasLive says whether visitors could open a version; only such a version can be restored.","parameters":[{"name":"id","in":"path","required":true,"description":"The page’s id, from publishPage or listPages.","schema":{"type":"string"}}],"responses":{"200":{"description":"The versions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageVersionList"}}}},"default":{"description":"Refused. error.message is a plain sentence to pass on to the owner as it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pages/{id}/versions/{version}/restore":{"post":{"operationId":"restorePageVersion","summary":"Bring back an earlier version","description":"Pro only. The earlier version becomes the current one as a new version, keeping the link, name and who can open it. Read its status as after updatePage: it can be held too.","parameters":[{"name":"id","in":"path","required":true,"description":"The page’s id, from publishPage or listPages.","schema":{"type":"string"}},{"name":"version","in":"path","required":true,"description":"A kept version’s number, from listPageVersions.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"The page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page"}}}},"default":{"description":"Refused. error.message is a plain sentence to pass on to the owner as it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-openai-isConsequential":false}},"/api/v1/account":{"get":{"operationId":"getAccount","summary":"The owner’s plan and usage","description":"The plan (free or pro), the pages used of its limit, and this month’s views against the cap (none on Pro).","responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"default":{"description":"Refused. error.message is a plain sentence to pass on to the owner as it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/analytics":{"get":{"operationId":"getAnalytics","summary":"The owner’s views, and on Pro where visitors came from","description":"Views per day for all pages or one. On Pro, breakdowns has where visitors came from (apps in plain words such as X or Google, or the site’s domain), their countries and devices, most first; on Free it is null.","parameters":[{"name":"days","in":"query","required":false,"description":"The last 7, 30 or 90 days, today included; 30 unless asked.","schema":{"type":"integer","enum":[7,30,90]}},{"name":"page","in":"query","required":false,"description":"A page’s id, from listPages, for that page alone. Leave it out for all pages.","schema":{"type":"string"}}],"responses":{"200":{"description":"The views.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Analytics"}}}},"default":{"description":"Refused. error.message is a plain sentence to pass on to the owner as it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"PageInput":{"type":"object","required":["html"],"properties":{"html":{"type":"string","description":"The whole page as one HTML file, up to 5 MB on the free plan."},"title":{"type":"string","maxLength":200,"description":"A title for a page without a <title> of its own."},"access":{"type":"string","enum":["anyone","password","invite","owner"],"description":"Who can open it: anyone (with the link), password (with the link and the password), invite (only the emails in invites, each with a code we email them there) or owner (only the owner, signed in). Locks are Pro only."},"invites":{"type":"object","description":"For access invite: emails to add (Pro, 50 on a page) and to remove (any plan). Nobody is emailed when added: give them the link. Leaving the invite lock deletes the list.","properties":{"add":{"type":"array","maxItems":50,"items":{"type":"string","format":"email"}},"remove":{"type":"array","maxItems":50,"items":{"type":"string","format":"email"}}}},"password":{"type":"string","minLength":6,"maxLength":64,"description":"The password visitors type, for access password. It is never sent back."},"expiresAt":{"type":["string","null"],"format":"date-time","description":"When the link stops working (Pro only), such as 2026-12-31T23:59:00Z; null for never."},"name":{"type":["string","null"],"description":"A name of the page’s own for its address, such as maya-art for maya-art.shrz.in (Pro only): 5 to 30 letters, numbers or hyphens; null takes it off. Any refusal reads only \"Name not available\": ask the owner for another."}}},"PageAccessInput":{"type":"object","properties":{"access":{"type":"string","enum":["anyone","password","invite","owner"],"description":"Who can open it: anyone (with the link), password (with the link and the password), invite (only the emails in invites, each with a code we email them there) or owner (only the owner, signed in). Locks are Pro only."},"invites":{"type":"object","description":"For access invite: emails to add (Pro, 50 on a page) and to remove (any plan). Nobody is emailed when added: give them the link. Leaving the invite lock deletes the list.","properties":{"add":{"type":"array","maxItems":50,"items":{"type":"string","format":"email"}},"remove":{"type":"array","maxItems":50,"items":{"type":"string","format":"email"}}}},"password":{"type":"string","minLength":6,"maxLength":64,"description":"The password visitors type, for access password. It is never sent back."},"expiresAt":{"type":["string","null"],"format":"date-time","description":"When the link stops working (Pro only), such as 2026-12-31T23:59:00Z; null for never."},"listed":{"type":"boolean"},"name":{"type":["string","null"],"description":"A name of the page’s own for its address, such as maya-art for maya-art.shrz.in (Pro only): 5 to 30 letters, numbers or hyphens; null takes it off. Any refusal reads only \"Name not available\": ask the owner for another."}}},"Page":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","description":"The link to give the owner once status is live."},"status":{"type":"string","enum":["reviewing","live","held","removed"]},"reasons":{"type":"array","items":{"type":"string"},"description":"Why it is held, to tell the owner exactly as given."},"title":{"type":["string","null"]},"listed":{"type":"boolean"},"access":{"type":"string","enum":["anyone","password","invite","owner"]},"expiresAt":{"type":["string","null"]},"name":{"type":["string","null"],"description":"The page’s own name, or null. While the owner is on Pro, url is the name."},"notice":{"type":"string","description":"What else a change did, in plain words."},"version":{"type":"integer"},"views":{"type":"integer"},"viewsThisMonth":{"type":"integer"},"versionsKept":{"type":"integer","description":"How many versions are kept, this one included (getPage only)."},"invited":{"type":"integer","description":"How many emails are invited, for access invite (getPage only)."},"look":{"type":["object","null"],"description":"How the dashboard draws the page small, read from its HTML when it was uploaded: its colours as #rrggbb and the kind of page. Null until it is worked out.","properties":{"background":{"type":"string"},"text":{"type":"string"},"accent":{"type":["string","null"]},"dark":{"type":"boolean"},"kind":{"type":"string","enum":["doc","quiz","checklist","deck","table","report","gallery","form"]},"kicker":{"type":["string","null"]},"heading":{"type":["string","null"]}}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}},"PageList":{"type":"object","properties":{"pages":{"type":"array","items":{"$ref":"#/components/schemas/Page"}}}},"PageInviteList":{"type":"object","properties":{"invites":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"invitedAt":{"type":"string"},"openedAt":{"type":["string","null"]},"lastOpenedAt":{"type":["string","null"]}}}}}},"PageVersion":{"type":"object","properties":{"version":{"type":"integer"},"bytes":{"type":"integer"},"createdAt":{"type":"string"},"wasLive":{"type":"boolean","description":"Visitors could open it once: only such a version can be restored."},"current":{"type":"boolean"}}},"PageVersionList":{"type":"object","properties":{"versions":{"type":"array","items":{"$ref":"#/components/schemas/PageVersion"}}}},"Account":{"type":"object","properties":{"email":{"type":"string"},"plan":{"type":"string","enum":["free","pro"]},"pages":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":"integer"}}},"views":{"type":"object","properties":{"thisMonth":{"type":"integer"},"cap":{"type":["integer","null"]},"resetsAt":{"type":"string"}}}}},"Analytics":{"type":"object","properties":{"month":{"type":"object","description":"This month across every page: the free plan’s cap, null on Pro.","properties":{"views":{"type":"integer"},"cap":{"type":["integer","null"]}}},"total":{"type":"object","properties":{"views":{"type":"integer"}}},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","description":"A UTC day, oldest first."},"views":{"type":"integer"}}}},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":["string","null"]},"url":{"type":"string"},"viewsThisMonth":{"type":"integer"},"totalViews":{"type":"integer"}}}},"breakdowns":{"type":["object","null"],"description":"Pro only, counted while the owner is on Pro; null on Free. Each list most views first, Other last.","properties":{"views":{"type":"integer"},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","description":"An app such as X or Google, a site’s domain, or Direct or unknown."},"views":{"type":"integer"}}}},"countries":{"type":"array","items":{"type":"object","properties":{"country":{"type":"string","description":"An ISO 3166 code; XX when not known."},"views":{"type":"integer"}}}},"devices":{"type":"array","items":{"type":"object","properties":{"device":{"type":"string","enum":["phone","tablet","computer"]},"views":{"type":"integer"}}}}}}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}},"securitySchemes":{"oauth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://sharehtml.org/oauth/authorize","tokenUrl":"https://sharehtml.org/oauth/token","refreshUrl":"https://sharehtml.org/oauth/token","scopes":{"pages:read":"See your pages and your plan","pages:write":"Publish, replace and delete your pages"}}}}}},"security":[{"oauth":["pages:read","pages:write"]}]}