Skip to main content
Use this endpoint to create a new organization. The authenticated user becomes the organization owner immediately upon creation. This is a personal context request — no X-Organization-Id header is required.

Endpoint

POST https://api.nyotaimara.com/v1/organizations

Headers

Authorization
string
required
Bearer token. Format: Bearer <token>.

Body

name
string
required
Display name of the organization.
slug
string
required
A unique, URL-safe identifier for the organization. The API lowercases the value and replaces any non-alphanumeric character (except hyphens) with a hyphen — for example, "Acme Kenya!" becomes "acme-kenya-". Must be globally unique across all organizations.
kraPin
string
Kenya Revenue Authority PIN for the organization.
billingEmail
string
Email address to receive invoices and billing notifications.
address
string
Physical street address of the organization.
city
string
City where the organization is based.
country
string
default:"Kenya"
Country of operation. Defaults to "Kenya".

Response

success
boolean
required
true on a successful creation.
data
object
The newly created organization record.
If the slug you provide is already taken by another organization, the API returns a 409 Conflict error. Choose a different slug and retry.
curl --request POST \
  --url https://api.nyotaimara.com/v1/organizations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Acme Kenya Ltd",
    "slug": "acme-kenya",
    "kraPin": "P051234567X",
    "billingEmail": "billing@acmekenya.co.ke",
    "address": "14 Westlands Road",
    "city": "Nairobi",
    "country": "Kenya"
  }'
{
  "success": true,
  "data": {
    "id": "org_01j9kxyz",
    "name": "Acme Kenya Ltd",
    "slug": "acme-kenya",
    "kraPin": "P051234567X",
    "billingEmail": "billing@acmekenya.co.ke",
    "address": "14 Westlands Road",
    "city": "Nairobi",
    "country": "Kenya"
  }
}