The Administration API provides the platform-level controls that govern which organisations are permitted to operate within the KaroKar marketplace. Before a vendor can list vehicles or a corporate organisation can place bookings, a platform administrator must approve the organisation through this workflow. Each decision — approval, rejection, or suspension — is recorded as an immutableDocumentation 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.
OrganizationApproval record and broadcasts a domain event to notify the rest of the platform. All three endpoints share the same organization.approve permission, which is held exclusively by users with the PLATFORM_ADMIN role.
All requests require an
Authorization: Bearer <token> header. The authenticated user’s userId and organizationId are extracted from the token and recorded as the reviewer on every approval record.ApprovalStatus Values
EveryOrganizationApproval record carries one of the following statuses:
| Status | Meaning |
|---|---|
PENDING | The organisation has been submitted for review but no decision has been made. |
APPROVED | The organisation has been approved and may operate on the platform. |
REJECTED | The organisation’s application was denied. |
REVOKED | A previously approved or active organisation has had its access revoked (written by the suspend workflow). |
OrganizationApproval Entity Fields
All three endpoints return anOrganizationApproval object with the following fields:
Unique identifier for this approval record, auto-generated.
UUID of the organisation being reviewed.
The outcome of the review action. See ApprovalStatus Values above.
UUID of the platform admin user who performed the review, or
null if not yet reviewed.Timestamp when the review was completed, or
null if not yet reviewed.Optional free-text notes recorded by the reviewer, or
null if none were provided.Timestamp when the approval record was created.
POST /admin/organizations/:id/approve
Approve an organisation, granting it the right to operate on the KaroKar platform. Creates anOrganizationApproval record with APPROVED status, records the reviewing admin, and emits an OrganizationApproved domain event.
Required permission: organization.approve
Path Parameters
UUID of the organisation to approve.
Request Body
Optional free-text notes from the reviewer, e.g. conditions of approval or references to supporting documents.
Response
Returns the newly createdOrganizationApproval record.
Errors
| HTTP | Condition |
|---|---|
| 403 | Caller lacks organization.approve permission (non-PLATFORM_ADMIN user) |
| 501 | Service method not yet fully implemented |
Example
POST /admin/organizations/:id/reject
Reject an organisation’s application, preventing it from operating on the platform. Creates anOrganizationApproval record with REJECTED status and emits an OrganizationRejected domain event.
Required permission: organization.approve
Path Parameters
UUID of the organisation to reject.
Request Body
Optional free-text notes from the reviewer. It is strongly recommended to include a reason for rejection so the organisation can address the issue and reapply.
Response
Returns the newly createdOrganizationApproval record with status: "REJECTED".
Errors
| HTTP | Condition |
|---|---|
| 403 | Caller lacks organization.approve permission |
| 501 | Service method not yet fully implemented |
Example
POST /admin/organizations/:id/suspend
Suspend an organisation that is currently active on the platform, immediately halting its ability to create or accept bookings. Creates anOrganizationApproval record capturing the suspension, and emits an OrganizationSuspended domain event.
Required permission: organization.approve
Path Parameters
UUID of the organisation to suspend.
Request Body
Optional free-text notes from the reviewer. Strongly recommended — document the reason for suspension for audit purposes.
Response
Returns the newly createdOrganizationApproval record reflecting the suspension decision.
Errors
| HTTP | Condition |
|---|---|
| 403 | Caller lacks organization.approve permission |
| 501 | Service method not yet fully implemented |
Example
Audit Trail
Every call to approve, reject, or suspend an organisation creates a newOrganizationApproval row rather than mutating an existing one. This means the organization_approvals table functions as an append-only audit log. You can reconstruct the full decision history for any organisation by querying all rows where organizationId matches the target.