Organizations API
Teams, members, and shared workspaces
2 min readTeam collaboration and organization management. Create organizations for team workspaces, invite members via email, assign roles with different permission levels (owner, admin, member), and manage team subscriptions. Organizations can own projects and share resources across team members.
Available Endpoints
Endpoints
/api/user/organizations/{organizationId}/audit-logsGet audit logs
Get audit logs for the organization.
organization:manage-membersRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}/audit-logs" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/audit-logs", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Query Parameters
| Name | Type | Description |
|---|---|---|
offset | integer,null | Number of items to skip0 |
limit | number | Number of items to return (max 100)20 |
action | string | Filter by action typeauth.login |
resourceType | string | Filter by resource typeuser |
resourceId | string | Filter by resource ID550e8400-e29b-41d4-a716-446655440000 |
userId | string | Filter by user ID550e8400-e29b-41d4-a716-446655440000 |
startDate | string | Filter logs after this date2024-01-01T00:00:00.000Z |
endDate | string | Filter logs before this date2024-12-31T23:59:59.000Z |
Response 200
Audit logs retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"logs": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"createdAt": "2024-01-15T10:30:00.000Z",
"organizationId": "550e8400-e29b-41d4-a716-446655440001",
"userId": "507f1f77bcf86cd799439013",
"actor": {},
"action": "member.invite",
"resourceType": "member",
"resourceId": "507f1f77bcf86cd799439014",
"metadata": {},
"ipAddress": "192.168.1.1",
"userAgent": "Mozilla/5.0...",
"auditSessionId": "sess_xxx",
"traceId": {}
}
],
"total": 100,
"offset": 0,
"limit": 25,
"hasMore": true
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/audit-logs/exportExport audit logs
Export audit logs as CSV or JSON.
organization:manage-membersRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}/audit-logs/export" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/audit-logs/export", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Query Parameters
| Name | Type | Description |
|---|---|---|
action | string | Filter by action type |
resourceType | string | Filter by resource type |
userId | string | Filter by user ID550e8400-e29b-41d4-a716-446655440000 |
startDate | string | Filter logs after this date |
endDate | string | Filter logs before this date |
format | AuditExportFormat |
Response 200
Audit logs exported successfully
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"createdAt": "2024-01-15T10:30:00.000Z",
"organizationId": "550e8400-e29b-41d4-a716-446655440001",
"userId": "507f1f77bcf86cd799439013",
"actor": {},
"action": "member.invite",
"resourceType": "member",
"resourceId": "507f1f77bcf86cd799439014",
"metadata": {},
"ipAddress": "192.168.1.1",
"userAgent": "Mozilla/5.0...",
"auditSessionId": "sess_xxx",
"traceId": {}
}
]Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizationsList organizations
Get all organizations the authenticated user belongs to.
user:readRequest
curl -X GET "http://localhost:3030/api/user/organizations" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Response 200
Organizations retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Acme Corporation",
"slug": "acme-corp",
"status": "active",
"type": "team",
"tierId": {},
"seatCap": 5,
"slotCap": 5,
"hasActiveSubscription": true,
"isPersonal": false
}
]
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizationsCreate organization
Create a new organization. The authenticated user becomes the owner.
user:writeRequest
curl -X POST "http://localhost:3030/api/user/organizations" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"name":"Acme Corporation","slug":"acme-corp"}'const response = await fetch("http://localhost:3030/api/user/organizations", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Acme Corporation",
"slug": "acme-corp"
}),
});
const data = await response.json();
console.log(data);Body Parameters
| Name | Type | Description |
|---|---|---|
namerequired | string | Organization nameAcme Corporation |
slug | string | URL-friendly slug (auto-generated if not provided)acme-corp |
Response 201
Organization created successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"name": "Acme Corporation",
"slug": "acme-corp",
"status": "active",
"type": "team",
"tierId": {},
"subscription": {
"stripeSubscriptionId": "sub_xxx",
"status": "active",
"interval": "monthly",
"currentPeriodEnd": "2024-12-31T23:59:59.000Z",
"cancelAt": null
},
"hasActiveSubscription": true,
"seatCap": 5,
"slotCap": 5,
"slotPacks": 0,
"creditBalance": 1500,
"requireMfa": false,
"ssoEnabled": false,
"isPersonal": false
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}Get organization
Get organization details.
organization:readRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
Organization retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"name": "Acme Corporation",
"slug": "acme-corp",
"status": "active",
"type": "team",
"tierId": {},
"subscription": {
"stripeSubscriptionId": "sub_xxx",
"status": "active",
"interval": "monthly",
"currentPeriodEnd": "2024-12-31T23:59:59.000Z",
"cancelAt": null
},
"hasActiveSubscription": true,
"seatCap": 5,
"slotCap": 5,
"slotPacks": 0,
"creditBalance": 1500,
"requireMfa": false,
"ssoEnabled": false,
"isPersonal": false
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}Update organization
Update organization details. Requires owner + admin.
organization:manage-membersRequest
curl -X PUT "http://localhost:3030/api/user/organizations/{organizationId}" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"name":"Acme Inc","slug":"acme-inc"}'const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Acme Inc",
"slug": "acme-inc"
}),
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Body Parameters
| Name | Type | Description |
|---|---|---|
name | string | Acme Inc |
slug | string | acme-inc |
Response 200
Organization updated successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"name": "Acme Corporation",
"slug": "acme-corp",
"status": "active",
"type": "team",
"tierId": {},
"subscription": {
"stripeSubscriptionId": "sub_xxx",
"status": "active",
"interval": "monthly",
"currentPeriodEnd": "2024-12-31T23:59:59.000Z",
"cancelAt": null
},
"hasActiveSubscription": true,
"seatCap": 5,
"slotCap": 5,
"slotPacks": 0,
"creditBalance": 1500,
"requireMfa": false,
"ssoEnabled": false,
"isPersonal": false
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/membersList members
Get all members of the organization.
organization:readRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}/members" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/members", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
Members retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"organizationId": "550e8400-e29b-41d4-a716-446655440001",
"role": {},
"status": "active",
"invitedAt": "2024-01-01T00:00:00.000Z",
"joinedAt": "2024-01-02T00:00:00.000Z",
"user": {
"id": "507f1f77bcf86cd799439013",
"fullName": "John Doe"
},
"invitedBy": {},
"canManageMembers": true,
"canManageProjects": true,
"canManageBilling": false
}
]
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/members/{memberId}/roleUpdate member role
Change a member's role. Requires owner + admin.
organization:manage-membersRequest
curl -X PUT "http://localhost:3030/api/user/organizations/{organizationId}/members/{memberId}/role" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"role":{}}'const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/members/{memberId}/role", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"role": {}
}),
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
memberIdrequired | string | Member/Membership ID550e8400-e29b-41d4-a716-446655440000 |
Body Parameters
| Name | Type | Description |
|---|---|---|
rolerequired | any |
Response 200
Member role updated successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"organizationId": "550e8400-e29b-41d4-a716-446655440001",
"role": {},
"status": "active",
"invitedAt": "2024-01-01T00:00:00.000Z",
"joinedAt": "2024-01-02T00:00:00.000Z",
"user": {
"id": "507f1f77bcf86cd799439013",
"fullName": "John Doe"
},
"invitedBy": {},
"canManageMembers": true,
"canManageProjects": true,
"canManageBilling": false
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/members/{memberId}Remove member
Remove a member from the organization. Requires owner + admin.
organization:manage-membersRequest
curl -X DELETE "http://localhost:3030/api/user/organizations/{organizationId}/members/{memberId}" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/members/{memberId}", {
method: "DELETE",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
memberIdrequired | string | Member/Membership ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
Member removed successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"message": "string"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/my-membershipGet my membership
Get the authenticated user's membership details in the organization.
organization:readRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}/my-membership" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/my-membership", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
Membership retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"organizationId": "550e8400-e29b-41d4-a716-446655440001",
"role": {},
"status": "active",
"invitedAt": "2024-01-01T00:00:00.000Z",
"joinedAt": "2024-01-02T00:00:00.000Z",
"user": {
"id": "507f1f77bcf86cd799439013",
"fullName": "John Doe"
},
"invitedBy": {},
"canManageMembers": true,
"canManageProjects": true,
"canManageBilling": false
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/invitesList organization invites
Get all pending invites for the organization.
organization:manage-membersRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}/invites" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/invites", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
Invites retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"organizationId": "550e8400-e29b-41d4-a716-446655440001",
"role": {},
"status": "active",
"invitedAt": "2024-01-01T00:00:00.000Z",
"joinedAt": "2024-01-02T00:00:00.000Z",
"user": {
"id": "507f1f77bcf86cd799439013",
"fullName": "John Doe"
},
"invitedBy": {},
"canManageMembers": true,
"canManageProjects": true,
"canManageBilling": false
}
]
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/invitesSend invitations
Invite new members to the organization.
organization:manage-membersRequest
curl -X POST "http://localhost:3030/api/user/organizations/{organizationId}/invites" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"emails":["[email protected]"],"role":{}}'const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/invites", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"emails": [
"[email protected]"
],
"role": {}
}),
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Body Parameters
| Name | Type | Description |
|---|---|---|
emailsrequired | string[] | Email addresses to invite |
rolerequired | any |
Response 200
Invites sent successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"sent": [
"[email protected]"
],
"alreadyMembers": [
"[email protected]"
],
"alreadyInvited": [
"[email protected]"
],
"invalidEmails": [
"string"
]
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/invites/{memberId}Cancel invitation
Cancel a pending invitation.
organization:manage-membersRequest
curl -X DELETE "http://localhost:3030/api/user/organizations/{organizationId}/invites/{memberId}" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/invites/{memberId}", {
method: "DELETE",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
memberIdrequired | string | Member/Membership ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
Invite cancelled successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"message": "string"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/invites/{memberId}/resendResend invitation
Resend an invitation email to a pending member.
organization:manage-membersRequest
curl -X POST "http://localhost:3030/api/user/organizations/{organizationId}/invites/{memberId}/resend" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/invites/{memberId}/resend", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
memberIdrequired | string | Member/Membership ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
Invite resent successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"organizationId": "550e8400-e29b-41d4-a716-446655440001",
"role": {},
"status": "active",
"invitedAt": "2024-01-01T00:00:00.000Z",
"joinedAt": "2024-01-02T00:00:00.000Z",
"user": {
"id": "507f1f77bcf86cd799439013",
"fullName": "John Doe"
},
"invitedBy": {},
"canManageMembers": true,
"canManageProjects": true,
"canManageBilling": false
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/invites/{token}/acceptAccept invitation
Accept an organization invitation using the invite token.
user:writeRequest
curl -X POST "http://localhost:3030/api/user/invites/{token}/accept" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/invites/{token}/accept", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
tokenrequired | string | Invitation token |
Response 201
Invitation accepted successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"organizationId": "550e8400-e29b-41d4-a716-446655440001",
"role": {},
"status": "active",
"invitedAt": "2024-01-01T00:00:00.000Z",
"joinedAt": "2024-01-02T00:00:00.000Z",
"user": {
"id": "507f1f77bcf86cd799439013",
"fullName": "John Doe"
},
"invitedBy": {},
"canManageMembers": true,
"canManageProjects": true,
"canManageBilling": false
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/settings/billingGet billing settings
Get billing settings for the organization. Requires owner.
organization:manage-billingRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}/settings/billing" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/settings/billing", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
Billing settings retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"billingEmail": "[email protected]",
"effectiveEmail": "[email protected]"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/settings/billingUpdate billing settings
Update billing settings for the organization. Requires owner.
organization:manage-billingRequest
curl -X PUT "http://localhost:3030/api/user/organizations/{organizationId}/settings/billing" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"billingEmail":"[email protected]"}'const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/settings/billing", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"billingEmail": "[email protected]"
}),
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Body Parameters
| Name | Type | Description |
|---|---|---|
billingEmailrequired | string,null | Email address for billing communications. Set to null to use owner email. |
Response 200
Billing settings updated successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"billingEmail": "[email protected]",
"effectiveEmail": "[email protected]"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/mfaGet MFA settings
Get MFA settings for the organization.
organization:readRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}/mfa" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/mfa", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
MFA settings retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"requireMfa": true,
"gracePeriodDays": 7,
"gracePeriodEndsAt": "2024-01-15T00:00:00.000Z"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/mfaUpdate MFA settings
Update MFA requirements for the organization. Requires owner + admin.
organization:manage-membersRequest
curl -X PUT "http://localhost:3030/api/user/organizations/{organizationId}/mfa" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"requireMfa":true,"gracePeriodDays":7}'const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/mfa", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"requireMfa": true,
"gracePeriodDays": 7
}),
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Body Parameters
| Name | Type | Description |
|---|---|---|
requireMfarequired | boolean | Whether to require MFAtrue |
gracePeriodDays | number | Grace period in days7 |
Response 200
MFA settings updated successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"requireMfa": true,
"gracePeriodDays": 7,
"gracePeriodEndsAt": "2024-01-15T00:00:00.000Z"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/mfa/complianceGet MFA compliance status
Get MFA compliance status across organization members.
organization:readRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}/mfa/compliance" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/mfa/compliance", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
MFA compliance status retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"isCompliant": true,
"compliancePercentage": 85,
"totalMembers": 10,
"compliantMembers": 8,
"nonCompliantMembers": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"userId": "550e8400-e29b-41d4-a716-446655440001",
"email": "[email protected]",
"fullName": "John Doe"
}
],
"gracePeriodActive": false,
"gracePeriodEndsAt": "2024-01-15T00:00:00.000Z"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/settings/ssoGet SSO configuration
Get SSO configuration for the organization.
organization:manage-membersRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}/settings/sso" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/settings/sso", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
SSO configuration retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"enabled": true,
"provider": "okta",
"domain": "acme.com",
"issuerUrl": "https://acme.okta.com",
"clientId": "0oa..."
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/settings/ssoUpdate SSO configuration
Update organization SSO configuration. Requires owner.
organization:manage-billingRequest
curl -X PUT "http://localhost:3030/api/user/organizations/{organizationId}/settings/sso" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"provider":"okta","issuerUrl":"https://example.com","clientId":"string","clientSecret":"string"}'const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/settings/sso", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"provider": "okta",
"issuerUrl": "https://example.com",
"clientId": "string",
"clientSecret": "string"
}),
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Body Parameters
| Name | Type | Description |
|---|---|---|
providerrequired | SsoProvider | SSO providerokta |
issuerUrlrequired | string | OIDC issuer URL |
clientIdrequired | string | OAuth client ID |
clientSecretrequired | string | OAuth client secret |
Response 200
SSO configuration updated successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"enabled": true,
"provider": "okta",
"domain": "acme.com",
"issuerUrl": "https://acme.okta.com",
"clientId": "0oa..."
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/settings/ssoDisable SSO
Remove SSO configuration from the organization.
organization:manage-billingRequest
curl -X DELETE "http://localhost:3030/api/user/organizations/{organizationId}/settings/sso" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/settings/sso", {
method: "DELETE",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
SSO configuration deleted successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"message": "string"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/settings/sso/testTest SSO configuration
Test the SSO configuration by attempting a connection.
organization:manage-membersRequest
curl -X POST "http://localhost:3030/api/user/organizations/{organizationId}/settings/sso/test" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/settings/sso/test", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
SSO test completed
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"success": true,
"connectionSuccessful": true,
"message": "string",
"error": "string"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/domainsList organization domains
Get all domains associated with the organization.
organization:readRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}/domains" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/domains", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
Domains retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"domains": [
{
"id": "string",
"domain": "acme.com",
"status": "pending",
"verificationMethod": "dns_txt",
"dnsRecordName": "_<project>-verify.acme.com",
"dnsRecordValue": "abc123...",
"verifiedAt": {},
"lastVerificationAttempt": {},
"verificationError": {},
"createdAt": "string",
"organizationId": "550e8400-e29b-41d4-a716-446655440000",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
]
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/domainsAdd domain for verification
Add a new domain to verify. Returns a verification token for DNS TXT record.
organization:manage-billingRequest
curl -X POST "http://localhost:3030/api/user/organizations/{organizationId}/domains" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"domain":"acme.com"}'const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/domains", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"domain": "acme.com"
}),
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Body Parameters
| Name | Type | Description |
|---|---|---|
domainrequired | string | Domain to add for verificationacme.com |
Response 201
Domain added, verification pending
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"id": "string",
"domain": "acme.com",
"status": "pending",
"verificationMethod": "dns_txt",
"dnsRecordName": "_<project>-verify.acme.com",
"dnsRecordValue": "abc123...",
"verifiedAt": {},
"lastVerificationAttempt": {},
"verificationError": {},
"createdAt": "string",
"organizationId": "550e8400-e29b-41d4-a716-446655440000",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/domains/{domainId}Get domain
Get a specific domain for the organization.
organization:readRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}/domains/{domainId}" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/domains/{domainId}", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
domainIdrequired | string | Domain ID550e8400-e29b-41d4-a716-446655440001 |
Response 200
Domain retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"id": "string",
"domain": "acme.com",
"status": "pending",
"verificationMethod": "dns_txt",
"dnsRecordName": "_<project>-verify.acme.com",
"dnsRecordValue": "abc123...",
"verifiedAt": {},
"lastVerificationAttempt": {},
"verificationError": {},
"createdAt": "string",
"organizationId": "550e8400-e29b-41d4-a716-446655440000",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/domains/{domainId}Remove domain
Remove a domain from the organization.
organization:manage-billingRequest
curl -X DELETE "http://localhost:3030/api/user/organizations/{organizationId}/domains/{domainId}" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/domains/{domainId}", {
method: "DELETE",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
domainIdrequired | string | Domain ID550e8400-e29b-41d4-a716-446655440001 |
Response 200
Domain removed successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"message": "string"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/domains/{domainId}/verifyVerify domain ownership
Attempt to verify domain ownership by checking DNS TXT record.
organization:manage-billingRequest
curl -X POST "http://localhost:3030/api/user/organizations/{organizationId}/domains/{domainId}/verify" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/domains/{domainId}/verify", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
domainIdrequired | string | Domain ID550e8400-e29b-41d4-a716-446655440001 |
Response 200
Verification attempted
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"id": "string",
"domain": "acme.com",
"status": "pending",
"verificationMethod": "dns_txt",
"dnsRecordName": "_<project>-verify.acme.com",
"dnsRecordValue": "abc123...",
"verifiedAt": {},
"lastVerificationAttempt": {},
"verificationError": {},
"createdAt": "string",
"organizationId": "550e8400-e29b-41d4-a716-446655440000",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/settings/securityGet security settings
Get security settings for the organization.
organization:readRequest
curl -X GET "http://localhost:3030/api/user/organizations/{organizationId}/settings/security" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/settings/security", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Response 200
Security settings retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"authRequired": "any",
"requireMfa": false
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}/api/user/organizations/{organizationId}/settings/securityUpdate security settings
Update security settings for the organization. Requires owner.
organization:manage-securityRequest
curl -X PUT "http://localhost:3030/api/user/organizations/{organizationId}/settings/security" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"authRequired":{},"requireMfa":true}'const response = await fetch("http://localhost:3030/api/user/organizations/{organizationId}/settings/security", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"authRequired": {},
"requireMfa": true
}),
});
const data = await response.json();
console.log(data);Path Parameters
| Name | Type | Description |
|---|---|---|
organizationIdrequired | string | Organization ID550e8400-e29b-41d4-a716-446655440000 |
Body Parameters
| Name | Type | Description |
|---|---|---|
authRequired | any | |
requireMfa | boolean | Whether MFA is required for all memberstrue |
Response 200
Security settings updated successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
"authRequired": "any",
"requireMfa": false
}
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}