// This file was auto-generated by Fern from our API Definition.

import type * as Vapi from "../index.js";

export interface CreateTwilioPhoneNumberDto {
    /**
     * This is the fallback destination an inbound call will be transferred to if:
     * 1. `assistantId` is not set
     * 2. `squadId` is not set
     * 3. and, `assistant-request` message to the `serverUrl` fails
     *
     * If this is not set and above conditions are met, the inbound call is hung up with an error message.
     */
    fallbackDestination?: Vapi.CreateTwilioPhoneNumberDtoFallbackDestination | undefined;
    /** This is the hooks that will be used for incoming calls to this phone number. */
    hooks?: Vapi.CreateTwilioPhoneNumberDtoHooksItem[] | undefined;
    /**
     * Controls whether Vapi sets the messaging webhook URL on the Twilio number during import.
     *
     * If set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is.
     * If `true` or omitted (default), Vapi will configure both the voice and messaging URLs.
     *
     * @default true
     */
    smsEnabled?: boolean | undefined;
    /** These are the digits of the phone number you own on your Twilio. */
    number: string;
    /** This is the Twilio Account SID for the phone number. */
    twilioAccountSid: string;
    /** This is the Twilio Auth Token for the phone number. */
    twilioAuthToken?: string | undefined;
    /** This is the Twilio API Key for the phone number. */
    twilioApiKey?: string | undefined;
    /** This is the Twilio API Secret for the phone number. */
    twilioApiSecret?: string | undefined;
    /** This is the name of the phone number. This is just for your own reference. */
    name?: string | undefined;
    /**
     * This is the assistant that will be used for incoming calls to this phone number.
     *
     * If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected.
     */
    assistantId?: string | undefined;
    /**
     * This is the workflow that will be used for incoming calls to this phone number.
     *
     * If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected.
     */
    workflowId?: string | undefined;
    /**
     * This is the squad that will be used for incoming calls to this phone number.
     *
     * If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected.
     */
    squadId?: string | undefined;
    /**
     * This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.
     *
     * The order of precedence is:
     *
     * 1. assistant.server
     * 2. phoneNumber.server
     * 3. org.server
     */
    server?: Vapi.Server | undefined;
}
