Skip to main content
POST
https://api.bunship.com
/
api
/
v1
/
organizations
Create Organization
curl --request POST \
  --url https://api.bunship.com/api/v1/organizations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "slug": "<string>",
  "description": "<string>",
  "logoUrl": "<string>"
}
'
{
  "id": "org_cld2abc123def456",
  "name": "Acme Corp",
  "slug": "acme-corp",
  "description": "Building the future of widgets",
  "logoUrl": "https://cdn.bunship.com/logos/acme.png",
  "settings": {},
  "createdBy": "usr_cld2abc123def456",
  "createdAt": "2024-01-15T10:00:00Z",
  "updatedAt": "2024-01-15T10:00:00Z"
}
Creates a new organization. The authenticated user automatically becomes the organization owner with full permissions.

Auth

Requires a valid Bearer token.

Request Body

name
string
required
Organization display name. Between 1 and 100 characters.
slug
string
required
URL-friendly identifier. Lowercase letters, numbers, and hyphens only. Between 3 and 50 characters. Must match the pattern ^[a-z0-9]+(?:-[a-z0-9]+)*$.
description
string
Organization description. Maximum 500 characters.
logoUrl
string
URL of the organization logo image. Must be a valid URI.

Response

id
string
Organization identifier.
name
string
Organization name.
slug
string
URL slug.
description
string | null
Description.
logoUrl
string | null
Logo URL.
settings
object
Organization settings (branding, features, billing).
createdBy
string
User ID of the creator.
createdAt
string
ISO 8601 creation timestamp.
updatedAt
string
ISO 8601 last update timestamp.
{
  "id": "org_cld2abc123def456",
  "name": "Acme Corp",
  "slug": "acme-corp",
  "description": "Building the future of widgets",
  "logoUrl": "https://cdn.bunship.com/logos/acme.png",
  "settings": {},
  "createdBy": "usr_cld2abc123def456",
  "createdAt": "2024-01-15T10:00:00Z",
  "updatedAt": "2024-01-15T10:00:00Z"
}

Errors

StatusCodeDescription
400VALIDATION_ERRORInvalid slug format or missing required fields
401AUTHENTICATION_ERRORMissing or invalid Bearer token
409CONFLICTOrganization slug already exists

Example

curl -X POST https://api.bunship.com/api/v1/organizations \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corp",
    "slug": "acme-corp",
    "description": "Building the future of widgets"
  }'