Skip to content

API reference / RivetMSP

Auth

GET /branding Public

Public company identity for mobile sign-in and app branding

Returns the same company name and uploaded logo shown on the public login page. An uploaded logo replaces product artwork. No credentials or settings are returned.

Example request

curl "https://YOUR-HOST/api/v1/branding"
import requests

response = requests.get(
    "https://YOUR-HOST/api/v1/branding",
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/branding", {
  method: "GET",
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/branding");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
]);
$data = json_decode(curl_exec($ch), true);

Responses

200Company identity; null logo_path means use the RivetMSP fallback

FieldTypeDescription
namerequired string
logo_pathrequired string
Example response
json
{
    "name": "string",
    "logo_path": "/uploads/settings/company-logo.png"
}

429Rate limit exceeded

GET /auth Public

Begin a WebAuthn/passkey assertion — returns a challenge

Example request

curl "https://YOUR-HOST/api/v1/auth"
import requests

response = requests.get(
    "https://YOUR-HOST/api/v1/auth",
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/auth", {
  method: "GET",
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/auth");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
]);
$data = json_decode(curl_exec($ch), true);

Responses

200Passkey assertion options

FieldTypeDescription
challenge string
timeout integer
rpId string
allowCredentials array of object
userVerification string
challengeToken string
Example response
json
{
    "challenge": "string",
    "timeout": 1,
    "rpId": "string",
    "allowCredentials": [
        {}
    ],
    "userVerification": "string",
    "challengeToken": "string"
}

429Rate limit exceeded (see Retry-After header)

FieldTypeDescription
error string
POST /auth Public

Password login — returns a bearer token, or requires_2fa

Request body (application/json, required)

FieldTypeDescription
username string
password string
totp_code string
device_name string
passkey_response object
challenge_token string

Example request

curl -X POST "https://YOUR-HOST/api/v1/auth" \
  -H "Content-Type: application/json" \
  -d '{"username":"string","password":"string","totp_code":"string","device_name":"string","passkey_response":{},"challenge_token":"string"}'
import requests

response = requests.post(
    "https://YOUR-HOST/api/v1/auth",
    json={
        "username": "string",
        "password": "string",
        "totp_code": "string",
        "device_name": "string",
        "passkey_response": {},
        "challenge_token": "string"
    },
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/auth", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
      "username": "string",
      "password": "string",
      "totp_code": "string",
      "device_name": "string",
      "passkey_response": {},
      "challenge_token": "string"
  }),
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/auth");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
    CURLOPT_POSTFIELDS => '{"username":"string","password":"string","totp_code":"string","device_name":"string","passkey_response":{},"challenge_token":"string"}',
]);
$data = json_decode(curl_exec($ch), true);

Responses

200Token issued, or 2FA required, or (for passkey completion) token issued

FieldTypeDescription
token string
user object
user.id integer
user.name string
user.email string
user.type integer
Example response
json
{
    "token": "string",
    "user": {
        "id": 1,
        "name": "string",
        "email": "string",
        "type": 1
    }
}

400Bad request

FieldTypeDescription
error string

401Missing or invalid credentials

FieldTypeDescription
error string

429Rate limit exceeded (see Retry-After header)

FieldTypeDescription
error string
DELETE /auth Bearer token or API key

Logout — revoke the current bearer token

Example request

curl -X DELETE "https://YOUR-HOST/api/v1/auth" \
  -H "Authorization: Bearer $TOKEN"
import requests

response = requests.delete(
    "https://YOUR-HOST/api/v1/auth",
    headers={"Authorization": f"Bearer {TOKEN}"},
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/auth", {
  method: "DELETE",
  headers: { "Authorization": `Bearer ${TOKEN}` },
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/auth");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$data = json_decode(curl_exec($ch), true);

Responses

200Success

FieldTypeDescription
ok boolean
Example response
json
{
    "ok": true
}