Attaching user identity to inbound Telnyx → Vapi calls
We’re trying to finish the migration of our inbound phone flow (Telnyx DID → Vapi assistant) so that each PSTN call is associated with the correct user inside our multi-tenant app
What works so far
Telnyx is hitting our Vapi assistant; the call connects and all speech-update / status-update webhooks reach our server endpoint (/api/vapi/server).
What still doesn’t work
Inbound Telnyx calls never arrive with call.metadata.userId. We’re patching the call with user metadata on the first webhook (lookup phone number → PATCH /call/{id} with metadata.userId/tenantId), but the tool payloads never pick it up.
Vapi doesn’t appear to fire the legacy assistant-request event anymore, so we don’t have an earlier hook to attach identity before tools start running. The only events we see are speech-update, status-update, etc.
What we’ve tried
For each webhook, if call.customer.number matches a row in our user_phones table, we PATCH the call via Vapi’s API with:
We see the PATCH succeeding (200 OK) on our side.
Despite that, subsequent tool calls still arrive without call.metadata.userId, so our auth layer continues to fall back.
Questions
What works so far
Telnyx is hitting our Vapi assistant; the call connects and all speech-update / status-update webhooks reach our server endpoint (/api/vapi/server).
What still doesn’t work
Inbound Telnyx calls never arrive with call.metadata.userId. We’re patching the call with user metadata on the first webhook (lookup phone number → PATCH /call/{id} with metadata.userId/tenantId), but the tool payloads never pick it up.
Vapi doesn’t appear to fire the legacy assistant-request event anymore, so we don’t have an earlier hook to attach identity before tools start running. The only events we see are speech-update, status-update, etc.
What we’ve tried
For each webhook, if call.customer.number matches a row in our user_phones table, we PATCH the call via Vapi’s API with:
We see the PATCH succeeding (200 OK) on our side.
Despite that, subsequent tool calls still arrive without call.metadata.userId, so our auth layer continues to fall back.
Questions
- Is PATCH /call/{id} the correct way to inject identity for PSTN calls, or should we be using a different endpoint (e.g., squadding a tool that runs before the first utterance)?
- Is there a newer webhook/event we should subscribe to that replaces assistant-request for server-side metadata injection?
- Are there known limitations when patching metadata mid-call that would prevent tool payloads from picking up the new fields?
- If you have an example of the recommended flow for associating a Telnyx DID with a user account, we’d love to follow it: this feels like a common use case.