Skip to content

site-admin ​

← All modules

3 endpoints.

GET /api/v1/instance-admin/external-sites ​

List External Sites

The customers' own sites, for the "External sites" block at the foot of the site selector's dropdown (owner, 2026-10-24: "add below the site selector, a list of external sites, which only superadmins can see", then "move it to the site selector drop down at the bottom").

"External" is the books switcher's own word for it — :func:books_switch.is_operator_own is False, i.e. a site that is or was on a free trial (msr, indomitableminds, dunrite…). It cannot be read off /accounting/books-sites: a customer who has not set up a company yet has no acc_company row, and the switcher leaves a site with no books out altogether, so the new customers are exactly the ones it never lists.

Same exclusions as the switcher — customer portals and child sites (they are reached through their parent), EXCLUDED_INSTANCES and private_to sites — except the DEMO site, which is listed when it exists (owner: "add the demo there as well, if exists"). It is an operator-owned site the switcher keeps out of the books list, but it is a place an operator goes to show a prospect, which is what this block is for. Hub only, and an empty list elsewhere rather than a 403: the sidebar asks on every site a superuser signs in to, and an error there is noise, not a signal.

200 — Successful Response

json
{}

GET /api/v1/instance-admin/templates ​

List Templates

200 — Successful Response

json
{}

POST /api/v1/instance-admin/new-site ​

New Instance

Request body

json
{
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 64,
      "minLength": 1,
      "title": "Name"
    },
    "hosts": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Hosts"
    },
    "template": {
      "type": "string",
      "title": "Template",
      "default": "default"
    },
    "db_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Db Url"
    },
    "admin_email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Admin Email"
    },
    "admin_password": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Admin Password"
    },
    "org_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Org Name"
    },
    "trial": {
      "type": "boolean",
      "title": "Trial",
      "default": true
    },
    "trial_days": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Trial Days"
    },
    "issue_cert": {
      "type": "boolean",
      "title": "Issue Cert",
      "default": true
    }
  },
  "type": "object",
  "required": [
    "name"
  ],
  "title": "NewInstanceIn"
}

200 — Successful Response

json
{}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

Lubb Business Documentation