Skip to navigation

Seed Firm Owner

View as Markdown

Admin-only endpoint for creating a firm and assigning its owner.

Use this to bootstrap the first firm in an invite-only environment, or to create another firm for an existing owner account. A user can own multiple firms.

Configure ADMIN_SEED_KEY in the backend environment before starting the API. In Swagger, provide that same value in the x-admin-seed-key header field.

If owner_email already exists, that user becomes the owner of the new firm and owner_password is ignored. If owner_email does not exist, owner_password is required so the owner account can be created.

Headers:

  • x-admin-seed-key (string) — value of ADMIN_SEED_KEY

Required fields:

  • firm_name (string)
  • firm_slug (string) — lowercase letters/digits with hyphens
  • owner_email (string)

Optional fields:

  • owner_name (string | null)
  • owner_password (string | null) — required only when owner_email is new

Response:

  • owner (object)
    • id (int)
    • name (string | null)
    • email (string)
  • firm (object)
    • id (int)
    • name (string)
    • slug (string)
    • owner_user_id (int)
  • membership (object)
    • id (int)
    • firm_id (int)
    • user_id (int)
    • role (string) — owner

Errors:

  • 401: Invalid admin seed key
  • 409: Firm slug already exists
  • 422: Validation error or missing owner_password for a new owner
  • 500: ADMIN_SEED_KEY is not configured

Headers

x-admin-seed-keystring or nullOptional

Value of ADMIN_SEED_KEY from the server environment.

Request

This endpoint expects an object.
firm_namestringRequired1-120 characters
firm_slugstringRequiredformat: "^[a-z0-9]+(?:-[a-z0-9]+)*$"3-64 characters
owner_emailstringRequiredformat: "email"
owner_namestring or nullOptional1-20 characters
owner_passwordstring or nullOptional>=8 characters

Response

Successful Response
dataobject
statusstringOptionalDefaults to success

Errors

422
Unprocessable Entity Error