createMembership

@FormUrlEncoded
@POST(value = "organizations/{organization_id}/memberships")
abstract suspend fun createMembership(@Path(value = "organization_id") organizationId: String, @Field(value = "role") role: String?, @Field(value = "user_id") userId: String?): ClerkResult<OrganizationMembership, ClerkErrorResponse>

Creates a new membership for a user in an organization.

Return

A ClerkResult containing either the created OrganizationMembership on success or a ClerkErrorResponse on failure

Parameters

organizationId

The unique identifier of the organization

role

The role to assign to the user in the organization (optional)

userId

The unique identifier of the user to add as a member

See also