SutraID|Developer Docs
QuickstartAPI ReferenceDashboard

Organizations

Multi-tenant organization management, member invitations, and settings.

POST/api/v1/organizationsCreate OrganizationBearer Token

Create a new organization. The authenticated user becomes the first super-admin of the org.

Request Body

NameTypeRequiredDescription
namestringRequiredDisplay name of the organization.e.g. Acme Corp
slugstringOptionalURL-safe identifier. Auto-generated from name if omitted.e.g. acme-corp
domainstringOptionalPrimary domain associated with the organization.e.g. acme.com
logoUrlstringOptionalPublic URL of the organization logo.e.g. https://cdn.acme.com/logo.png
primaryColorstringOptionalBrand hex color used in hosted UI.e.g. #0057FF
allowedDomainsstring[]OptionalList of email domains whose users may self-join.e.g. ["acme.com","acme.io"]

Response Fields

NameTypeRequiredDescription
idstring (UUID)OptionalOrganization unique identifier.e.g. org_01HZ3K8VPNQ4RJXEMYVWCT9BS1
namestringOptionalDisplay name.e.g. Acme Corp
slugstringOptionalURL-safe identifier.e.g. acme-corp
domainstring | nullOptionalPrimary domain.e.g. acme.com
planstringOptionalSubscription plan.e.g. FREE
statusstringOptionalOrganization status.e.g. ACTIVE
logoUrlstring | nullOptionalLogo URL.e.g. https://cdn.acme.com/logo.png
primaryColorstring | nullOptionalBrand hex color.e.g. #0057FF
allowedDomainsstring[]OptionalSelf-join allowed domains.e.g. ["acme.com"]
maxMembersnumberOptionalMaximum member seats.e.g. 50
maxApplicationsnumberOptionalMaximum application count.e.g. 10
createdAtstring (ISO 8601)OptionalCreation timestamp.e.g. 2024-01-15T10:30:00.000Z
updatedAtstring (ISO 8601)OptionalLast update timestamp.e.g. 2024-01-15T10:30:00.000Z

Response Example

{
  "id": "org_01HZ3K8VPNQ4RJXEMYVWCT9BS1",
  "name": "Acme Corp",
  "slug": "acme-corp",
  "domain": "acme.com",
  "plan": "FREE",
  "status": "ACTIVE",
  "logoUrl": "https://cdn.acme.com/logo.png",
  "primaryColor": "#0057FF",
  "allowedDomains": [
    "acme.com"
  ],
  "maxMembers": 50,
  "maxApplications": 10,
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}

Code Examples

curl -X POST https://api.sutraid.com/api/v1/organizations \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corp",
    "slug": "acme-corp",
    "domain": "acme.com",
    "logoUrl": "https://cdn.acme.com/logo.png",
    "primaryColor": "#0057FF",
    "allowedDomains": ["acme.com", "acme.io"]
  }'
GET/api/v1/organizationsList OrganizationsBearer Token

Retrieve all organizations the authenticated user belongs to.

Response Fields

NameTypeRequiredDescription
[]Organization[]OptionalArray of organization records the user is a member of.

Response Example

{
  "data": [
    {
      "id": "org_01HZ3K8VPNQ4RJXEMYVWCT9BS1",
      "name": "Acme Corp",
      "slug": "acme-corp",
      "domain": "acme.com",
      "plan": "FREE",
      "status": "ACTIVE",
      "logoUrl": "https://cdn.acme.com/logo.png",
      "primaryColor": "#0057FF",
      "allowedDomains": [
        "acme.com"
      ],
      "maxMembers": 50,
      "maxApplications": 10,
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:00.000Z"
    }
  ]
}

Code Examples

curl -X GET https://api.sutraid.com/api/v1/organizations \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..."
GET/api/v1/organizations/:orgIdGet OrganizationBearer Token

Retrieve details for a specific organization by its ID.

Parameters

NameTypeRequiredDescription
orgIdstring (UUID)RequiredThe unique identifier of the organization.e.g. org_01HZ3K8VPNQ4RJXEMYVWCT9BS1

Response Fields

NameTypeRequiredDescription
idstring (UUID)OptionalOrganization unique identifier.e.g. org_01HZ3K8VPNQ4RJXEMYVWCT9BS1
namestringOptionalDisplay name.e.g. Acme Corp
slugstringOptionalURL-safe identifier.e.g. acme-corp
domainstring | nullOptionalPrimary domain.e.g. acme.com
planstringOptionalSubscription plan.e.g. FREE
statusstringOptionalOrganization status.e.g. ACTIVE
createdAtstring (ISO 8601)OptionalCreation timestamp.e.g. 2024-01-15T10:30:00.000Z
updatedAtstring (ISO 8601)OptionalLast update timestamp.e.g. 2024-01-15T10:30:00.000Z

Response Example

{
  "id": "org_01HZ3K8VPNQ4RJXEMYVWCT9BS1",
  "name": "Acme Corp",
  "slug": "acme-corp",
  "domain": "acme.com",
  "plan": "FREE",
  "status": "ACTIVE",
  "logoUrl": "https://cdn.acme.com/logo.png",
  "primaryColor": "#0057FF",
  "allowedDomains": [
    "acme.com"
  ],
  "maxMembers": 50,
  "maxApplications": 10,
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}

Code Examples

curl -X GET https://api.sutraid.com/api/v1/organizations/org_01HZ3K8VPNQ4RJXEMYVWCT9BS1 \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..."
PUT/api/v1/organizations/:orgIdUpdate OrganizationBearer Token

Update organization details. All body fields are optional; only provided fields are updated.

Parameters

NameTypeRequiredDescription
orgIdstring (UUID)RequiredThe unique identifier of the organization to update.e.g. org_01HZ3K8VPNQ4RJXEMYVWCT9BS1

Request Body

NameTypeRequiredDescription
namestringOptionalNew display name.e.g. Acme Corporation
slugstringOptionalNew URL-safe identifier.e.g. acme-corporation
domainstringOptionalNew primary domain.e.g. acmecorp.com
logoUrlstringOptionalNew logo URL.e.g. https://cdn.acme.com/logo-v2.png
primaryColorstringOptionalNew brand hex color.e.g. #FF5700
allowedDomainsstring[]OptionalUpdated self-join domain list.e.g. ["acmecorp.com"]
planstringOptionalSubscription plan.e.g. PRO
statusstringOptionalOrganization status.e.g. ACTIVE
maxMembersnumberOptionalMaximum member seats.e.g. 100
maxApplicationsnumberOptionalMaximum application count.e.g. 20

Response Fields

NameTypeRequiredDescription
idstring (UUID)OptionalOrganization unique identifier.
namestringOptionalUpdated display name.e.g. Acme Corporation
updatedAtstring (ISO 8601)OptionalTimestamp of the update.

Response Example

{
  "id": "org_01HZ3K8VPNQ4RJXEMYVWCT9BS1",
  "name": "Acme Corporation",
  "slug": "acme-corporation",
  "domain": "acmecorp.com",
  "plan": "PRO",
  "status": "ACTIVE",
  "logoUrl": "https://cdn.acme.com/logo-v2.png",
  "primaryColor": "#FF5700",
  "allowedDomains": [
    "acmecorp.com"
  ],
  "maxMembers": 100,
  "maxApplications": 20,
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-06-01T08:00:00.000Z"
}

Code Examples

curl -X PUT https://api.sutraid.com/api/v1/organizations/org_01HZ3K8VPNQ4RJXEMYVWCT9BS1 \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corporation",
    "slug": "acme-corporation",
    "primaryColor": "#FF5700",
    "maxMembers": 100
  }'
DELETE/api/v1/organizations/:orgIdDelete OrganizationBearer Token

Permanently delete an organization and all associated data. This action is irreversible.

Parameters

NameTypeRequiredDescription
orgIdstring (UUID)RequiredThe unique identifier of the organization to delete.e.g. org_01HZ3K8VPNQ4RJXEMYVWCT9BS1

Response Fields

NameTypeRequiredDescription
messagestringOptionalConfirmation message.e.g. Organization deleted

Response Example

{
  "message": "Organization deleted"
}

Code Examples

curl -X DELETE https://api.sutraid.com/api/v1/organizations/org_01HZ3K8VPNQ4RJXEMYVWCT9BS1 \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..."
POST/api/v1/organizations/:orgId/members/inviteInvite MemberBearer Token

Send an invitation email to a user to join the organization with a specified role.

Parameters

NameTypeRequiredDescription
orgIdstring (UUID)RequiredThe organization to invite the user into.e.g. org_01HZ3K8VPNQ4RJXEMYVWCT9BS1

Request Body

NameTypeRequiredDescription
emailstringRequiredEmail address of the person to invite.e.g. jane.doe@acme.com
roleOrgRoleRequiredRole to assign to the invited member.e.g. ORG_ADMIN
SUPER_ADMINORG_ADMINAPP_ADMINUSER_ADMINGROUP_MEMBERSHIP_ADMINHELP_DESK_ADMINMOBILE_ADMINREAD_ONLY_ADMINREPORT_ADMINAPI_ACCESS_MANAGEMENT_ADMIN

Response Fields

NameTypeRequiredDescription
idstring (UUID)OptionalInvitation record identifier.
emailstringOptionalInvited email address.e.g. jane.doe@acme.com
roleOrgRoleOptionalAssigned role.e.g. ORG_ADMIN
statusstringOptionalInvitation status.e.g. PENDING
expiresAtstring (ISO 8601)OptionalInvitation expiry timestamp.

Response Example

{
  "id": "inv_01HZ4M9XPQR5SKTBZCYF2DN3W7",
  "email": "jane.doe@acme.com",
  "role": "ORG_ADMIN",
  "status": "PENDING",
  "organizationId": "org_01HZ3K8VPNQ4RJXEMYVWCT9BS1",
  "expiresAt": "2024-01-22T10:30:00.000Z",
  "createdAt": "2024-01-15T10:30:00.000Z"
}

Code Examples

curl -X POST https://api.sutraid.com/api/v1/organizations/org_01HZ3K8VPNQ4RJXEMYVWCT9BS1/members/invite \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane.doe@acme.com",
    "role": "ORG_ADMIN"
  }'
PUT/api/v1/organizations/:orgId/members/:memberId/roleUpdate Member RoleBearer Token

Change the role of an existing organization member.

Parameters

NameTypeRequiredDescription
orgIdstring (UUID)RequiredThe organization identifier.e.g. org_01HZ3K8VPNQ4RJXEMYVWCT9BS1
memberIdstring (UUID)RequiredThe member identifier to update.e.g. mem_01HZ5P2WQRS6TLUCADYG3EN4X8

Request Body

NameTypeRequiredDescription
roleOrgRoleRequiredThe new role to assign to the member.e.g. APP_ADMIN
SUPER_ADMINORG_ADMINAPP_ADMINUSER_ADMINGROUP_MEMBERSHIP_ADMINHELP_DESK_ADMINMOBILE_ADMINREAD_ONLY_ADMINREPORT_ADMINAPI_ACCESS_MANAGEMENT_ADMIN

Response Fields

NameTypeRequiredDescription
idstring (UUID)OptionalMember record identifier.
userIdstring (UUID)OptionalUser identifier.
organizationIdstring (UUID)OptionalOrganization identifier.
roleOrgRoleOptionalUpdated role.e.g. APP_ADMIN
updatedAtstring (ISO 8601)OptionalTimestamp of the update.

Response Example

{
  "id": "mem_01HZ5P2WQRS6TLUCADYG3EN4X8",
  "userId": "usr_01HY9K7MNPQ3RJCEBXVWDT8GS2",
  "organizationId": "org_01HZ3K8VPNQ4RJXEMYVWCT9BS1",
  "role": "APP_ADMIN",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-06-01T09:15:00.000Z"
}

Code Examples

curl -X PUT https://api.sutraid.com/api/v1/organizations/org_01HZ3K8VPNQ4RJXEMYVWCT9BS1/members/mem_01HZ5P2WQRS6TLUCADYG3EN4X8/role \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
  -H "Content-Type: application/json" \
  -d '{ "role": "APP_ADMIN" }'
DELETE/api/v1/organizations/:orgId/members/:memberIdRemove MemberBearer Token

Remove a member from the organization. The user account itself is not deleted.

Parameters

NameTypeRequiredDescription
orgIdstring (UUID)RequiredThe organization identifier.e.g. org_01HZ3K8VPNQ4RJXEMYVWCT9BS1
memberIdstring (UUID)RequiredThe member identifier to remove.e.g. mem_01HZ5P2WQRS6TLUCADYG3EN4X8

Response Fields

NameTypeRequiredDescription
messagestringOptionalConfirmation message.e.g. Member removed

Response Example

{
  "message": "Member removed"
}

Code Examples

curl -X DELETE https://api.sutraid.com/api/v1/organizations/org_01HZ3K8VPNQ4RJXEMYVWCT9BS1/members/mem_01HZ5P2WQRS6TLUCADYG3EN4X8 \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..."
GET/api/v1/orgGet Current Org SettingsBearer Token

Retrieve settings for the organization derived from the authenticated JWT context. Requires the org:read permission. The organization is resolved via OrgContextGuard — no orgId path parameter is needed.

Response Fields

NameTypeRequiredDescription
idstring (UUID)OptionalOrganization unique identifier.
namestringOptionalDisplay name.e.g. Acme Corp
slugstringOptionalURL-safe identifier.e.g. acme-corp
domainstring | nullOptionalPrimary domain.
planstringOptionalSubscription plan.e.g. PRO
statusstringOptionalOrganization status.e.g. ACTIVE
settingsRecord<string, string>OptionalArbitrary key-value organization settings.
createdAtstring (ISO 8601)OptionalCreation timestamp.
updatedAtstring (ISO 8601)OptionalLast update timestamp.

Response Example

{
  "id": "org_01HZ3K8VPNQ4RJXEMYVWCT9BS1",
  "name": "Acme Corp",
  "slug": "acme-corp",
  "domain": "acme.com",
  "plan": "PRO",
  "status": "ACTIVE",
  "logoUrl": "https://cdn.acme.com/logo.png",
  "primaryColor": "#0057FF",
  "allowedDomains": [
    "acme.com"
  ],
  "maxMembers": 100,
  "maxApplications": 20,
  "settings": {
    "mfaRequired": "true",
    "sessionTimeoutSeconds": "3600",
    "passwordPolicy": "strong"
  },
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-06-01T08:00:00.000Z"
}

Code Examples

curl -X GET https://api.sutraid.com/api/v1/org \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..."
PUT/api/v1/orgUpdate Current Org SettingsBearer Token

Update settings for the organization derived from the authenticated JWT context. Requires the org:update permission. Partial updates are supported — only provided fields are modified.

Request Body

NameTypeRequiredDescription
namestringOptionalNew display name for the organization.e.g. Acme Corp (Updated)
settingsRecord<string, string>OptionalArbitrary key-value settings to store for the organization. Merged with existing settings.e.g. { "mfaRequired": "true", "sessionTimeoutSeconds": "1800" }

Response Fields

NameTypeRequiredDescription
idstring (UUID)OptionalOrganization unique identifier.
namestringOptionalUpdated display name.e.g. Acme Corp (Updated)
settingsRecord<string, string>OptionalUpdated key-value settings map.
updatedAtstring (ISO 8601)OptionalTimestamp of the update.

Response Example

{
  "id": "org_01HZ3K8VPNQ4RJXEMYVWCT9BS1",
  "name": "Acme Corp (Updated)",
  "slug": "acme-corp",
  "domain": "acme.com",
  "plan": "PRO",
  "status": "ACTIVE",
  "logoUrl": "https://cdn.acme.com/logo.png",
  "primaryColor": "#0057FF",
  "allowedDomains": [
    "acme.com"
  ],
  "maxMembers": 100,
  "maxApplications": 20,
  "settings": {
    "mfaRequired": "true",
    "sessionTimeoutSeconds": "1800",
    "passwordPolicy": "strong"
  },
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-06-10T12:45:00.000Z"
}

Code Examples

curl -X PUT https://api.sutraid.com/api/v1/org \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corp (Updated)",
    "settings": {
      "mfaRequired": "true",
      "sessionTimeoutSeconds": "1800"
    }
  }'