Skip to main content

Organisations (/api/v1/organisation)

Multi-user organisation management. Organisations allow teams to collaborate on loan processing, document management, and shared dashboards.

All endpoints require authentication via X-API-Key. Owner-only endpoints are noted.


1. Create Organisation

Create a new organisation. The creator becomes the primary owner.

  • Method: POST
  • Endpoint: /api/v1/organisation

Request Body

ParameterTypeDescription
nameStringOrganisation name (required)
organization_addressStringOrganisation address
organization_nmlsr_idStringNMLSR ID
organization_state_licenseStringState license
originator_nameStringOriginator name
originator_nmlsr_idStringOriginator NMLSR ID
originator_state_licenseStringOriginator state license
originator_emailStringOriginator email
originator_phoneStringOriginator phone
{
"name": "My Lending Company",
"organization_address": "123 Business Ave, Suite 100",
"organization_nmlsr_id": "NMLS-12345",
"organization_state_license": "CA-12345",
"originator_name": "Jane Agent",
"originator_nmlsr_id": "NMLS-67890",
"originator_email": "jane@company.com",
"originator_phone": "555-0100"
}

Response (201 Created)

{
"id": "uuid",
"name": "My Lending Company",
"orgCode": "a1b2c3d4",
"ownerId": "uuid",
"organizationAddress": "123 Business Ave, Suite 100",
"organizationNmlsrId": "NMLS-12345",
...
}

2. Join Organisation

Join an existing organisation using its invite code.

  • Method: POST
  • Endpoint: /api/v1/organisation/join

Request Body

{ "orgCode": "a1b2c3d4" }

Response

{
"message": "Successfully joined organisation",
"organisation": { ... }
}

3. Get Organisation Details

Retrieve the current user's organisation info.

  • Method: GET
  • Endpoint: /api/v1/organisation

Response

{
"id": "uuid",
"name": "My Lending Company",
"orgCode": "a1b2c3d4",
"ownerId": "uuid",
"currentUserRole": "OWNER",
...
}

4. Leave Organisation

Leave the current organisation (owners must transfer ownership or demote themselves first).

  • Method: POST
  • Endpoint: /api/v1/organisation/leave

Response

{ "message": "Left organisation successfully" }

5. Get Organisation Dashboard (Owner)

View the organisation dashboard with member list.

  • Method: GET
  • Endpoint: /api/v1/organisation/dashboard
  • Role: Owner only

Response

{
"id": "uuid",
"name": "My Lending Company",
"members": [
{ "id": "uuid", "name": "John Doe", "email": "john@company.com", "orgRole": "OWNER", "createdAt": "..." },
{ "id": "uuid", "name": "Jane Smith", "email": "jane@company.com", "orgRole": "MEMBER", "createdAt": "..." }
],
...
}

6. Update Organisation (Owner)

Update organisation details.

  • Method: PUT
  • Endpoint: /api/v1/organisation
  • Role: Owner only

Request Body

Same fields as Create Organisation.


7. Delete Organisation (Owner)

Delete the organisation and remove all members.

  • Method: DELETE
  • Endpoint: /api/v1/organisation
  • Role: Owner only

Response

{ "message": "Organisation deleted successfully" }

8. Get Organisation Loans (Owner)

View all loans across the organisation.

  • Method: GET
  • Endpoint: /api/v1/organisation/loans
  • Role: Owner only

Query Parameters

ParameterTypeDefaultDescription
pageNumber1Page number
limitNumber50Loans per page

Response

{
"loans": [
{
"id": "uuid",
"user": { "name": "John Doe", "email": "john@company.com" },
"loanAmount": 50000,
"loanPurpose": "Home Improvement",
"status": "PENDING",
"createdAt": "2025-01-01T00:00:00.000Z"
}
]
}

9. Get Organisation Documents (Owner)

View all documents across the organisation.

  • Method: GET
  • Endpoint: /api/v1/organisation/documents
  • Role: Owner only

10. Manage Members (Owner)

ActionMethodEndpointBody
Remove memberDELETE/organisation/members{ "memberId": "uuid" }
Promote to ownerPOST/organisation/members/promote{ "memberId": "uuid" }
Demote owner to memberPOST/organisation/members/demote{ "ownerId": "uuid" }
View member profileGET/organisation/members/:memberId
View member loansGET/organisation/members/:memberId/loans
View member documentsGET/organisation/members/:memberId/documents

11. Regenerate Invite Code (Owner)

Generate a new organisation invite code. The old code becomes invalid.

  • Method: POST
  • Endpoint: /api/v1/organisation/code/refresh
  • Role: Owner only

Response

{
"message": "Organisation code regenerated",
"orgCode": "x9y8z7w6"
}