-
Notifications
You must be signed in to change notification settings - Fork 10.2k
feat: Cal.ai Self Serve #2 (WIP) #22995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
.passthrough(), | ||
}); | ||
|
||
async function handleCallAnalyzed(callData: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This route is responsible for deducting credits after we get call_analyzed event from retell ai
export const getAIAgentCallPhoneNumberField = () => | ||
({ | ||
name: CAL_AI_AGENT_PHONE_NUMBER_FIELD, | ||
type: "phone", | ||
defaultLabel: "phone_number_for_ai_call", | ||
defaultPlaceholder: "enter_phone_number", | ||
editable: "system", | ||
} as const); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new phone number field is included once workflow is active on a event type
}; | ||
|
||
it("should successfully import phone number without agent", async () => { | ||
it("should successfully import phone number with agent", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not much change in the logic. we just need to make sure when importing phone number we have already created an agent
@@ -23,6 +26,26 @@ export class AgentService { | |||
private agentRepository: AgentRepositoryInterface | |||
) {} | |||
|
|||
private async generateUniqueAPIKey({ userId, teamId }: { userId: number; teamId?: number }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need api key for https://docs.retellai.com/build/book-calendar functions like book_appointment
What does this PR do?
TODO
check_availability
andbook_appointment
is workingThis PR is the second PR for adding cal ai self serve feature
After first part #22919
#21827
How to test?
Pre requisite
Make sure you have
RETELL_API_KEY
andSTRIPE_PHONE_NUMBER_MONTHLY_PRICE_ID
for phone number billing.now run in terminal stripe listen --forward-to localhost:3000/api/stripe/webhook --events checkout.session.completed and make sure you are using same secret in
STRIPE_WEBHOOK_SECRET_BILLING
.Click on setup to create an agent that would open up a sidebar

Go to phone number section and click on buy phone number
Screen.Recording.2025-08-05.at.12.59.01.AM.mov
When you book a meeting a task is scheduled in tasker which can be executed when to make a request to http://localhost:3000/api/tasks/cron.
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?