AI Monorepo API
tRPC API Documentation
Analytics
Returns aggregated analytics for the admin dashboard
{
talentByMonth: Array<{
date: string
value: number
}>
schedulesByDay: Array<{
date: string
value: number
}>
imagesByMonth: Array<{
date: string
value: number
}>
schedulesByLocation: Array<{
name: string
value: number
}>
upcomingSchedules: Array<{
date: string
schedules: number
talent: number
locations: number
}>
badgeDistribution: Array<{
name: string
value: number
}>
topTags: Array<{
name: string
value: number
}>
imagesByStatus: Array<{
name: string
value: number
}>
menuPricing: Array<{
name: string
value: number
}>
}
Auth
Register a new user account with email and password
{
email: string
password: string
name: string
}
{
token: string | null
user: {
id: string
email: string
name: string | null
image: string | null
emailVerified: boolean
}
}
Authenticate with email and password
{
email: string
password: string
}
{
token: string | null
user: {
id: string
email: string
name: string | null
image: string | null
emailVerified: boolean
}
}
File
Returns root images with failed processing status
any[]
Retries processing for a failed image by re-generating missing variants
{
imageId: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
fileId: string
talentId: string
variant: "Original" | "Watermarked" | "Thumbnail"
status: "Processing" | "Completed" | "Failed"
errorMessage: string | null
width: number | null
height: number | null
sortOrder: number
sourceImageId: string | null
file: {
id: string
createdAt: string | any
updatedAt: string | any
name: string
mimeType: string
size: number
blobKey: string
container: string
url: string | null
uploadedById: string | null
}
variants: any[]
}
Greeting
Returns a hello message
{
message: string
}
Image
Returns all images for a talent
{
talentId: string
}
any[]
Returns the thumbnail image URL for a talent
{
talentId: string
}
{
url: string | null
variant: "Original" | "Watermarked" | "Thumbnail" | null
}
Creates a new image
{
fileId: string
variant?: "Original" | "Watermarked" | "Thumbnail"
width?: number | null
height?: number | null
sortOrder?: number
talentId: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
fileId: string
talentId: string
variant: "Original" | "Watermarked" | "Thumbnail"
status: "Processing" | "Completed" | "Failed"
errorMessage: string | null
width: number | null
height: number | null
sortOrder: number
sourceImageId: string | null
file: {
id: string
createdAt: string | any
updatedAt: string | any
name: string
mimeType: string
size: number
blobKey: string
container: string
url: string | null
uploadedById: string | null
}
variants: any[]
}
Updates an existing image
{
id: string
width?: number | null
height?: number | null
sortOrder?: number
}
{
id: string
createdAt: string | any
updatedAt: string | any
fileId: string
talentId: string
variant: "Original" | "Watermarked" | "Thumbnail"
status: "Processing" | "Completed" | "Failed"
errorMessage: string | null
width: number | null
height: number | null
sortOrder: number
sourceImageId: string | null
file: {
id: string
createdAt: string | any
updatedAt: string | any
name: string
mimeType: string
size: number
blobKey: string
container: string
url: string | null
uploadedById: string | null
}
variants: any[]
}
Deletes an image and its variants from DB and blob storage
{
id: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
fileId: string
talentId: string
variant: "Original" | "Watermarked" | "Thumbnail"
status: "Processing" | "Completed" | "Failed"
errorMessage: string | null
width: number | null
height: number | null
sortOrder: number
sourceImageId: string | null
file: {
id: string
createdAt: string | any
updatedAt: string | any
name: string
mimeType: string
size: number
blobKey: string
container: string
url: string | null
uploadedById: string | null
}
variants: any[]
}
Location
Returns all locations
Array<{
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}>
Returns a location by ID
{
id: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
Returns locations by city name
{
city: string
}
Array<{
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}>
Creates a new location
{
city: string
name: string
phoneNumberId?: string | null
}
{
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
Updates an existing location
{
id: string
city?: string
name?: string
phoneNumberId?: string | null
}
{
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
Deletes a location
{
id: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
PhoneNumber
Returns all phone numbers
Array<{
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
}>
Returns a phone number by ID
{
id: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
}
Creates a new phone number
{
name?: string | null
number: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
}
Updates an existing phone number
{
id: string
name?: string | null
number?: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
}
Deletes a phone number
{
id: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
}
Schedule
Returns all schedules for today with talent data
Array<{
id: string
createdAt: string | any
updatedAt: string | any
locationId: string
date: string | any
startTime: string | null
endTime: string | null
notes: string | null
location: {
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
talentId: string
talent: {
id: string
nickname: string
}
}>
Returns pre-grouped visiting-soon entries (next 60 days)
Array<{
talentId: string
nickname: string
city: string
dateLabel: string
thumbnailUrl: string | null
}>
Returns all schedules for a talent
{
talentId: string
}
Array<{
id: string
createdAt: string | any
updatedAt: string | any
locationId: string
date: string | any
startTime: string | null
endTime: string | null
notes: string | null
location: {
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
}>
Returns all schedules for a location
{
locationId: string
}
Array<{
id: string
createdAt: string | any
updatedAt: string | any
locationId: string
date: string | any
startTime: string | null
endTime: string | null
notes: string | null
location: {
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
}>
Returns all schedules in a date range with talent and location data
{
startDate: string | any
endDate: string | any
}
Array<{
id: string
createdAt: string | any
updatedAt: string | any
locationId: string
date: string | any
startTime: string | null
endTime: string | null
notes: string | null
location: {
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
talentId: string
talent: {
id: string
nickname: string
}
}>
Creates a new schedule
{
locationId: string
date: string | any
startTime?: string | null
endTime?: string | null
notes?: string | null
talentId: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
locationId: string
date: string | any
startTime: string | null
endTime: string | null
notes: string | null
location: {
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
}
Updates an existing schedule
{
id: string
locationId?: string
date?: string | any
startTime?: string | null
endTime?: string | null
notes?: string | null
}
{
id: string
createdAt: string | any
updatedAt: string | any
locationId: string
date: string | any
startTime: string | null
endTime: string | null
notes: string | null
location: {
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
}
Deletes a schedule
{
id: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
locationId: string
date: string | any
startTime: string | null
endTime: string | null
notes: string | null
location: {
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
}
Service
Returns all services
Array<{
id: string
name: string
createdAt: string | any
}>
Returns a service by ID
{
id: string
}
{
id: string
name: string
createdAt: string | any
}
Creates a new service
{
name: string
}
{
id: string
name: string
createdAt: string | any
}
Updates a service
{
name?: string
id: string
}
{
id: string
name: string
createdAt: string | any
}
Deletes a service
{
id: string
}
{
id: string
name: string
createdAt: string | any
}
Tag
Returns all tags
Array<{
id: string
createdAt: string | any
updatedAt: string | any
name: string
}>
Returns a tag by ID
{
id: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
name: string
}
Creates a new tag
{
name: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
name: string
}
Updates a tag
{
name?: string
id: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
name: string
}
Deletes a tag
{
id: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
name: string
}
Talent
Returns all talents with relations (excluding schedules)
Array<{
id: string
createdAt: string | any
updatedAt: string | any
nickname: string
age: number | null
height: string | null
weight: string | null
measurements: string | null
nationality: string | null
hair: string | null
eyes: string | null
tattoos: boolean | null
enhanced: boolean | null
tagline: string | null
bio: string | null
badge: "Visiting" | "Star" | "Vip" | "New" | null
tags: Array<{
tag: {
id: string
createdAt: string | any
updatedAt: string | any
name: string
}
}>
images: any[]
}>
Returns talents with images, sorted with today's available first
Array<{
id: string
createdAt: string | any
updatedAt: string | any
nickname: string
age: number | null
height: string | null
weight: string | null
measurements: string | null
nationality: string | null
hair: string | null
eyes: string | null
tattoos: boolean | null
enhanced: boolean | null
tagline: string | null
bio: string | null
badge: "Visiting" | "Star" | "Vip" | "New" | null
tags: Array<{
tag: {
id: string
createdAt: string | any
updatedAt: string | any
name: string
}
}>
images: any[]
}>
Returns lightweight talent list (id, nickname, badge only)
Array<{
id: string
createdAt: string | any
updatedAt: string | any
nickname: string
badge: "Visiting" | "Star" | "Vip" | "New" | null
}>
Returns a talent by ID with relations
{
id: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
nickname: string
age: number | null
height: string | null
weight: string | null
measurements: string | null
nationality: string | null
hair: string | null
eyes: string | null
tattoos: boolean | null
enhanced: boolean | null
tagline: string | null
bio: string | null
badge: "Visiting" | "Star" | "Vip" | "New" | null
tags: Array<{
tag: {
id: string
createdAt: string | any
updatedAt: string | any
name: string
}
}>
menus: Array<{
id: string
createdAt: string | any
updatedAt: string | any
type: "Regular" | "Vip"
durationMinutes: number
price: number
}>
menuServices: Array<{
id: string
serviceId: string
excludedFromPromo: boolean
price: number | null
service: {
id: string
name: string
createdAt: string | any
}
}>
schedules: Array<{
id: string
createdAt: string | any
updatedAt: string | any
locationId: string
date: string | any
startTime: string | null
endTime: string | null
notes: string | null
location: {
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
}>
images: any[]
}
Returns a talent by nickname with relations
{
nickname: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
nickname: string
age: number | null
height: string | null
weight: string | null
measurements: string | null
nationality: string | null
hair: string | null
eyes: string | null
tattoos: boolean | null
enhanced: boolean | null
tagline: string | null
bio: string | null
badge: "Visiting" | "Star" | "Vip" | "New" | null
tags: Array<{
tag: {
id: string
createdAt: string | any
updatedAt: string | any
name: string
}
}>
menus: Array<{
id: string
createdAt: string | any
updatedAt: string | any
type: "Regular" | "Vip"
durationMinutes: number
price: number
}>
menuServices: Array<{
id: string
serviceId: string
excludedFromPromo: boolean
price: number | null
service: {
id: string
name: string
createdAt: string | any
}
}>
schedules: Array<{
id: string
createdAt: string | any
updatedAt: string | any
locationId: string
date: string | any
startTime: string | null
endTime: string | null
notes: string | null
location: {
id: string
createdAt: string | any
updatedAt: string | any
city: string
name: string
phoneNumberId: string | null
phoneNumber?: {
id: string
createdAt: string | any
updatedAt: string | any
name: string | null
number: string
} | null
}
}>
images: any[]
}
Creates a new talent
{
nickname: string
age?: number | null
height?: string | null
weight?: string | null
measurements?: string | null
nationality?: string | null
hair?: string | null
eyes?: string | null
tattoos?: boolean | null
enhanced?: boolean | null
tagline?: string | null
bio?: string | null
badge?: "Visiting" | "Star" | "Vip" | "New" | null
tags?: string[]
menus?: Array<{
type: "Regular" | "Vip"
durationMinutes: number
price: number
}>
menuServices?: Array<{
serviceId: string
price?: number | null
}>
images?: Array<{
fileId: string
variant?: "Original" | "Watermarked" | "Thumbnail"
width?: number | null
height?: number | null
sortOrder?: number
}>
}
{
id: string
createdAt: string | any
updatedAt: string | any
nickname: string
age: number | null
height: string | null
weight: string | null
measurements: string | null
nationality: string | null
hair: string | null
eyes: string | null
tattoos: boolean | null
enhanced: boolean | null
tagline: string | null
bio: string | null
badge: "Visiting" | "Star" | "Vip" | "New" | null
}
Updates an existing talent
{
id: string
nickname?: string
age?: number | null
height?: string | null
weight?: string | null
measurements?: string | null
nationality?: string | null
hair?: string | null
eyes?: string | null
tattoos?: boolean | null
enhanced?: boolean | null
tagline?: string | null
bio?: string | null
badge?: "Visiting" | "Star" | "Vip" | "New" | null
tags?: string[]
}
{
id: string
createdAt: string | any
updatedAt: string | any
nickname: string
age: number | null
height: string | null
weight: string | null
measurements: string | null
nationality: string | null
hair: string | null
eyes: string | null
tattoos: boolean | null
enhanced: boolean | null
tagline: string | null
bio: string | null
badge: "Visiting" | "Star" | "Vip" | "New" | null
}
Deletes a talent
{
id: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
nickname: string
age: number | null
height: string | null
weight: string | null
measurements: string | null
nationality: string | null
hair: string | null
eyes: string | null
tattoos: boolean | null
enhanced: boolean | null
tagline: string | null
bio: string | null
badge: "Visiting" | "Star" | "Vip" | "New" | null
}
User
Returns the authenticated user profile
{
id: string
createdAt: string | any
updatedAt: string | any
email: string
name: string | null
}
Creates a new user via the auth admin API
{
email: string
name: string
password: string
role: "user" | "admin"
}
{
id: string
createdAt: string | any
updatedAt: string | any
email: string
name: string | null
}
Returns a user by their ID
{
id: string
}
{
id: string
createdAt: string | any
updatedAt: string | any
email: string
name: string | null
}
Updates an existing user
{
id: string
data: {
email?: string
name?: string
}
}
{
id: string
createdAt: string | any
updatedAt: string | any
email: string
name: string | null
}
Sets a new password for a user via the auth admin API
{
userId: string
newPassword: string
}
Returns all users
Array<{
id: string
createdAt: string | any
updatedAt: string | any
email: string
name: string | null
}>