VitalPBX AI Agent – Use Caller ID to Query Database via API

We’re working with the real-time AI agent in VitalPBX and want to use the caller’s phone number to pull data from a database.

Goal: when a call comes in, grab the Caller ID, send it to an API, and use the response (e.g., customer info) inside the AI agent flow.

Questions:

  • How can we access the Caller ID within the AI agent flow?
  • Is there a way to pass it into an API request directly?
  • Any examples using webhooks or internal API calls?
1 Like

In the meantime, you might request the caller phone number by asking it as part of the conversation flow.

1 Like

Does that mean the other person has to give you their phone number?
Is there no other way to get it right now? Is there some kind of variable?

Actually, makes sense, because your customer might not always call from the registered number on your CRM. Well, at least there’s a small chance.

1 Like

This is exactly the kind of situation—when a customer calls from a different number—where you’d want to record the number they’re calling from. After all, the caller might not remember which number they’re calling from, might misdial a digit, or the AI agent might not hear it correctly due to background noise (which is exactly what happened to me during testing).

Our dev team will analyze it!

1 Like