Skip to main content

Authentication

All identity endpoints require authentication via the requireAuth middleware. Include a valid session token in your request.

Get All Identities

Retrieve all identities associated with the authenticated user.

Response

identities
array
Array of identity objects
id
string
Unique identifier for the identity
displayName
string
The display name of the identity (1-64 characters)
handle
string
Unique handle for the identity (3-32 characters, alphanumeric and underscore only)
email
string | null
Optional email address associated with the identity
birthday
string | null
Optional birthday in string format
avatarUrl
string | null
Optional URL for the identity’s avatar image
bannerUrl
string | null
Optional URL or hex color (e.g., #FF6B6B) for the identity’s banner
isPrimary
boolean
Whether this is the user’s primary identity
createdAt
string
Timestamp of when the identity was created

Get Single Identity

Retrieve a specific identity by ID. The identity must belong to the authenticated user.

Path Parameters

identityId
string
required
The unique identifier of the identity to retrieve

Response

identity
object
Identity object with the following fields:
id
string
Unique identifier for the identity
displayName
string
The display name of the identity
handle
string
Unique handle for the identity
email
string | null
Email address associated with the identity
birthday
string | null
Birthday in string format
avatarUrl
string | null
URL for the identity’s avatar image
bannerUrl
string | null
URL or hex color for the identity’s banner
isPrimary
boolean
Whether this is the user’s primary identity
createdAt
string
Timestamp of when the identity was created

Error Responses

  • 404 - Identity not found or does not belong to the authenticated user

Create Identity

Create a new identity for the authenticated user. Users can have a maximum of 5 identities.

Request Body

displayName
string
required
Display name for the identity (1-64 characters)
handle
string
required
Unique handle for the identity (3-32 characters, alphanumeric and underscore only). Will be converted to lowercase.
email
string
Optional email address (must be valid email format)
birthday
string
Optional birthday in string format
avatarUrl
string
Optional URL for the identity’s avatar image (must be valid URL)
bannerUrl
string
Optional URL or hex color (e.g., #FF6B6B) for the identity’s banner

Response

identity
object
The created identity object
id
string
Unique identifier for the created identity
displayName
string
The display name of the identity
handle
string
Unique handle (lowercase)
email
string | null
Email address
birthday
string | null
Birthday
avatarUrl
string | null
Avatar URL
bannerUrl
string | null
Banner URL or hex color
isPrimary
boolean
Whether this is the primary identity (true if it’s the user’s first identity)

Error Responses

  • 400 - Maximum of 5 identities allowed
  • 400 - Handle is already taken
  • 400 - Validation error (invalid format)

Activity Log

Creating an identity logs an identity_created action with severity info.

Update Identity

Update an existing identity. All fields are optional.

Path Parameters

identityId
string
required
The unique identifier of the identity to update

Request Body

displayName
string
Display name for the identity (1-64 characters)
handle
string
Unique handle for the identity (3-32 characters, alphanumeric and underscore only)
email
string | null
Email address (set to null to remove)
birthday
string | null
Birthday (set to null to remove)
avatarUrl
string | null
Avatar URL (set to null to remove)
bannerUrl
string | null
Banner URL or hex color (set to null to remove)

Response

identity
object
The updated identity object with all current fields

Error Responses

  • 404 - Identity not found or does not belong to the authenticated user
  • 400 - Handle is already taken (when changing handle to one that exists)
  • 400 - Validation error

Activity Log

Updating an identity logs an identity_updated action with severity info.

Set Primary Identity

Set a specific identity as the user’s primary identity. This removes the primary status from all other identities.

Path Parameters

identityId
string
required
The unique identifier of the identity to set as primary

Response

success
boolean
Returns true if the operation was successful

Error Responses

  • 404 - Identity not found or does not belong to the authenticated user

Delete Identity

Delete an identity. Cannot delete the primary identity or the user’s only identity.

Path Parameters

identityId
string
required
The unique identifier of the identity to delete

Response

success
boolean
Returns true if the deletion was successful

Error Responses

  • 404 - Identity not found or does not belong to the authenticated user
  • 400 - Cannot delete primary identity (set another identity as primary first)
  • 400 - Cannot delete your only identity

Activity Log

Deleting an identity logs an identity_deleted action with severity warning.

Build docs developers (and LLMs) love