Organizations are the top-level multi-tenancy primitive in KaroKar. Every fleet, every employee group, and every booking ultimately belongs to an organization. The platform supports three distinct organization types —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Codefied-CodePix/Karokar-backend/llms.txt
Use this file to discover all available pages before exploring further.
PLATFORM, VENDOR, and CORPORATE — and a full lifecycle expressed through four statuses: PENDING, ACTIVE, SUSPENDED, and REJECTED. Organizations can be nested via the optional parentOrganizationId field, enabling you to model hierarchies such as a corporate parent with regional sub-tenants. Creation is a privileged action protected by the organization.approve permission, reflecting the fact that onboarding a new tenant is a deliberate business decision.
POST /organizations
Creates a new organization tenant in the platform. Required permission:organization.approve
Request body
Human-readable display name for the organization. Must be a non-empty string.
The category of organization. Must be one of the
OrganizationType enum values.Optional UUID of an existing parent organization. Use this to model hierarchical tenant structures, such as a regional division under a national corporate entity.
Optional free-form JSON object for storing additional structured data (e.g., GST numbers, contract IDs, regional codes). There is no fixed schema — the object is stored as
jsonb and returned as-is.Response
Returns the newly createdOrganization object.
UUID primary key, auto-generated.
Display name of the organization.
One of
PLATFORM, VENDOR, or CORPORATE.Current lifecycle status of the organization.
UUID of the parent organization, or
null for top-level organizations.The free-form JSON object provided at creation time. Defaults to
{}.Timestamp of record creation, set automatically by the database.
Timestamp of the last update, maintained automatically by the database.
Example
Error cases
| Status | Reason |
|---|---|
401 Unauthorized | Missing or expired Authorization bearer token. |
403 Forbidden | Authenticated principal lacks the organization.approve permission. |
400 Bad Request | Validation failure — e.g., type is not a valid OrganizationType, or parentOrganizationId is not a valid UUID. |
GET /organizations/:id
Retrieves a single organization by its UUID. Required permission: None (authentication is still required via thePermissionGuard).
Path parameters
The UUID of the organization to retrieve.
Response
Returns the matchingOrganization object, or null if no record exists for the provided ID.
UUID primary key of the organization.
Display name of the organization.
One of
PLATFORM, VENDOR, or CORPORATE.Current lifecycle status:
PENDING, ACTIVE, SUSPENDED, or REJECTED.UUID of the parent organization, or
null for top-level organizations.Free-form JSON metadata stored against this organization.
Timestamp of record creation.
Timestamp of the last update.
Example
Error cases
| Status | Reason |
|---|---|
401 Unauthorized | Missing or expired Authorization bearer token. |