Skip to content

Create a tenant

POST
/tenants
curl --request POST \
--url https://localhost:3000/api/v1/tenants \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "color": "#6366f1", "description": "My organization description", "name": "My Organization", "slug": "my-org" }'

Creates a new tenant. The authenticated account becomes the owner.

Tenant details

Media typeapplication/json
object
color

Color is a user-chosen hex value, stored as-is. The web remaps it to an os-* chart token for display; it is data, not an os-* theme token.

string

Example

#6366f1
description
string

Example

My organization description
name
required
string

Example

My Organization
slug
string

Example

my-org

Tenant created

Media typeapplication/json
object
color
required

Color is a user-chosen hex value (same data as groups.color and triggers.color), not an os-* theme token. Empty when the tenant has none.

string
created_at
required
string format: date-time
description
string
id
required
string format: uuid
name
required
string
owner_id
required
string format: uuid
plan
required
string
slug
required
string
trigger_count
required
integer
updated_at
required
string format: date-time

Example

{
"color": "#6366f1",
"created_at": "2024-01-15T10:30:00Z",
"description": "My organization description",
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "My Organization",
"owner_id": "550e8400-e29b-41d4-a716-446655440000",
"plan": "free",
"slug": "my-org",
"trigger_count": 3,
"updated_at": "2024-01-15T10:30:00Z"
}

Invalid request

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Unauthorized

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Tenant limit reached

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Slug already exists

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Internal error

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}