Organization APIs
API documentation for organization-related endpoints
1. Create Organization
- URL:
/organizations
- Method:
POST
- Description: Creates a new organization.
- Request Body:
{ "orgName": "string", "roles": [ { "id": "string", "name": "string" } ] }
- Response:
- Success:
201 Created
{ "orgId": "string", "orgName": "string", "roles": [ { "id": "string", "name": "string" } ] }
- Error:
500 Internal Server Error
{ "message": "An error occurred while creating the organization", "error": "Detailed error message" }
- Success:
2. Update Organization
- URL:
/organizations/:orgId
- Method:
PUT
- Description: Updates an existing organization.
- Request Body:
{ "orgName": "string (optional)", "roles": [ { "id": "string", "name": "string" } ] }
- Response:
- Success:
200 OK
{ "message": "Organization updated successfully" }
- Error:
500 Internal Server Error
{ "message": "An error occurred while updating the organization", "error": "Detailed error message" }
- Success:
3. Add Role to Organization
- URL:
/organizations/:orgId/roles
- Method:
POST
- Description: Adds a new role to an existing organization.
- Request Body:
{ "id": "string", "name": "string" }
- Response:
- Success:
200 OK
{ "message": "Role added successfully" }
- Error:
500 Internal Server Error
{ "message": "An error occurred while adding the role", "error": "Detailed error message" }
- Success: