How to Use Role and Team Management APIs

This guide describes how to manage role-based access control (RBAC) Roles and Teams inside Fabrixly-IDS.


πŸ” Authentication & Prerequisites

All role and team 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.


Part A: Role Management APIs

Roles define specific sets of privileges (permissions) for users within the organization context.

1. Create a Role

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

Example Request (curl)

curl -X POST https://ids.fabrixly.com/api/roles \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-admin-jwt-token>" \
  -d '{
    "name": "SUPPORT_STAFF",
    "description": "Customer support agents with access to user profiles"
  }'

Response (201 Created)

{
  "id": "rol_123xyz789",
  "name": "SUPPORT_STAFF",
  "description": "Customer support agents with access to user profiles"
}

2. List Roles

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

Example Request (curl)

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

Response (200 OK)

[
  {
    "id": "rol_123xyz789",
    "name": "SUPPORT_STAFF",
    "description": "Customer support agents with access to user profiles"
  }
]

3. Delete a Role

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

Example Request (curl)

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

Response (200 OK)

{
  "message": "Role deleted successfully"
}

Part B: Team Management APIs

Teams segment users into collaborative divisions (e.g., Engineering, Marketing, Finance).

1. Create a Team

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

Example Request (curl)

curl -X POST https://ids.fabrixly.com/api/teams \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-admin-jwt-token>" \
  -d '{
    "name": "Engineering Support Team",
    "description": "Team handling active developer integrations"
  }'

Response (201 Created)

{
  "id": "tem_987abc654",
  "name": "Engineering Support Team",
  "description": "Team handling active developer integrations"
}

2. List Teams

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

Example Request (curl)

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

Response (200 OK)

[
  {
    "id": "tem_987abc654",
    "name": "Engineering Support Team",
    "description": "Team handling active developer integrations"
  }
]

3. Update Team Details

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

Example Request (curl)

curl -X PUT https://ids.fabrixly.com/api/teams/tem_987abc654 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-admin-jwt-token>" \
  -d '{
    "name": "Engineering Support Team (Updated)"
  }'

Response (200 OK)

{
  "id": "tem_987abc654",
  "name": "Engineering Support Team (Updated)",
  "description": "Team handling active developer integrations"
}

4. Delete a Team

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

Example Request (curl)

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

Response (200 OK)

{
  "message": "Team 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