Skip to content

Bug: Pydantic Validation Error on updating/deleting VAPI bought phone numbers #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
muneeb-ds opened this issue Jan 9, 2025 · 1 comment

Comments

@muneeb-ds
Copy link

muneeb-ds commented Jan 9, 2025

If you buy a phone from vapi and then try to update/delete it from the sdk you get Validation errors because the API response does not have twilio_account_side and twilio_auth_token, both of which are required for TwilioPhoneNumber pydantic model - source

If you directly run the update/delete endpoints, you can verify the response only contains the following parameters:

{
  "id": "random-id",
  "orgId": "random-id",
  "number": "12345678",
  "createdAt": "2025-01-09T09:17:28.478Z",
  "updatedAt": "2025-01-09T09:18:49.304Z",
  "provider": "twilio",
  "server": {
    "url": "server-url"
  }
}

I suggest the following fix of simply making both these fields optional and defaulting to None:

    twilio_account_sid: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="twilioAccountSid")] = (
        pydantic.Field(default=None)
    )
    """
    This is the Twilio Account SID for the phone number.
    """

    twilio_auth_token: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="twilioAuthToken")] = (
        pydantic.Field(default=None)
    )
    """
    This is the Twilio Auth Token for the phone number.
    """
@fern-support
Copy link
Collaborator

@muneeb-ds we've disabled pydantic validation to reduce failures like this. This should be fixed now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants