---
title: "Create a tenant"
method: POST
path: "/tenants"
tags: ["Tenants"]
---

# Create a tenant

`POST /tenants`

## Request

- Base URL: `https://api.groundmail.dev`
- URL: `https://api.groundmail.dev/tenants`
- Auth: HTTP bearer

## Request body

- CreateTenantRequest
  - `external_id` string, required: Your id for this customer. Unique in your account; cannot change.
  - `name` string: Display name. Defaults to `external_id`.
  - `default_from_domain` string, nullable: Completes a bare `from` local part (`"billing"` → `billing@<domain>`) on sends that name this tenant.
  - `stream_policy` 'all' | 'transactional_only': `transactional_only` refuses product email for this tenant.
  - `daily_limit` integer, nullable: Most recipients this tenant may email per UTC day, on top of its sending ramp. `null` for no limit of your own.
  - `metadata` object, nullable: Any JSON object, up to 4 KB, for your own use.

## Response `201`

Tenant created

- TenantResponse
  - `tenant` Tenant, required
    - `id` string, uuid, required
    - `object` 'tenant', required
    - `external_id` string, required
    - `name` string, required
    - `status` 'active' | 'paused', required
    - `paused_reason` string, nullable
    - `paused_at` string, date-time, nullable
    - `pause_source` 'api' | 'admin' | 'automated' | 'null', nullable: Who paused the tenant: `api` (you), `automated` (Groundmail, after a high bounce or complaint rate) or `admin` (Groundmail support).
    - `default_from_domain` string, nullable
    - `stream_policy` 'all' | 'transactional_only', required
    - `daily_limit` integer, nullable
    - `metadata` object, nullable
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `400`: Invalid field
- `401`: Missing or invalid API key
- `403`: `tenants_not_enabled`: tenants are not included on this account's plan. `plan_limit`: the account has as many tenants as its plan includes (`details.tenant_limit`).
- `409`: A tenant with this `external_id` already exists

---

[API](https://skmtc.dev/groundmail/apis/groundmail-api.md) · [All operations](https://skmtc.dev/groundmail/apis/groundmail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/groundmail/apis/groundmail-api/revisions/479821c9fecf?raw)
