Skip to content

Organisation Management

Retrieve and update organisation settings.

Endpoints


Get Organisation

Retrieve the current user's organisation details.

Endpoint

GET /v1/admin/organisation

Authentication

  • Required: Yes
  • Required Permission: None (all authenticated users can view their organisation)

Response (200 OK)

json
{
  "id": "org_01h2xz9k3m4n5p6q7r8s9t0v1x",
  "slug": "acme-corp",
  "name": "Acme Corporation",
  "email": "[email protected]",
  "phone": "+1234567890",
  "website": "https://acme-corp.com",
  "ownerId": "usr_01h2xz9k3m4n5p6q7r8s9t0v1w",
  "allowedCallbackUrls": ["https://app.acme-corp.com/callback"],
  "allowedLogoutUrls": ["https://app.acme-corp.com/logout"],
  "allowedOrigins": ["https://app.acme-corp.com"],
  "sessionLifetime": 604800,
  "sessionIdleTimeout": 86400,
  "requireMfa": false,
  "allowedMfaMethods": ["totp", "sms"],
  "passwordPolicy": {
    "minLength": 8,
    "requireUppercase": true,
    "requireLowercase": true,
    "requireNumbers": true,
    "requireSymbols": true
  },
  "tokenLifetimePolicy": {
    "accessToken": 3600,
    "refreshToken": 2592000,
    "idToken": 3600
  },
  "branding": {
    "logoUrl": "https://cdn.acme-corp.com/logo.png",
    "primaryColor": "#007bff"
  },
  "metadata": {},
  "createdAt": "2025-01-01T00:00:00.000Z",
  "updatedAt": "2025-10-26T10:00:00.000Z"
}

Example

bash
curl -X GET https://api.cerberus-iam.dev/v1/admin/organisation \
  -H "Cookie: cerberus_session=abc123..." \
  -H "X-CSRF-Token: xyz789..."

Update Organisation

Update organisation settings.

Endpoint

PATCH /v1/admin/organisation

Authentication

  • Required: Yes
  • Required Permission: organisation:update

Request Body (all optional)

json
{
  "name": "Acme Corporation Inc.",
  "email": "[email protected]",
  "phone": "+1234567890",
  "website": "https://acme-corp.com",
  "allowedCallbackUrls": ["https://app.acme-corp.com/callback"],
  "allowedLogoutUrls": ["https://app.acme-corp.com/logout"],
  "allowedOrigins": ["https://app.acme-corp.com"],
  "sessionLifetime": 604800,
  "sessionIdleTimeout": 86400,
  "requireMfa": true,
  "allowedMfaMethods": ["totp"],
  "passwordPolicy": {
    "minLength": 12,
    "requireUppercase": true,
    "requireLowercase": true,
    "requireNumbers": true,
    "requireSymbols": true
  },
  "tokenLifetimePolicy": {
    "accessToken": 1800,
    "refreshToken": 1296000
  },
  "branding": {
    "logoUrl": "https://cdn.acme-corp.com/logo.png",
    "primaryColor": "#007bff"
  },
  "metadata": {
    "industry": "technology"
  }
}
FieldTypeDescription
namestringOrganisation name
emailstringContact email (valid email format)
phonestringContact phone number
websitestringWebsite URL (valid URL format)
allowedCallbackUrlsarrayOAuth callback URLs (valid URLs)
allowedLogoutUrlsarrayAllowed logout redirect URLs
allowedOriginsarrayCORS allowed origins
sessionLifetimenumberSession lifetime in seconds
sessionIdleTimeoutnumberIdle timeout in seconds
requireMfabooleanRequire MFA for all users
allowedMfaMethodsarrayAllowed MFA methods
passwordPolicyobjectPassword requirements
tokenLifetimePolicyobjectToken expiration settings
brandingobjectUI branding configuration
metadataobjectCustom metadata

Response (200 OK)

Returns the updated organisation object.

Example

bash
curl -X PATCH https://api.cerberus-iam.dev/v1/admin/organisation \
  -H "Cookie: cerberus_session=abc123..." \
  -H "X-CSRF-Token: xyz789..." \
  -H "Content-Type: application/json" \
  -d '{"name":"Acme Corporation Inc.","requireMfa":true}'

Delete Organisation

Soft-delete the organisation (owner only).

Endpoint

DELETE /v1/admin/organisation

Authentication

  • Required: Yes
  • Required Permission: organisation:delete
  • Additional Requirement: Must be the organisation owner

Response (204 No Content)

Empty response on success.

Error Responses

403 Forbidden

json
{
  "type": "https://cerberus-iam.dev/problems/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Only the organisation owner can delete the organisation",
  "instance": "/v1/admin/organisation"
}

Example

bash
curl -X DELETE https://api.cerberus-iam.dev/v1/admin/organisation \
  -H "Cookie: cerberus_session=abc123..." \
  -H "X-CSRF-Token: xyz789..."

Notes

  • The slug field cannot be changed after creation
  • Updating requireMfa to true will enforce MFA for all users on next login
  • The passwordPolicy applies to new passwords only (existing passwords are not retroactively validated)
  • sessionLifetime and sessionIdleTimeout affect new sessions only
  • Organisation deletion is a soft delete - data is retained for audit purposes
  • Only the organisation owner can delete the organisation
  • Deleting an organisation marks all associated data as deleted

Released under the MIT License.