Skip to content
Sendtier Docs
API reference

Create an organization with the caller as owner

Source: OpenAPI (openapi/openapi.yaml).

curl -X POST "https://api.sendtier.example/organizations" \  -H "Authorization: Bearer st_live_REPLACE_ME" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "tenant": {    "id": "string",    "name": "string"  },  "role": "owner"}
POST
/organizations

Call GET /me first to provision the user. No existing membership is required. Idempotency-Key is not supported because no tenant exists yet. A retry that is still under both caps creates another organization. The owned-organization cap and the 24-hour creation cap return 422 organization_limit_reached. That response has no Retry-After header. The message names the cap. The 24-hour cap message includes the UTC time when the next creation is possible.

Authorization

dashboardToken
headerAuthorizationBearer <token>

Dashboard server token: EdDSA Ed25519, issuer is the dashboard origin, audience sendtier-api, iat and exp are required with a maximum lifetime of 15 minutes, sub is the identity subject, email is required. Sendtier-Tenant selects a membership; omission selects the sole membership. Without a selected tenant only GET /me and POST /organizations are available. Sendtier-Mode is live (default) or test; test mode cannot create live keys. Owners, admins and developers have full access. Viewers may only GET or HEAD.

Request Body

application/json
  1. body
name*string

Surrounding whitespace is trimmed; the trimmed name must be nonblank.

Length1 <= length <= 100

Response Body

Organization and owner membership created atomically.

application/json
  1. response
tenant*
role*"owner"
Value in"owner"