Organizations API
Manage organizations, hierarchies, and multi-tenant configurations. Control organization settings, members, and sub-organizations.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /organizations | List organizations |
GET | /organizations/:id | Get organization |
POST | /organizations | Create organization |
PATCH | /organizations/:id | Update organization |
DELETE | /organizations/:id | Delete organization |
GET | /organizations/:id/members | List organization members |
POST | /organizations/:id/members | Add member |
List Organizations
GET /v1/organizationsbash
curl "https://api.accessiq.io/v1/organizations?limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": [
{
"id": "org_acme",
"name": "Acme Corporation",
"slug": "acme-corp",
"description": "Global technology company",
"type": "enterprise",
"status": "active",
"parentId": null,
"settings": {
"allowPublicSignup": false,
"requireMfa": true,
"sessionTimeout": 3600,
"allowedDomains": ["acme.com", "acme.io"]
},
"metadata": {
"industry": "Technology",
"size": "1000+"
},
"memberCount": 523,
"createdAt": "2023-01-15T10:00:00Z",
"updatedAt": "2024-01-10T14:30:00Z"
}
],
"pagination": {
"total": 15,
"page": 1,
"limit": 20,
"hasMore": false
}
}Get Organization
GET /v1/organizations/:idbash
curl https://api.accessiq.io/v1/organizations/org_acme \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": {
"id": "org_acme",
"name": "Acme Corporation",
"slug": "acme-corp",
"description": "Global technology company",
"logo": "https://cdn.accessiq.io/orgs/org_acme/logo.png",
"type": "enterprise",
"status": "active",
"parentId": null,
"children": [
{
"id": "org_acme_engineering",
"name": "Acme Engineering",
"memberCount": 150
},
{
"id": "org_acme_sales",
"name": "Acme Sales",
"memberCount": 85
}
],
"settings": {
"allowPublicSignup": false,
"requireMfa": true,
"mfaMethods": ["totp", "sms"],
"sessionTimeout": 3600,
"passwordPolicy": {
"minLength": 12,
"requireUppercase": true,
"requireNumbers": true,
"requireSymbols": true,
"preventReuse": 5
},
"allowedDomains": ["acme.com", "acme.io"],
"defaultRole": "role_member"
},
"branding": {
"primaryColor": "#0066CC",
"logo": "https://cdn.accessiq.io/orgs/org_acme/logo.png",
"favicon": "https://cdn.accessiq.io/orgs/org_acme/favicon.ico"
},
"identityProviders": [
{
"id": "idp_azure",
"name": "Azure AD",
"type": "oidc",
"enabled": true
}
],
"metadata": {
"industry": "Technology",
"size": "1000+",
"region": "North America"
},
"memberCount": 523,
"createdAt": "2023-01-15T10:00:00Z",
"updatedAt": "2024-01-10T14:30:00Z"
}
}Create Organization
POST /v1/organizationsbash
curl -X POST https://api.accessiq.io/v1/organizations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Engineering",
"slug": "acme-engineering",
"description": "Engineering division",
"parentId": "org_acme",
"settings": {
"requireMfa": true,
"sessionTimeout": 7200
},
"metadata": {
"department": "Engineering",
"costCenter": "ENG-001"
}
}'
# Response (201 Created)
{
"data": {
"id": "org_acme_eng",
"name": "Acme Engineering",
"slug": "acme-engineering",
"parentId": "org_acme",
"status": "active",
"memberCount": 0,
"createdAt": "2024-01-15T12:00:00Z"
}
}Hierarchy
Sub-organizations inherit settings from their parent by default. Override specific settings as needed.
Update Organization
PATCH /v1/organizations/:idbash
curl -X PATCH https://api.accessiq.io/v1/organizations/org_acme \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corp International",
"settings": {
"sessionTimeout": 1800,
"requireMfa": true
}
}'
# Response
{
"data": {
"id": "org_acme",
"name": "Acme Corp International",
"settings": {
"sessionTimeout": 1800,
"requireMfa": true
},
"updatedAt": "2024-01-15T13:00:00Z"
}
}Organization Members
GET /v1/organizations/:id/membersbash
curl "https://api.accessiq.io/v1/organizations/org_acme/members?limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": [
{
"userId": "user_abc123",
"email": "john@acme.com",
"displayName": "John Doe",
"role": "admin",
"status": "active",
"joinedAt": "2023-06-01T09:00:00Z"
}
],
"pagination": {
"total": 523,
"page": 1,
"limit": 20,
"hasMore": true
}
}Add Member
POST /v1/organizations/:id/membersbash
curl -X POST https://api.accessiq.io/v1/organizations/org_acme/members \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"userId": "user_def456",
"role": "member",
"sendNotification": true
}'
# Response (201 Created)
{
"data": {
"userId": "user_def456",
"organizationId": "org_acme",
"role": "member",
"joinedAt": "2024-01-15T14:00:00Z"
}
}Remove Member
DELETE /v1/organizations/:id/members/:userIdbash
curl -X DELETE https://api.accessiq.io/v1/organizations/org_acme/members/user_def456 \
-H "Authorization: Bearer YOUR_API_KEY"
# Response: 204 No ContentOrganization Hierarchy
GET /v1/organizations/:id/hierarchybash
curl https://api.accessiq.io/v1/organizations/org_acme/hierarchy \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": {
"id": "org_acme",
"name": "Acme Corporation",
"children": [
{
"id": "org_acme_eng",
"name": "Engineering",
"memberCount": 150,
"children": [
{
"id": "org_acme_eng_frontend",
"name": "Frontend Team",
"memberCount": 25,
"children": []
},
{
"id": "org_acme_eng_backend",
"name": "Backend Team",
"memberCount": 30,
"children": []
}
]
},
{
"id": "org_acme_sales",
"name": "Sales",
"memberCount": 85,
"children": []
}
]
}
}Organization Schema
Organization Objecttypescript
interface Organization {
id: string;
name: string;
slug: string;
description?: string;
logo?: string;
type: 'standard' | 'enterprise';
status: 'active' | 'suspended' | 'pending';
parentId?: string;
children?: Organization[];
settings: {
allowPublicSignup: boolean;
requireMfa: boolean;
mfaMethods?: ('totp' | 'sms' | 'email' | 'passkey')[];
sessionTimeout: number;
passwordPolicy?: PasswordPolicy;
allowedDomains?: string[];
defaultRole?: string;
};
branding?: {
primaryColor?: string;
logo?: string;
favicon?: string;
};
identityProviders?: IdentityProviderSummary[];
metadata?: Record<string, any>;
memberCount: number;
createdAt: string;
updatedAt: string;
}Multi-Tenant Architecture
AccessIQ supports complex organizational hierarchies. Use sub-organizations for departments, teams, or regional divisions with inherited but overridable settings.