Custom field
# support
d
Hi, is there a way to add a custom field or metadata to a call, that I can then retrieve from the callback to my server url? Ideally it could be added to the customer, but anywhere else is ok. Thanks
v
You can continue this conversation by mentioning me in the message.
@deathless Yes, you can add custom metadata to a call that will be sent to your server URL as part of the callback. The metadata is an object that you can include when you create a phone call. This metadata will then be associated with the call and can be retrieved in the callback to your server. Here's an example of how you might include metadata when creating a call:
Copy code
python
import vapi

call = vapi.create_phone_call(
    to_number='+1234567890',
    from_number='+0987654321',
    metadata={
        'custom_field': 'custom_value',
        'customer_id': '12345'
    }
)
In this example,
custom_field
and
customer_id
are custom metadata fields that you've added to the call. When VAPI sends a request to your server, it will include this metadata, and you can access it from the request to handle it according to your needs. Remember to replace
'+1234567890'
and
'+0987654321'
with the actual phone numbers you wish to use, and the
metadata
with the actual data you want to associate with the call. If you need further assistance or have any more questions, feel free to ask!
d
Thanks for the prompt response!
s
you can add meatadta to the assistant using transient assistant or assitant overrides.
12 Views