Skip to content

Administration API ​

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/geoipThe visitor-location providers, in the order they are asked (installation administrators)
PUT/geoip/{provider}Switch a location provider on or off and save its credentials (switching a database on downloads it)
POST/geoip/{provider}/downloadDownload a location database now (also done weekly for the ones that are on)
GET/translations/{locale}The texts administrators changed in a language (public)
GET/admin/translationsEvery text of the product in a language (administrators)
PUT/admin/translationsChange a text in a language (administrators)
GET/admin/overviewThe installation at a glance (administrators)
GET/admin/overview/exportThe Overview as CSV (administrators; 10 per minute)
GET/users/exportEvery matching user as CSV, with the modules' columns (administrators; 10 per minute)
GET/usersEvery account that can sign in (administrators)
PATCH/users/{user}Change the role or suspend (never one's own account)
DELETE/users/{user}Remove a user (and their account with all its data when they were its last member)
GET/invitationsPending invitations
POST/invitationsInvite someone by email (the link works once, for 7 days)
DELETE/invitations/{invitation}Revoke an invitation

GET /geoip ​

The visitor-location providers, in the order they are asked (installation administrators)

headers (Cloudflare / nginx proxy headers, on by default), maxmind (GeoLite2 City database: account_id + license_key), dbip (DB-IP City Lite database, no account), ipinfo (web API: token; sends visitor addresses to IPinfo). The first that knows a field wins; later ones only fill in what is missing. Secrets are never returned: license_key / token say whether one is set. Databases show whether the file is there and when it was built.

Responses ​

  • 200 — Providers.
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
Response fields
FieldTypeRequiredDescription
dataobject[]
data[].providerstringOne of: headers, maxmind, dbip, ipinfo.
data[].enabledboolean
data[].account_idstring, nullable
data[].license_keybooleanWhether a licence key is set.
data[].tokenbooleanWhether a token is set.
data[].installedbooleanDatabases: whether the file is there.
data[].downloaded_atstring (date-time), nullable
data[].built_atstring (date-time), nullable
data[].errorstring, nullableThe last download's failure.
bash
curl -X GET "https://your-site.com/api/v1/geoip" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

PUT /geoip/{provider} ​

Switch a location provider on or off and save its credentials (switching a database on downloads it)

Parameters ​

NameInTypeRequiredDescription
providerpathstringyesOne of: headers, maxmind, dbip, ipinfo.

Request body ​

application/json, required

FieldTypeRequiredDescription
enabledboolean
account_idstring, nullableMaxMind only.
license_keystring, nullableMaxMind only.
tokenstring, nullableIPinfo only.

Responses ​

  • 200 — The provider.
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
  • 422 — Validation failed.
Response fields
FieldTypeRequiredDescription
dataobject
data.providerstringOne of: headers, maxmind, dbip, ipinfo.
data.enabledboolean
data.account_idstring, nullable
data.license_keybooleanWhether a licence key is set.
data.tokenbooleanWhether a token is set.
data.installedbooleanDatabases: whether the file is there.
data.downloaded_atstring (date-time), nullable
data.built_atstring (date-time), nullable
data.errorstring, nullableThe last download's failure.
bash
curl -X PUT "https://your-site.com/api/v1/geoip/{provider}" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true,"account_id":"text","license_key":"text","token":"text"}'

POST /geoip/{provider}/download ​

Download a location database now (also done weekly for the ones that are on)

Parameters ​

NameInTypeRequiredDescription
providerpathstringyesOne of: maxmind, dbip.

Responses ​

  • 200 — The provider.
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
  • 422 — The download failed (the message says why).
Response fields
FieldTypeRequiredDescription
dataobject
data.providerstringOne of: headers, maxmind, dbip, ipinfo.
data.enabledboolean
data.account_idstring, nullable
data.license_keybooleanWhether a licence key is set.
data.tokenbooleanWhether a token is set.
data.installedbooleanDatabases: whether the file is there.
data.downloaded_atstring (date-time), nullable
data.built_atstring (date-time), nullable
data.errorstring, nullableThe last download's failure.
bash
curl -X POST "https://your-site.com/api/v1/geoip/{provider}/download" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

GET /translations/{locale} ​

The texts administrators changed in a language (public)

Source text (English) => the text shown instead of the shipped translation. The dashboard loads them over its own translations; the server applies them itself.

No sign-in needed

This endpoint is public.

Parameters ​

NameInTypeRequiredDescription
localepathstringyesPattern ^[a-z]{2}$.

Responses ​

  • 200 — The changed texts.
  • 404 — Missing, or another account's.
Response fields
FieldTypeRequiredDescription
dataobject
bash
curl -X GET "https://your-site.com/api/v1/translations/{locale}" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

GET /admin/translations ​

Every text of the product in a language (administrators)

The dashboard's, the website's and the server's texts (emails, messages), 50 per page, by their English source text, with the shipped translation and the administrators' own wording (null: none).

Parameters ​

NameInTypeRequiredDescription
localequerystringyes
qquerystringMatches the source text, the translation or the changed text. At most 200 characters.
areaquerystringOne of: dashboard, website, server.
changedquerybooleanOnly the changed texts.
pagequeryintegerMinimum 1.

Responses ​

  • 200 — The texts.
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
  • 422 —
Response fields
FieldTypeRequiredDescription
dataobject[]
data[].keystring
data[].translationstring
data[].valuestring, nullable
data[].areasstring[]
metaobject
meta.pageinteger
meta.totalinteger
meta.last_pageinteger
meta.changedinteger
meta.localesstring[]
bash
curl -X GET "https://your-site.com/api/v1/admin/translations" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

PUT /admin/translations ​

Change a text in a language (administrators)

Request body ​

application/json, required

FieldTypeRequiredDescription
localestringyes
keystringyesThe English source text.
valuestring, nullableyesThe text to show; empty or null: back to the shipped translation.

Responses ​

  • 200 — data:
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
  • 404 — The text isn't used in the product.
  • 422 —
bash
curl -X PUT "https://your-site.com/api/v1/admin/translations" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"locale":"text","key":"text","value":"text"}'

GET /admin/overview ​

The installation at a glance (administrators)

Headline numbers (with the period before), daily series, breakdowns and lists from the core and every installed module, each in a section (revenue, growth, usage), for the last 7, 30 or 90 days in the administrator's time zone.

Parameters ​

NameInTypeRequiredDescription
daysqueryintegerOne of: 7, 30, 90. Default 30.

Responses ​

  • 200 — data holds stats, series, breakdowns and lists; meta the period (days, from, to, timezone).
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
  • 422 —
Response fields
FieldTypeRequiredDescription
dataobject
data.statsobject[]
data.seriesobject[]
data.breakdownsobject[]
data.listsobject[]
metaobject
bash
curl -X GET "https://your-site.com/api/v1/admin/overview" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

GET /admin/overview/export ​

The Overview as CSV (administrators; 10 per minute)

One row per figure: section, part (stat, daily, breakdown, list), label, item (date, row or currency), value, previous_period, note.

Parameters ​

NameInTypeRequiredDescription
daysqueryintegerOne of: 7, 30, 90. Default 30.

Responses ​

  • 200 — CSV (text/csv).
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
bash
curl -X GET "https://your-site.com/api/v1/admin/overview/export" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

GET /users/export ​

Every matching user as CSV, with the modules' columns (administrators; 10 per minute)

Takes the same filters and order as GET /users (search, role, status, via, sort), without pages.

Responses ​

  • 200 — CSV (text/csv).
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
bash
curl -X GET "https://your-site.com/api/v1/users/export" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

GET /users ​

Every account that can sign in (administrators)

Parameters ​

NameInTypeRequiredDescription
pagequeryintegerMinimum 1. Default 1.
per_pagequeryintegerMinimum 1. Maximum 100. Default 25.
searchquerystringName or email contains.
rolequerystringOne of: admin, user.
statusquerystringOne of: active, suspended, never.
viaquerystringOne of: install, invite, signup.
sortquerystringOne of: -created_at, created_at, -last_login_at, name, email.

Responses ​

  • 200 — Users with module columns (meta.columns, values in each user's facts) and totals.
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
Response fields
FieldTypeRequiredDescription
dataobject[]
data[].idinteger
data[].namestring
data[].emailstring
data[].is_adminboolean
data[].suspendedboolean
data[].suspended_atstring (date-time), nullable
data[].two_factorbooleanTwo-factor sign-in is on.
data[].signed_up_viastringOne of: install, invite, signup.
data[].organizationobject, nullable
data[].organization.idinteger
data[].organization.namestring
data[].last_login_atstring (date-time), nullable
data[].created_atstring (date-time)
data[].factsobjectModule columns (see meta.columns).
metaobject
meta.current_pageinteger
meta.last_pageinteger
meta.per_pageinteger
meta.totalinteger
meta.columnsobject
meta.totalsobject
meta.totals.usersinteger
meta.totals.new_30_daysinteger
meta.totals.adminsinteger
meta.totals.suspendedinteger
bash
curl -X GET "https://your-site.com/api/v1/users" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

PATCH /users/{user} ​

Change the role or suspend (never one's own account)

Parameters ​

NameInTypeRequiredDescription
userpathintegeryes

Request body ​

application/json

FieldTypeRequiredDescription
is_adminboolean
suspendedbooleanA suspension signs the person out everywhere.
two_factorbooleanOnly false: turns off the person's two-factor sign-in (lost phone and recovery codes). One of: false.

Responses ​

  • 200 — The user.
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
  • 422 — Validation failed.
Response fields
FieldTypeRequiredDescription
dataobject
data.idinteger
data.namestring
data.emailstring
data.is_adminboolean
data.suspendedboolean
data.suspended_atstring (date-time), nullable
data.two_factorbooleanTwo-factor sign-in is on.
data.signed_up_viastringOne of: install, invite, signup.
data.organizationobject, nullable
data.organization.idinteger
data.organization.namestring
data.last_login_atstring (date-time), nullable
data.created_atstring (date-time)
data.factsobjectModule columns (see meta.columns).
bash
curl -X PATCH "https://your-site.com/api/v1/users/{user}" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"is_admin":true,"suspended":true,"two_factor":false}'

DELETE /users/{user} ​

Remove a user (and their account with all its data when they were its last member)

Parameters ​

NameInTypeRequiredDescription
userpathintegeryes

Responses ​

  • 204 — Removed.
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
  • 422 — Your own account.
bash
curl -X DELETE "https://your-site.com/api/v1/users/{user}" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

GET /invitations ​

Pending invitations

Responses ​

  • 200 — Invitations, newest first.
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
Response fields
FieldTypeRequiredDescription
dataobject[]
data[].idinteger
data[].emailstring
data[].is_adminboolean
data[].organizationstring, nullableThe account they join; null = a new account.
data[].invited_bystring, nullable
data[].created_atstring (date-time)
data[].expires_atstring (date-time)
bash
curl -X GET "https://your-site.com/api/v1/invitations" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

POST /invitations ​

Invite someone by email (the link works once, for 7 days)

Request body ​

application/json, required

FieldTypeRequiredDescription
emailstring (email)yes
accountstringyesJoin the inviter's account, or get a new one. One of: team, new.
is_adminboolean

Responses ​

  • 201 — Sent.
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
  • 422 — Validation failed.
bash
curl -X POST "https://your-site.com/api/v1/invitations" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","account":"team","is_admin":true}'

DELETE /invitations/{invitation} ​

Revoke an invitation

Parameters ​

NameInTypeRequiredDescription
invitationpathintegeryes

Responses ​

  • 204 — Revoked.
  • 403 — Not allowed (not an administrator, or outside the token's abilities).
bash
curl -X DELETE "https://your-site.com/api/v1/invitations/{invitation}" \
  -H "Authorization: Bearer $REPLORA_TOKEN" \
  -H "Accept: application/json"

Replora: see what your visitors see.