How to Use Organization Management APIs

This guide describes how to manage multi-tenant Organizations and Subdomains inside Fabrixly-IDS using the Organization REST APIs.


πŸ” Authentication & Prerequisites

All organization management endpoints require administrative authentication. To call them:

  1. Include the Token in the Authorization Header: Add -H "Authorization: Bearer <your-admin-jwt-token>" to your API calls.

Obtain an Admin JWT Token:

curl -X POST https://ids.fabrixly.com/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "admin@example.com",
    "password": "your-admin-password"
  }'

Note: This returns a JSON response containing a token.


1. Create an Organization

Creates a new tenant organization partition.

  • HTTP Method: POST
  • Path: /api/organizations
  • Headers:
    • Content-Type: application/json
    • Authorization: Bearer <your-admin-jwt-token>

Request Body Parameters

Parameter Type Required Description
name string Yes The name of the organization (e.g. Acme Corp).
domain string Yes The domain associated with the organization (must be unique, e.g. acme.com).

Example Request (curl)

curl -X POST https://ids.fabrixly.com/api/organizations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-admin-jwt-token>" \
  -d '{
    "name": "Acme Corp",
    "domain": "acme.com"
  }'

Response (201 Created)

{
  "id": "org_xyz789abc",
  "name": "Acme Corp",
  "domain": "acme.com",
  "createdAt": "2026-07-07T12:00:00.000Z",
  "updatedAt": "2026-07-07T12:00:00.000Z"
}

Error Responses

400 Bad Request (Domain already in use)

{
  "error": "Organization with this domain already exists"
}

403 Forbidden (License limit exceeded or not System Admin)

{
  "error": "Maximum organization limit reached for this system license. Please contact the administrator."
}

2. List Organizations

Get all organizations.

  • HTTP Method: GET
  • Path: /api/organizations
  • Headers:
    • Authorization: Bearer <your-admin-jwt-token>

Example Request (curl)

curl -X GET https://ids.fabrixly.com/api/organizations \
  -H "Authorization: Bearer <your-admin-jwt-token>"

Response (200 OK)

[
  {
    "id": "org_xyz789abc",
    "name": "Acme Corp",
    "subdomain": "acme",
    "domain": "acme.com",
    "status": "active"
  }
]

3. Get Organization Details

Retrieves details of a specific organization by ID.

  • HTTP Method: GET
  • Path: /api/organizations/:id
  • Headers:
    • Authorization: Bearer <your-admin-jwt-token>

Example Request (curl)

curl -X GET https://ids.fabrixly.com/api/organizations/org_xyz789abc \
  -H "Authorization: Bearer <your-admin-jwt-token>"

4. Update Organization Settings

Modifies configurations of an existing organization.

  • HTTP Method: PUT
  • Path: /api/organizations/:id
  • Headers:
    • Content-Type: application/json
    • Authorization: Bearer <your-admin-jwt-token>

Example Request (curl)

curl -X PUT https://ids.fabrixly.com/api/organizations/org_xyz789abc \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-admin-jwt-token>" \
  -d '{
    "name": "Acme Corporation",
    "status": "active"
  }'

Response (200 OK)

{
  "id": "org_xyz789abc",
  "name": "Acme Corporation",
  "subdomain": "acme",
  "domain": "acme.com",
  "status": "active"
}

5. Delete Organization

Deletes an organization and all associated database records.

  • HTTP Method: DELETE
  • Path: /api/organizations/:id
  • Headers:
    • Authorization: Bearer <your-admin-jwt-token>

Example Request (curl)

curl -X DELETE https://ids.fabrixly.com/api/organizations/org_xyz789abc \
  -H "Authorization: Bearer <your-admin-jwt-token>"

Response (200 OK)

{
  "message": "Organization deleted successfully"
}

Subscribe to The Fabrixly Blog

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe