https://retellai.com/?utm_source=discord&utm_medium=seo logo
I am sending call requests via API
# ❓・ai-evy-support
a
@AI Evy I am sending call requests via API. My API request include email. I would like to track the email in the call history table, so that I can see all calls made to specific emails and contacts. This means the email needs to pass through somehow after the call analysis into it's own field then show in the call history. How can I set this up?
a
Thanks for tagging me @arc108. I'll look through relevant sources and get back to you shortly.
### Answer --- You can use the
metadata
parameter when creating your call via the API. This allows you to store custom data like email addresses directly with the call record. [(1) ]() When creating an outbound call, include the email in the metadata:
Copy code
javascript
const phoneCallResponse = await client.call.createPhoneCall({
  from_number: '+14157774444',
  to_number: '+12137774445',
  metadata: {
    "email": "customer@example.com"
  }
}) ;
The
metadata
field stores custom data like internal customer IDs (or in your case, emails) . This metadata is then returned when you retrieve call data via the Get Call API or List Calls API. [(2) ]() [(3) ]() You can see in the call response structure that
metadata
is included:
Copy code
json
{
  "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
  "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
  "metadata": {},
  ...
}
[(3) ]() This approach lets you filter and track calls by email on your backend by querying the metadata field from call records.
​ To learn more, see the sources I considered: [[1] How can I create an outbound call](https://retell.discourse.group/t/how-can-i-create-an-outbound-call/132) [[2] Get Call](https://docs.retellai.com/api-references/get-call) [[3] List Calls](https://docs.retellai.com/api-references/list-calls) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
can i ask you another question