---
title: "Self Serve Create Org"
method: POST
path: "/api/orgs/self-serve"
---

# Self Serve Create Org

`POST /api/orgs/self-serve`

Create the caller's first org.

Workspace-domain signup (alice@acme.com) can call this with no body —
we title-case the domain label into a default name ("Acme") and slug.

Consumer-domain signup (michael@gmail.com) must supply `{name, slug}`
explicitly; calling with no body returns `409 name_required` so the
console can render its FirstOrgForm prompt instead of inflicting
"Gmail" on the user.

Allowed only when the caller has zero existing memberships; subsequent
org creation goes through `POST /api/admin/orgs`.

Idempotency: a Postgres TRANSACTION-scoped advisory lock keyed on
user_id serializes concurrent self-serve calls. (We deliberately do
NOT use the session-scoped pg_advisory_lock — on a pooled connection a
session lock leaks across requests.)

## Request body

- SelfServeCreateRequest — Optional body for `POST /api/orgs/self-serve`. Workspace-email signup (alice@acme.com) can omit the body — the server title-cases the domain label. Consumer-email signup (michael@gmail.com) is rejected (`name_required`) without an explicit body, so the user is forced to pick a real name + slug instead of getting "Gmail" inflicted on them. `name` and `slug` must be provided together when given.
  - `name` string, nullable
  - `slug` string, nullable

## Response `201`

Successful Response

- object

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/codag/apis/infra-logs-templater.md) · [All operations](https://skmtc.net/codag/apis/infra-logs-templater/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/codag/infra-logs-templater/revisions/e43028aaffe3/schema)
