> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.whizcozy.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.whizcozy.com/_mcp/server.

# Seed Firm Owner

POST https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/admin/seed-firm-owner
Content-Type: application/json

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

Reference: https://docs.whizcozy.com/api-reference/whiz-board-api/admin/seed-firm-owner-api-v-1-admin-seed-firm-owner-post

## Request

### Headers

- `x-admin-seed-key` (string, optional, nullable) — Value of ADMIN_SEED_KEY from the server environment.

### Body (application/json)

This endpoint expects an AdminSeedFirmRequest.

- `firm_name` (string, required)
- `firm_slug` (string, required)
- `owner_email` (string, required)
- `owner_name` (string, optional, nullable)
- `owner_password` (string, optional, nullable)

## Response

### 200

Successful Response

- `data` (AdminSeedFirmBootstrapResponse, required)
- `status` (string, optional, default: success)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### AdminSeedFirmBootstrapResponse

- `owner` (AdminSeedOwnerResponse, required)
- `firm` (AdminSeedFirmResponse, required)
- `membership` (AdminSeedMembershipResponse, required)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### AdminSeedOwnerResponse

- `id` (integer, required)
- `name` (string, required, nullable)
- `email` (string, required)

### AdminSeedFirmResponse

- `id` (integer, required)
- `name` (string, required)
- `slug` (string, required)
- `owner_user_id` (integer, required)

### AdminSeedMembershipResponse

- `id` (integer, required)
- `firm_id` (integer, required)
- `user_id` (integer, required)
- `role` (enum, required) — Role of a user within a Firm (tenant).
  - Allowed values: `owner`, `ca_staff`, `client`

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Request**

```json
{
  "firm_name": "string",
  "firm_slug": "string",
  "owner_email": "string"
}
```

**Response**

```json
{
  "data": {
    "owner": {
      "id": 1,
      "name": "string",
      "email": "string"
    },
    "firm": {
      "id": 1,
      "name": "string",
      "slug": "string",
      "owner_user_id": 1
    },
    "membership": {
      "id": 1,
      "firm_id": 1,
      "user_id": 1,
      "role": "owner"
    }
  },
  "status": "success"
}
```

**SDK Code**

```python
import requests

url = "https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/admin/seed-firm-owner"

payload = {
    "firm_name": "string",
    "firm_slug": "string",
    "owner_email": "string"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/admin/seed-firm-owner';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"firm_name":"string","firm_slug":"string","owner_email":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/admin/seed-firm-owner"

	payload := strings.NewReader("{\n  \"firm_name\": \"string\",\n  \"firm_slug\": \"string\",\n  \"owner_email\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/admin/seed-firm-owner")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"firm_name\": \"string\",\n  \"firm_slug\": \"string\",\n  \"owner_email\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/admin/seed-firm-owner")
  .header("Content-Type", "application/json")
  .body("{\n  \"firm_name\": \"string\",\n  \"firm_slug\": \"string\",\n  \"owner_email\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/admin/seed-firm-owner', [
  'body' => '{
  "firm_name": "string",
  "firm_slug": "string",
  "owner_email": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/admin/seed-firm-owner");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"firm_name\": \"string\",\n  \"firm_slug\": \"string\",\n  \"owner_email\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "firm_name": "string",
  "firm_slug": "string",
  "owner_email": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://prod-whizboard-be-680473615767.asia-southeast1.run.app/api/v1/admin/seed-firm-owner")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```