SutraID|Developer Docs
QuickstartAPI ReferenceDashboard

Settings & Configuration

Manage instance-level configuration including branding, security policies, and initial onboarding.

GET/api/v1/settingsGet instance settingsBearer Token

Returns the current instance settings including name, branding, allowed domains, MFA requirements, and custom login configuration.

Response Fields

NameTypeRequiredDescription
idstringOptionalSingleton identifier (always "singleton").
namestringOptionalInstance display name.
logoUrlstring | nullOptionalPublic URL of the instance logo.
primaryColorstringOptionalBrand hex color used in hosted UI.
allowedDomainsstring[]OptionalEmail domains permitted for self-service sign-up.
mfaRequiredbooleanOptionalWhether MFA is mandatory for all users.
mfaGracePeriodDaysnumberOptionalNumber of days users have to enroll MFA after it becomes required.
customLoginConfigobject | nullOptionalCustom login page configuration (headline, subtitle, background).
createdAtstringOptionalISO 8601 creation timestamp.
updatedAtstringOptionalISO 8601 last-update timestamp.

Response Example

{
  "id": "singleton",
  "name": "Acme Corp",
  "logoUrl": "https://cdn.acme.com/logo.png",
  "primaryColor": "#0057FF",
  "allowedDomains": [
    "acme.com",
    "acme.io"
  ],
  "mfaRequired": true,
  "mfaGracePeriodDays": 7,
  "customLoginConfig": {
    "headline": "Welcome to Acme",
    "subtitle": "Sign in to your account"
  },
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-06-15T10:30:00Z"
}

Code Examples

curl -X GET "https://api.sutraid.com/api/v1/settings" \
  -H "Authorization: Bearer <your_token>"
PUT/api/v1/settingsUpdate instance settingsBearer Token

Updates branding, security, and login customization settings for the instance. Only provided fields are changed.

Request Body

NameTypeRequiredDescription
namestringOptionalInstance display name.e.g. Acme Corp
logoUrlstringOptionalPublic URL of the instance logo.e.g. https://cdn.acme.com/logo.png
primaryColorstringOptionalBrand hex color used in hosted UI.e.g. #0057FF
customLoginConfigobjectOptionalCustom login page configuration (headline, subtitle, background image, etc.).e.g. {"headline":"Welcome","subtitle":"Sign in"}

Response Fields

NameTypeRequiredDescription
idstringOptionalSingleton identifier.
namestringOptionalUpdated instance name.
logoUrlstring | nullOptionalUpdated logo URL.
primaryColorstringOptionalUpdated brand color.
customLoginConfigobject | nullOptionalUpdated login page configuration.
updatedAtstringOptionalISO 8601 timestamp of the update.

Response Example

{
  "id": "singleton",
  "name": "Acme Corp",
  "logoUrl": "https://cdn.acme.com/logo.png",
  "primaryColor": "#0057FF",
  "allowedDomains": [
    "acme.com"
  ],
  "mfaRequired": true,
  "mfaGracePeriodDays": 7,
  "customLoginConfig": {
    "headline": "Welcome",
    "subtitle": "Sign in"
  },
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-06-15T12:00:00Z"
}

Code Examples

curl -X PUT "https://api.sutraid.com/api/v1/settings" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corp",
    "primaryColor": "#0057FF",
    "customLoginConfig": {
      "headline": "Welcome to Acme",
      "subtitle": "Sign in to continue"
    }
  }'
GET/api/v1/configGet application configurationBearer Token

Returns the full application configuration including all branding, security, and domain settings. Requires org:read permission.

Response Fields

NameTypeRequiredDescription
idstringOptionalSingleton identifier.
namestringOptionalInstance name.
logoUrlstring | nullOptionalLogo URL.
primaryColorstringOptionalPrimary brand color.
allowedDomainsstring[]OptionalPermitted email domains for sign-up.
mfaRequiredbooleanOptionalWhether MFA is mandatory.
mfaGracePeriodDaysnumberOptionalGrace period for MFA enrollment.
customLoginConfigobject | nullOptionalCustom login page configuration.
createdAtstringOptionalISO 8601 creation timestamp.
updatedAtstringOptionalISO 8601 last-update timestamp.

Response Example

{
  "id": "singleton",
  "name": "SutraID",
  "logoUrl": null,
  "primaryColor": "#000000",
  "allowedDomains": [],
  "mfaRequired": false,
  "mfaGracePeriodDays": 7,
  "customLoginConfig": null,
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-01T00:00:00Z"
}

Code Examples

curl -X GET "https://api.sutraid.com/api/v1/config" \
  -H "Authorization: Bearer <your_token>"
PUT/api/v1/configUpdate application configurationBearer Token

Updates the application configuration. Supports partial updates — only the provided fields are changed. Read-only fields (id, createdAt, updatedAt) are automatically stripped.

Request Body

NameTypeRequiredDescription
namestringOptionalInstance display name.e.g. My SutraID Instance
logoUrlstringOptionalPublic URL of the instance logo.e.g. https://cdn.example.com/logo.png
primaryColorstringOptionalBrand hex color.e.g. #1A73E8
allowedDomainsstring[]OptionalList of email domains permitted for user sign-up.e.g. ["example.com","corp.example.com"]
mfaRequiredbooleanOptionalEnable or disable mandatory MFA for all users.e.g. true
mfaGracePeriodDaysnumberOptionalNumber of days users have to enroll MFA after it becomes required.e.g. 14

Response Fields

NameTypeRequiredDescription
idstringOptionalSingleton identifier.
namestringOptionalUpdated instance name.
primaryColorstringOptionalUpdated brand color.
allowedDomainsstring[]OptionalUpdated allowed domains.
mfaRequiredbooleanOptionalUpdated MFA requirement.
mfaGracePeriodDaysnumberOptionalUpdated grace period.
updatedAtstringOptionalISO 8601 timestamp of the update.

Response Example

{
  "id": "singleton",
  "name": "My SutraID Instance",
  "logoUrl": "https://cdn.example.com/logo.png",
  "primaryColor": "#1A73E8",
  "allowedDomains": [
    "example.com",
    "corp.example.com"
  ],
  "mfaRequired": true,
  "mfaGracePeriodDays": 14,
  "customLoginConfig": null,
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-06-20T08:00:00Z"
}

Code Examples

curl -X PUT "https://api.sutraid.com/api/v1/config" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My SutraID Instance",
    "allowedDomains": ["example.com"],
    "mfaRequired": true,
    "mfaGracePeriodDays": 14
  }'
POST/api/v1/onboardInitial instance onboarding

Bootstraps a new SutraID instance by creating the first super-admin user and initializing default configuration. A magic link is sent to the provided email. This endpoint can only be called once — subsequent calls will fail with a 409 Conflict.

Request Body

NameTypeRequiredDescription
adminEmailstringRequiredEmail address for the initial super-admin account.e.g. admin@acme.com

Response Fields

NameTypeRequiredDescription
messagestringOptionalConfirmation message.
user.idstringOptionalUnique identifier of the created admin user.
user.emailstringOptionalEmail address of the admin.
user.rolestringOptionalAssigned role (always SUPER_ADMIN).

Response Example

{
  "message": "Onboarding complete. Magic link sent to admin email.",
  "user": {
    "id": "usr_01hx9z1q2w3e4r5t6y7u",
    "email": "admin@acme.com",
    "role": "SUPER_ADMIN"
  }
}

Code Examples

curl -X POST "https://api.sutraid.com/api/v1/onboard" \
  -H "Content-Type: application/json" \
  -d '{
    "adminEmail": "admin@acme.com"
  }'
GET/api/v1/stats/active-sessionsGet active session countBearer Token

Returns the count of users who have logged in within the last 24 hours. Useful for dashboard metrics and monitoring.

Response Fields

NameTypeRequiredDescription
activeSessionsnumberOptionalNumber of users active in the last 24 hours.
periodHoursnumberOptionalTime window in hours (always 24).

Response Example

{
  "activeSessions": 127,
  "periodHours": 24
}

Code Examples

curl -X GET "https://api.sutraid.com/api/v1/stats/active-sessions" \
  -H "Authorization: Bearer <your_token>"