Package-level declarations

Types

Link copied to clipboard
@Serializable
data class Organization(val id: String, val name: String, val slug: String?, val imageUrl: String, val hasImage: Boolean = false, val membersCount: Int? = null, val pendingInvitationsCount: Int? = null, val maxAllowedMemberships: Int, val adminDeleteEnabled: Boolean, val createdAt: Long, val updatedAt: Long, val publicMetadata: JsonElement)

The Organization object holds information about an organization, as well as methods for managing it.

Link copied to clipboard
@Serializable
data class OrganizationDomain(val id: String, val name: String, val organizationId: String, val enrollmentMode: String, val verification: OrganizationDomain.Verification? = null, val affiliationEmailAddress: String? = null, val totalPendingInvitations: Int, val createdAt: Long, val updatedAt: Long, val publicOrganizationData: PublicOrganizationData? = null, val totalPendingSuggestions: Int)

Represents an organization domain in the Clerk system.

Link copied to clipboard
@Serializable
data class OrganizationInvitation(val id: String, val emailAddress: String, val organizationId: String? = null, val publicMetadata: JsonElement, val role: String, val status: OrganizationInvitation.Status, val createdAt: Long, val updatedAt: Long, val publicOrganizationData: PublicOrganizationData? = null)
Link copied to clipboard
@Serializable
data class OrganizationMembership(val id: String, val publicMetadata: JsonElement, val role: String, val roleName: String, val permissions: List<String>? = null, val publicUserData: PublicUserData? = null, val organization: Organization, val createdAt: Long, val updatedAt: Long)

The OrganizationMembership object is the model around an organization membership entity and describes the relationship between users and organizations.

Link copied to clipboard
@Serializable
data class OrganizationMembershipRequest(val id: String, val organizationId: String, val publicUserData: PublicUserData? = null, val status: String, val createdAt: Long, val updatedAt: Long)

The model that describes the request of a user to join an organization.

Link copied to clipboard
@Serializable
data class OrganizationSuggestion(val id: String, val publicOrganizationData: PublicOrganizationData, val status: String, val createdAt: Long, val updatedAt: Long)

An interface representing an organization suggestion.

Link copied to clipboard
@Serializable
data class Permission(val id: String, val name: String, val type: String, val description: String, val createdAt: Long, val updatedAt: Long)

Represents a permission within an organization.

Link copied to clipboard
@Serializable
data class PublicOrganizationData(val id: String, val hasImage: Boolean, val imageUrl: String?, val name: String, val slug: String?)
Link copied to clipboard
@Serializable
data class Role(val id: String, val key: String, val name: String, val description: String, val permissions: List<Permission>, val createdAt: Long, val updatedAt: Long)

Represents a role within an organization.

Link copied to clipboard
data class UserOrganizationInvitation(val id: String, val emailAddress: String, val publicOrganizationData: UserOrganizationInvitation.PublicOrganizationData, val publicMetadata: String, val role: String, val status: String, val createdAt: Instant, val updatedAt: Instant)

Functions

Link copied to clipboard

Attempts to verify the affiliation of this organization domain using a verification code.

Link copied to clipboard

Bulk create an invitation for a user to join an organization.

Link copied to clipboard

Creates a new domain for this organization.

Link copied to clipboard

Create an invitation for a user to join an organization. *

Link copied to clipboard

Creates a new membership for this organization.

Link copied to clipboard

Deletes this organization.

Deletes this organization domain.

Deletes the organization membership for the current user.

Link copied to clipboard

Deletes a domain from this organization.

Link copied to clipboard

Deletes the organization's current logo image.

Link copied to clipboard

Retrieves a specific domain by its unique identifier.

Link copied to clipboard
suspend fun Organization.getDomains(limit: Int = 20, offset: Int = 0, enrollmentMode: String? = null): ClerkResult<ClerkPaginatedResponse<OrganizationDomain>, ClerkErrorResponse>

Retrieves all domains associated with this organization.

Link copied to clipboard

Retrieve all invitations for an organization. The current user must have permissions to manage the members of the organization.

Link copied to clipboard

Retrieves all membership requests for this organization.

Link copied to clipboard

Retrieves the memberships for this organization.

Link copied to clipboard
suspend fun Organization.getRoles(offset: Int = 0, limit: Int = 20): ClerkResult<List<Role>, ClerkErrorResponse>

Retrieves the list of roles available within this organization.

Link copied to clipboard

Prepares affiliation verification for this organization domain by sending a verification email.

Link copied to clipboard

Rejects this organization membership request.

Link copied to clipboard

Removes a member from the organization.

Link copied to clipboard
suspend fun Organization.update(name: String? = null, slug: String? = null): ClerkResult<Organization, ClerkErrorResponse>

Updates the organization's name and/or slug.

Link copied to clipboard
Link copied to clipboard

Updates the organization's logo image.

Link copied to clipboard

Updates the role of a member within the organization.