Skip to content

Website API ​

The SaaS edition's public website (installation administrators) — its own pages in every language and its search settings.

All paths are relative to https://your-site.com/api/v1. Send Authorization: Bearer <token> and Accept: application/json; see authentication and errors.

MethodPathWhat it does
GET/site-pages/filesThe latest pictures and documents uploaded for the website's pages (administrators; 100)
POST/site-pages/filesUploads a picture or a document for the website's pages (administrators)
GET/site-pagesEvery website page with its title in the default language and its languages
POST/site-pagesCreates a website page
POST/site-pages/startersAdds the starter legal pages that don't exist yet (terms, privacy, refunds, cookies) as drafts
POST/site-pages/previewA body as the website shows it (cleaned HTML; Markdown converted)
GET/site-pages/{page}One website page with every language's text
PUT/site-pages/{page}Changes a website page
DELETE/site-pages/{page}Deletes a website page (every language)
GET/site/seoThe website's search and sharing settings
PUT/site/seoSaves search and sharing settings (fields left out keep their value)
POST/site/seo/imageUploads the sharing picture (made 1200 × 630 JPEG)
DELETE/site/seo/imageRemoves the sharing picture

GET /site-pages/files ​

The latest pictures and documents uploaded for the website's pages (administrators; 100)

Responses ​

  • 200 — url, name (original), kind (image or document), mime, size of each.
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
bash
curl -X GET "https://your-site.com/api/v1/site-pages/files" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

POST /site-pages/files ​

Uploads a picture or a document for the website's pages (administrators)

Pictures (PNG, JPEG, GIF, WebP up to 10 MB) are drawn again, at most 2400 px wide; documents (PDF, Word, Excel, PowerPoint, OpenDocument, TXT, CSV, ZIP up to 20 MB) are kept as uploaded. Served at the answered url: pictures and PDFs in the browser, other documents as downloads.

Request body ​

multipart/form-data

FieldTypeRequiredDescription
filestring (binary)yes
kindstringOne of: image, document.

Responses ​

  • 201 — The file: url, name, kind, mime, size.
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
  • 422 —
bash
curl -X POST "https://your-site.com/api/v1/site-pages/files" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json" \
  -F "file=…" \
  -F "kind=…"

GET /site-pages ​

Every website page with its title in the default language and its languages

Responses ​

  • 200 — Pages; meta.locales and meta.default_locale.
  • 403 — Not an installation administrator, or not a full-access token.
bash
curl -X GET "https://your-site.com/api/v1/site-pages" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

POST /site-pages ​

Creates a website page

Request body ​

application/json, required

FieldTypeRequiredDescription
slugstringyesNot an address the app uses. At most 80 characters. Pattern ^[a-z0-9]+(?:-[a-z0-9]+)*$.
statusstringOne of: draft, published.
menustringOne of: none, header, footer.
positionintegerMinimum 0. Maximum 9999.
noindexboolean
translationsobjectyesLanguage code => text; the default language is required, languages left out are removed.

Responses ​

  • 201 — Created.
  • 403 — Not an installation administrator, or not a full-access token.
  • 422 — Validation failed.
Response fields
FieldTypeRequiredDescription
dataobject
data.idinteger
data.slugstring
data.statusstringOne of: draft, published.
data.menustringOne of: none, header, footer.
data.positioninteger
data.noindexboolean
data.urlstring
data.published_atstring, nullable
data.updated_atstring, nullable
data.translationsobject
bash
curl -X POST "https://your-site.com/api/v1/site-pages" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"slug":"text","status":"draft","menu":"none","position":0,"noindex":true,"translations":{}}'

POST /site-pages/starters ​

Adds the starter legal pages that don't exist yet (terms, privacy, refunds, cookies) as drafts

Written in the default language, filled with config pages.* (company, country, contact email, refund days); unset details stay as [placeholders].

Responses ​

  • 201 — data.added: the addresses added.
  • 403 — Not an installation administrator.
Response fields
FieldTypeRequiredDescription
dataobject
data.addedstring[]
bash
curl -X POST "https://your-site.com/api/v1/site-pages/starters" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

POST /site-pages/preview ​

A body as the website shows it (cleaned HTML; Markdown converted)

Request body ​

application/json, required

FieldTypeRequiredDescription
formatstringyesOne of: html, markdown.
bodystring, nullable

Responses ​

  • 200 — data.html
  • 403 — Not an installation administrator.
  • 422 — Validation failed.
Response fields
FieldTypeRequiredDescription
dataobject
data.htmlstring
bash
curl -X POST "https://your-site.com/api/v1/site-pages/preview" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"format":"html","body":"text"}'

GET /site-pages/{page} ​

One website page with every language's text

Parameters ​

NameInTypeRequiredDescription
pagepathintegeryes

Responses ​

  • 200 — OK
  • 403 — Not an installation administrator.
  • 404 — Missing, or another account's.
Response fields
FieldTypeRequiredDescription
dataobject
data.idinteger
data.slugstring
data.statusstringOne of: draft, published.
data.menustringOne of: none, header, footer.
data.positioninteger
data.noindexboolean
data.urlstring
data.published_atstring, nullable
data.updated_atstring, nullable
data.translationsobject
bash
curl -X GET "https://your-site.com/api/v1/site-pages/{page}" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

PUT /site-pages/{page} ​

Changes a website page

Parameters ​

NameInTypeRequiredDescription
pagepathintegeryes

Request body ​

application/json, required

FieldTypeRequiredDescription
slugstringyesNot an address the app uses. At most 80 characters. Pattern ^[a-z0-9]+(?:-[a-z0-9]+)*$.
statusstringOne of: draft, published.
menustringOne of: none, header, footer.
positionintegerMinimum 0. Maximum 9999.
noindexboolean
translationsobjectyesLanguage code => text; the default language is required, languages left out are removed.

Responses ​

  • 200 — OK
  • 403 — Not an installation administrator.
  • 404 — Missing, or another account's.
  • 422 — Validation failed.
Response fields
FieldTypeRequiredDescription
dataobject
data.idinteger
data.slugstring
data.statusstringOne of: draft, published.
data.menustringOne of: none, header, footer.
data.positioninteger
data.noindexboolean
data.urlstring
data.published_atstring, nullable
data.updated_atstring, nullable
data.translationsobject
bash
curl -X PUT "https://your-site.com/api/v1/site-pages/{page}" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"slug":"text","status":"draft","menu":"none","position":0,"noindex":true,"translations":{}}'

DELETE /site-pages/{page} ​

Deletes a website page (every language)

Parameters ​

NameInTypeRequiredDescription
pagepathintegeryes

Responses ​

  • 204 — Deleted.
  • 403 — Not an installation administrator.
  • 404 — Missing, or another account's.
bash
curl -X DELETE "https://your-site.com/api/v1/site-pages/{page}" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

GET /site/seo ​

The website's search and sharing settings

Responses ​

  • 200 — OK
  • 403 — Not an installation administrator.
Response fields
FieldTypeRequiredDescription
dataobject
data.titlestring
data.descriptionstring
data.keywordsstring
data.twitterstring
data.google_verificationstring
data.bing_verificationstring
data.noindexboolean
data.consentboolean
data.head_codestring
data.body_codestring
data.og_imagestring, nullable
bash
curl -X GET "https://your-site.com/api/v1/site/seo" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

PUT /site/seo ​

Saves search and sharing settings (fields left out keep their value)

Request body ​

application/json, required

FieldTypeRequiredDescription
titlestringAt most 70 characters.
descriptionstringAt most 300 characters.
keywordsstringAt most 300 characters.
twitterstringAt most 30 characters.
google_verificationstringAt most 100 characters.
bing_verificationstringAt most 100 characters.
noindexboolean
consentbooleanAsk visitors (cookie banner) before the custom code loads; default true.
head_codestringAt most 20000 characters.
body_codestringAt most 20000 characters.

Responses ​

  • 200 — OK
  • 403 — Not an installation administrator.
  • 422 — Validation failed.
Response fields
FieldTypeRequiredDescription
dataobject
data.titlestring
data.descriptionstring
data.keywordsstring
data.twitterstring
data.google_verificationstring
data.bing_verificationstring
data.noindexboolean
data.consentboolean
data.head_codestring
data.body_codestring
data.og_imagestring, nullable
bash
curl -X PUT "https://your-site.com/api/v1/site/seo" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"title":"text","description":"text","keywords":"text","twitter":"text","google_verification":"text","bing_verification":"text","noindex":true,"consent":true,"head_code":"text","body_code":"text"}'

POST /site/seo/image ​

Uploads the sharing picture (made 1200 × 630 JPEG)

Request body ​

multipart/form-data, required

FieldTypeRequiredDescription
filestring (binary)yes

Responses ​

  • 200 — OK
  • 403 — Not an installation administrator.
  • 422 — Validation failed.
Response fields
FieldTypeRequiredDescription
dataobject
data.titlestring
data.descriptionstring
data.keywordsstring
data.twitterstring
data.google_verificationstring
data.bing_verificationstring
data.noindexboolean
data.consentboolean
data.head_codestring
data.body_codestring
data.og_imagestring, nullable
bash
curl -X POST "https://your-site.com/api/v1/site/seo/image" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json" \
  -F "file=…"

DELETE /site/seo/image ​

Removes the sharing picture

Responses ​

  • 200 — OK
  • 403 — Not an installation administrator.
Response fields
FieldTypeRequiredDescription
dataobject
data.titlestring
data.descriptionstring
data.keywordsstring
data.twitterstring
data.google_verificationstring
data.bing_verificationstring
data.noindexboolean
data.consentboolean
data.head_codestring
data.body_codestring
data.og_imagestring, nullable
bash
curl -X DELETE "https://your-site.com/api/v1/site/seo/image" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

Replora: see what your visitors see.