How can i get customer number?
# support
k
Hello, how can i get customer number, right now i have logic with getting tool-calls and end-of-call-report types, i am getting all data what i need, but in there responses no customer phone.
c
Hi there, Thank you for your message. Our team is currently out of the office. We operate Monday through Friday, from 9:00 AM to 8:00 PM Pacific Standard Time (PST). We’ll get back to you as soon as possible during our normal business hours. If your message is urgent, please mark it accordingly or include “URGENT” in the subject line, and we’ll do our best to respond promptly. Warm regards, Vapi Customer Support Team
k
export const vapiToolCallsSchema = z.object({ message: z.object({ type: z.literal("tool-calls"), toolCalls: z.array(VapiToolCallSchema), }), call: z.object({ id: z.string(), }), }); export const vapiEndOfCallSchema = z.object({ message: z.object({ type: z.literal("end-of-call-report"), }), call: z.object({ id: z.string(), }), startedAt: z.string(), endedAt: z.string(), }); export const vapiWebhookSchema = z.union([ vapiToolCallsSchema, vapiEndOfCallSchema, ]);
v
To get the customer phone number, use the Sessions API, which includes customer details in its response. For example, make a GET request to the sessions endpoint and look for the
customer.number
field:
Copy code
json
{
  "customer": {
    "number": "+1234567890",
    "name": "John Smith"
  }
}
This approach gives you access to the customer number that's missing from tool-calls and end-of-call-report responses. For more details, see the Sessions API documentation. Source: - [Sessions API Reference](https://docs.vapi.ai/api-reference/sessions/list)
c
Hi, you can get the customer number from the
end-of-call-report
webhook, the structure looks like this:
Copy code
{
  "message": {
    "call": {
      "customer": {
        "number": "+1234567890"
      }
    }
  }
}
Please refer to: https://docs.vapi.ai/server-url/events
k
thanks, i found that already
❤️