Skip to main content

Check Slug Availability

Check if a workspace slug is available for reservation.
const res = await client.reservation.checkSlug.$post({ 
  slug: "acme" 
})
const { available, reason } = await res.json()
Type: Public Procedure
slug
string
required
Workspace slug to check
available
boolean
Whether the slug is available
reason
string
Availability status: “available”, “taken”, or “reserved”
Slug Statuses:
  • available: Slug can be reserved or used
  • taken: Slug is already used by an existing workspace
  • reserved: Slug is reserved by another user (not expired)

Reserve Slug

Reserve a workspace slug before creating an account.
const res = await client.reservation.reserve.$post({
  slug: "acme",
  email: "founder@acme.com"
})
const { ok, token } = await res.json()
Type: Public Procedure
slug
string
required
Desired workspace slug (lowercase, alphanumeric, hyphens)
email
string
required
Email address for the reservation
ok
boolean
Whether reservation was successful
token
string
Unique reservation token
Reservation Details:
  • Reservations expire after 30 days
  • Confirmation email sent with verification link
  • Link format: {APP_URL}/reserve/{token}
  • Maximum 3 active reservations per email
Blocked Slugs: The following slugs are reserved and cannot be used:
  • admin, api, featul, feedback, www, app
  • support, help, mail, blog, status, docs
  • pricing, signup, signin, start, invite
  • reserve, verify, staging
Rate Limiting:
  • 1-minute cooldown between reservation attempts per email
  • Prevents spam and abuse
Attempting to reserve a blocked, taken, or already-reserved slug will return an error.

Lookup Reservation

Retrieve reservation details by token.
const res = await client.reservation.lookupByToken.$get({ 
  token: "reservation-token-123" 
})
const { reservation } = await res.json()
Type: Public Procedure
token
string
required
Reservation token from email
reservation
object | null
Returns null if:
  • Token is invalid
  • Reservation is expired
  • Reservation status is not “reserved” (cancelled or claimed)

Confirm Reservation

Confirm a reservation via email token.
const res = await client.reservation.confirm.$post({ 
  token: "reservation-token-123" 
})
const { ok } = await res.json()
Type: Public Procedure
token
string
required
Reservation token to confirm
ok
boolean
Whether confirmation was successful
Validation:
  • Token must be valid and not expired
  • Reservation must have “reserved” status
  • Updates the reservation’s updatedAt timestamp
Error Codes:
  • 404: Invalid reservation token
  • 410: Reservation expired
  • 409: Reservation not active (already claimed or cancelled)

Claim on Signup

Check if current user has an active reservation to claim.
const res = await client.reservation.claimOnSignup.$get()
const { slugLocked } = await res.json()
Type: Private Procedure
slugLocked
string | null
Reserved slug if one exists for user’s email, otherwise null
Use Case: This endpoint is called during workspace creation to:
  1. Check if user’s email has an active reservation
  2. Pre-fill the slug field if reservation exists
  3. Lock the slug field to prevent changes
  4. Mark reservation as “claimed” after workspace creation
Behavior:
  • Matches user’s email against active reservations
  • Only returns reservations with “reserved” status
  • Only returns non-expired reservations
  • Case-insensitive email matching

Reservation Flow

1

Check availability

Use checkSlug to verify the desired slug is available.
2

Reserve slug

Call reserve with email and slug. User receives confirmation email.
3

Confirm reservation

User clicks link in email, which calls confirm with the token.
4

Sign up

User creates account with same email address.
5

Claim reservation

During workspace creation, claimOnSignup returns the reserved slug.
6

Create workspace

Workspace is created with reserved slug, reservation is marked as claimed.
Reservation Lifecycle: Implementation Notes:
  • Reservations are stored in workspaceSlugReservation table
  • Status field tracks: “reserved”, “claimed”, “cancelled”, “expired”
  • Token is UUID for security
  • Email verification prevents unauthorized reservations
  • System automatically filters out expired reservations in queries
Reservations help users secure their preferred workspace slug before completing signup, reducing frustration from slug conflicts.

Build docs developers (and LLMs) love