Create a new organization.
POST
/v1/organizations
const url = 'https://api.adversarial.com/api/v1/organizations';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"display_name":"example","slug":"acme"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.adversarial.com/api/v1/organizations \ --header 'Content-Type: application/json' \ --data '{ "display_name": "example", "slug": "acme" }'General-purpose: any authenticated principal may create an organization at
any time — an orgless onboarding session creating its first org, an existing
member spinning up another, or a service-account bearer token. The caller
becomes the new org’s ADMIN. An interactive session is bound to the new
org; a bearer principal has no session to bind (its token stays scoped to
its own org).
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
Request body for POST /v1/organizations — general-purpose organization
creation. The caller supplies a display name and a URL slug.
object
display_name
required
string
slug
required
User-chosen URL slug. Uniqueness is enforced by the DB and surfaced as a 422 on collision.
string
Example
acmeResponses
Section titled “Responses”The newly created organization
Media typeapplication/json
object
description
required
string
display_name
required
string
icon
string | null
id
required
string format: uuid
name
required
string
slug
required
URL-safe human-readable identifier.
string
verified
required
boolean
Examplegenerated
{ "description": "example", "display_name": "example", "icon": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "slug": "example", "verified": true}Display_name is not 2-60 characters
Slug is invalid or already taken