API Reference

This section provides detailed documentation for all classes and methods in the TextVerified Python client.

Core Classes

TextVerified Client

class TextVerified(api_key: str, api_username: str, base_url: str = 'https://www.textverified.com', user_agent: str = 'TextVerified-Python-Client/0.1.0')[source]

API Context for interacting with the Textverified API.

api_key: str
api_username: str
base_url: str = 'https://www.textverified.com'
user_agent: str = 'TextVerified-Python-Client/0.1.0'
property account: AccountAPI
property billing_cycles: BillingCycleAPI
property reservations: ReservationsAPI
property sales: SalesAPI
property services: ServicesAPI
property verifications: VerificationsAPI
property wake_requests: WakeAPI
property sms: SMSApi
property calls: CallAPI
refresh_bearer()[source]

Refresh the bearer token, if expired. Called automatically before performing actions.

__init__(api_key: str, api_username: str, base_url: str = 'https://www.textverified.com', user_agent: str = 'TextVerified-Python-Client/0.1.0') None
class BearerToken(token: str, expires_in: float, expires_at: datetime.datetime)[source]
token: str

Bearer token

expires_in: float

Seconds remaining until bearer token expires

expires_at: datetime

Timestamp of when the token will expire

to_api() Dict[str, Any][source]
classmethod from_api(data: Dict[str, Any]) BearerToken[source]

API Modules

Account API

class AccountAPI(client: _ActionPerformer)[source]

API endpoints related to account management.

me() Account[source]
Returns:

The current account details.

Return type:

Account

property balance: float

Get the current account balance.

property username: str

Get the current account username.

Services API

class ServicesAPI(client: _ActionPerformer)[source]

API endpoints related to services and area codes. This includes fetching available area codes and services for rental or verification.

Please fetch area codes and services, as we update our available area codes and services frequently.

area_codes() List[AreaCode][source]

Fetch all area codes available for rental or verification services, and their associated US state.

Returns:

A list of area codes with their associated US state.

Return type:

List[AreaCode]

list(number_type: NumberType, reservation_type: ReservationType) List[Service][source]

Fetch all services available for rental or verification.

Special cases: Use ‘allservices’ (rentals) or ‘servicenotlisted’ (verifications), note that ‘servicenotlisted’ only receives sms from services that are not listed by us.

Parameters:
  • number_type (NumberType) – The type of number. Most frequently NumberType.MOBILE.

  • reservation_type (ReservationType) – The type of reservation (e.g., renewable, nonrenewable, verification).

Returns:

A list of services available for rental or verification.

Return type:

List[Service]

Verifications API

class VerificationsAPI(client: _ActionPerformer)[source]

API endpoints related to verifications.

create(data: NewVerificationRequest = None, *, area_code_select_option: List[str] = None, carrier_select_option: List[str] = None, service_name: str = None, capability: ReservationCapability = None, service_not_listed_name: str = None, max_price: float = None) VerificationExpanded[source]

Create a new verification for phone number verification purposes.

Verifications are used to receive SMS or voice calls for account verification on various services. This will cost API balance, so ensure you have sufficient funds before calling this method. To estimate the cost, use get_verification_pricing() with the same parameters.

Parameters:
  • data (NewVerificationRequest, optional) – The verification details to create. All kwargs will overwrite values in this object. Defaults to None.

  • area_code_select_option (List[str], optional) – List of preferred area codes for the verification number. Defaults to None.

  • carrier_select_option (List[str], optional) – List of preferred carriers for the verification number. Defaults to None.

  • service_name (str, optional) – Name of the service requiring verification. Can be found by calling textverified.services.get_services(). Defaults to None.

  • capability (ReservationCapability, optional) – The capabilities required (voice, sms, or both) for this verification. Defaults to None.

  • service_not_listed_name (str, optional) – Custom service name if the service is not listed in available services. Defaults to None.

  • max_price (float, optional) – Maximum price you’re willing to pay for this verification. Defaults to None.

Raises:

ValueError – If required fields service_name and capability are not provided.

Returns:

The details of the created verification.

Return type:

VerificationExpanded

pricing(data: NewVerificationRequest | VerificationPriceCheckRequest = None, *, service_name: str = None, area_code: bool = None, carrier: bool = None, number_type: NumberType = None, capability: ReservationCapability = None) PricingSnapshot[source]

Get pricing information for a verification before creating it.

This method allows you to check the cost of a verification before purchasing it. You can pass the a NewVerificationRequest to verify the pricing for that specific configuration before creating it, or provide individual parameters to check pricing for a specific service, area code, carrier, number type, and capability.

Parameters:
  • data (Union[NewVerificationRequest, VerificationPriceCheckRequest], optional) – The verification details to price. All kwargs will overwrite values in this object. Defaults to None.

  • service_name (str, optional) – Name of the service requiring verification. Defaults to None.

  • area_code (bool, optional) – Whether to request a specific area code. Defaults to None.

  • carrier (bool, optional) – Whether to request a specific carrier. Defaults to None.

  • number_type (NumberType, optional) – The underlying type of the number (mobile, voip, etc.). Defaults to None.

  • capability (ReservationCapability, optional) – The capabilities required (voice, sms, or both) for this verification. Defaults to None.

Raises:

ValueError – If any required fields are missing or invalid.

Returns:

The pricing information for the requested verification configuration.

Return type:

PricingSnapshot

details(verification_id: str | VerificationCompact | VerificationExpanded) VerificationExpanded[source]

Get detailed information about a verification by ID.

Parameters:

verification_id (Union[str, VerificationCompact, VerificationExpanded]) – The ID or instance of the verification to retrieve.

Raises:

ValueError – If verification_id is not a valid ID or instance.

Returns:

The detailed information about the verification.

Return type:

VerificationExpanded

list() PaginatedList[VerificationCompact][source]

Get a paginated list of all verifications associated with this account.

Returns:

A paginated list of verification records.

Return type:

PaginatedList[VerificationCompact]

cancel(verification_id: str | VerificationCompact | VerificationExpanded) bool[source]

Cancel an active verification.

This will stop the verification process and may result in a refund depending on the verification status.

Parameters:

verification_id (Union[str, VerificationCompact, VerificationExpanded]) – The ID or instance of the verification to cancel.

Raises:

ValueError – If verification_id is not a valid ID or instance.

Returns:

True if the cancellation was successful, False otherwise.

Return type:

bool

reactivate(verification_id: str | VerificationCompact | VerificationExpanded) bool[source]

Reactivate a previously cancelled or expired verification.

This allows you to resume using a verification that was previously cancelled or has expired, making it available to receive SMS or voice calls again.

Parameters:

verification_id (Union[str, VerificationCompact, VerificationExpanded]) – The ID or instance of the verification to reactivate.

Raises:

ValueError – If verification_id is not a valid ID or instance.

Returns:

True if the reactivation was successful, False otherwise.

Return type:

bool

reuse(verification_id: str | VerificationCompact | VerificationExpanded) bool[source]

Reuse an existing verification for another service verification.

This allows you to use the same verification number for multiple service verifications, potentially saving on costs when you need to verify accounts with multiple services.

Parameters:

verification_id (Union[str, VerificationCompact, VerificationExpanded]) – The ID or instance of the verification to reuse.

Raises:

ValueError – If verification_id is not a valid ID or instance.

Returns:

True if the reuse was successful, False otherwise.

Return type:

bool

report(verification_id: str | VerificationCompact | VerificationExpanded) bool[source]

Report an issue with a verification.

Use this method to report problems with a verification, such as not receiving SMS/calls, number not working, or other issues. This may result in a refund or credit.

Parameters:

verification_id (Union[str, VerificationCompact, VerificationExpanded]) – The ID or instance of the verification to report.

Raises:

ValueError – If verification_id is not a valid ID or instance.

Returns:

True if the report was submitted successfully, False otherwise.

Return type:

bool

SMS API

class SMSApi(client: _ActionPerformer)[source]

API endpoints related to SMS This includes listing SMS messages for rentals and verifications, as well as handling incoming SMS.

Note that SMS messages are only received by rentals that are awake or always-on.

list(data: Reservation | NonrenewableRentalCompact | NonrenewableRentalExpanded | RenewableRentalCompact | RenewableRentalExpanded | VerificationCompact | VerificationExpanded = None, *, to_number: str = None, reservation_type: ReservationType = None) PaginatedList[Sms][source]

List SMS messages for rentals and verifications associated with this account.

You can retrieve all SMS messages across all your rentals and verifications, or filter by specific criteria. When providing a rental or verification object, SMS messages for that specific number will be returned.

Parameters:
Raises:

ValueError – If both data and to_number are provided, or if reservation_type is specified when using a rental/verification object.

Returns:

A paginated list of SMS messages matching the specified criteria.

Return type:

PaginatedList[Sms]

incoming(data: NonrenewableRentalCompact | NonrenewableRentalExpanded | RenewableRentalCompact | RenewableRentalExpanded | VerificationCompact | VerificationExpanded = None, *, to_number: str = None, reservation_type: ReservationType = None, timeout: float = 10.0, polling_interval: float = 1.0, wake_number: bool = False, since: datetime = None) Iterator[Sms][source]

Wait for and yield incoming SMS messages in real-time.

This method polls for new SMS messages and yields them as they arrive. It will wait up to the specified timeout for new messages. The polling stops after the first batch of new messages is received or the timeout is reached.

Note: Only rentals that are awake or always-on can receive SMS messages. Use wake_number=True to automatically wake a rental before polling for messages.

Parameters:
  • data (Union[NonrenewableRentalCompact, NonrenewableRentalExpanded, RenewableRentalCompact, RenewableRentalExpanded, VerificationCompact, VerificationExpanded], optional) – A rental or verification object to monitor for incoming SMS. Defaults to None.

  • to_number (str, optional) – Filter incoming SMS by destination phone number. Cannot be used together with data parameter. Defaults to None.

  • reservation_type (ReservationType, optional) – Filter incoming SMS by reservation type. Cannot be used when providing a data object. Defaults to None.

  • timeout (float, optional) – Maximum time in seconds to wait for incoming messages. If negative, no timeout will be applied. Defaults to 10.0.

  • polling_interval (float, optional) – Time in seconds between polling attempts. Defaults to 1.0.

  • wake_number (bool, optional) – Whether to automatically wake the rental before polling. Only works with rental objects, not verifications. Defaults to False.

  • since (datetime.datetime, optional) – Only yield messages created after this timestamp. Defaults to datetime.datetime.now().

Raises:

ValueError – If wake_number is True but no rental data is provided, or if attempting to wake a verification.

Yields:

Sms – New SMS messages as they arrive.

Call API

class CallAPI(client: _ActionPerformer)[source]

API endpoints related to calls.

list(data: Reservation | NonrenewableRentalCompact | NonrenewableRentalExpanded | RenewableRentalCompact | RenewableRentalExpanded | VerificationCompact | VerificationExpanded = None, *, to_number: str = None, reservation_type: ReservationType = None) PaginatedList[Call][source]

List calls to rentals and verifications associated with this account.

You can retrieve all calls across all your rentals and verifications, or filter by specific criteria. When providing a rental or verification object, calls for that specific number will be returned.

Parameters:
Raises:

ValueError – If both data and to_number are provided, or if reservation_type is specified when using a rental/verification object.

Returns:

A paginated list of calls matching the specified criteria.

Return type:

PaginatedList[Call]

open_call_session(reservation: str | Reservation | NonrenewableRentalCompact | NonrenewableRentalExpanded | RenewableRentalCompact | RenewableRentalExpanded | VerificationCompact | VerificationExpanded) TwilioCallingContextDto[source]

Create a call access token for incoming calls.

This endpoint generates a short-lived Twilio access token. The token is associated with a reservation ID, which is obtained from a voice verification. This token is then used with Twilio’s SDKs to handle an incoming call.

Warning: This is an advanced integration. No support will be provided for implementation or debugging. You are responsible for implementing the provider’s integration to handle incoming calls successfully.

Workflow: 1. Creating a voice verification and getting the corresponding reservation id.

  1. Posting to this endpoint to obtain a short-lived Twilio access token associated with the reservation id.

  2. Using the access token with Twilio’s integration to handle an incoming call.

    See: Twilio’s integration

Parameters:

reservation (Union[str, Reservation, NonrenewableRentalCompact, NonrenewableRentalExpanded, RenewableRentalCompact, RenewableRentalExpanded, VerificationCompact, VerificationExpanded]) – The reservation ID or object to create a call session for.

Returns:

The Twilio calling context containing the access token and other details.

Return type:

TwilioCallingContextDto

Reservations API

class ReservationsAPI(client: _ActionPerformer)[source]

API endpoints related to reservations. This includes both renewable and non-renewable rentals, as well as backorder reservations.

Note that reservations which are not always-on require a wakeup to receive sms. To wake a resrvation, use textverified.wake_requests.create_wake_request(…).

create(data: NewRentalRequest = None, *, allow_back_order_reservations: bool = None, always_on: bool = None, area_code_select_option: List[str] = None, duration: RentalDuration = None, is_renewable: bool = None, number_type: NumberType = None, billing_cycle_id_to_assign_to: str = None, service_name: str = None, capability: ReservationCapability = None) ReservationSaleExpanded[source]

Purchase a new rental. Returns a ReservationSaleExpanded, which contains a list of reservations and backorder reservations. You will need to call .details(obj) on each reservation to get its full details.

service_name can be found by calling textverified.ServiceAPI.get_services().

This will cost api balance, so ensure you have sufficient funds before calling this method. To estimate the cost, use get_rental_pricing() with the same parameters. You can pass the same NewRentalRequest object to both methods.

Parameters:
  • data (NewRentalRequest, optional) – The rental details to create. All kwargs will overwrite values in this object. Defaults to None.

  • allow_back_order_reservations (bool, optional) – If true, a rental back order will be created if the requested rental is out of stock. Defaults to None.

  • always_on (bool, optional) – If set to true, a line that does not require wake up will be assigned if in stock. Otherwise, wakeup will be required. Defaults to None.

  • area_code_select_option (List[str], optional) – List of allowed area codes. Defaults to None.

  • duration (RentalDuration, optional) – Requested duration of the rental. Defaults to None.

  • is_renewable (bool, optional) – Whether the rental is renewable. Defaults to None.

  • number_type (NumberType, optional) – The underlying type of the number. Defaults to None.

  • billing_cycle_id_to_assign_to (str, optional) – Optional billing cycle to which the rental is assigned. If left empty, a new billing cycle will be created for the rental. Only renewable rentals can be assigned to a billing cycle. Defaults to None.

  • service_name (str, optional) – Name of the service. Defaults to None.

  • capability (ReservationCapability, optional) – The capabilities (voice, sms, or both) of this rental. Defaults to None.

Raises:

ValueError – If any required fields are missing or invalid.

Returns:

The details of the created rental reservation.

Return type:

ReservationSaleExpanded

pricing(data: NewRentalRequest | RentalPriceCheckRequest = None, *, service_name: str = None, area_code: bool = None, number_type: NumberType = None, capability: ReservationCapability = None, always_on: bool = None, call_forwarding: bool = None, billing_cycle_id_to_assign_to: str = None, is_renewable: bool = None, duration: RentalDuration = None) PricingSnapshot[source]

Get rental pricing information for a potential rental reservation.

This method allows you to check the cost of a rental before purchasing it. You can pass the a NewRentalRequest to verify the pricing for that specific configuration before creating it, or provide individual parameters to check pricing for a specific service, area code, capability, or number type.

Parameters:
  • data (Union[NewRentalRequest, RentalPriceCheckRequest], optional) – The rental details to price. All kwargs will overwrite values in this object. Defaults to None.

  • service_name (str, optional) – Name of the service. Defaults to None.

  • area_code (bool, optional) – Whether to request a specific area code. Defaults to None.

  • number_type (NumberType, optional) – The underlying type of the number. Defaults to None.

  • capability (ReservationCapability, optional) – The capabilities (voice, sms, or both) of this rental. Defaults to None.

  • always_on (bool, optional) – If set to true, a line that does not require wake up will be assigned if in stock. Defaults to None.

  • call_forwarding (bool, optional) – Whether call forwarding is enabled. Defaults to None.

  • billing_cycle_id_to_assign_to (str, optional) – Optional billing cycle to which the rental would be assigned. Defaults to None.

  • is_renewable (bool, optional) – Whether the rental is renewable. Defaults to None.

  • duration (RentalDuration, optional) – Requested duration of the rental. Defaults to None.

Raises:

ValueError – If any required fields are missing or invalid.

Returns:

The pricing information for the requested rental configuration.

Return type:

PricingSnapshot

backorder(reservation_id: str | BackOrderReservationCompact | BackOrderReservationExpanded) BackOrderReservationExpanded[source]

Get details of a backorder reservation by ID.

Parameters:

reservation_id (Union[str, BackOrderReservationCompact, BackOrderReservationExpanded]) – The ID or instance of the backorder reservation to retrieve.

Raises:

ValueError – If reservation_id is not a valid ID or instance.

Returns:

The detailed information about the backorder reservation.

Return type:

BackOrderReservationExpanded

details(reservation_id: str | Reservation | RenewableRentalCompact | RenewableRentalExpanded | NonrenewableRentalCompact | NonrenewableRentalExpanded) RenewableRentalExpanded | NonrenewableRentalExpanded[source]

Get detailed information about a reservation (renewable or non-renewable).

Parameters:

reservation_id (Union[str, RenewableRentalCompact, RenewableRentalExpanded, NonrenewableRentalCompact, NonrenewableRentalExpanded]) – The ID or instance of the reservation to retrieve.

Raises:

ValueError – If reservation_id is not a valid ID or instance.

Returns:

The detailed information about the reservation. Type depends on whether the reservation is renewable or not.

Return type:

Union[RenewableRentalExpanded, NonrenewableRentalExpanded]

list_renewable() PaginatedList[RenewableRentalCompact][source]

Get a paginated list of all renewable reservations associated with this account.

Returns:

A paginated list of renewable rental reservations.

Return type:

PaginatedList[RenewableRentalCompact]

list_nonrenewable() PaginatedList[NonrenewableRentalCompact][source]

Get a paginated list of all non-renewable reservations associated with this account.

Returns:

A paginated list of non-renewable rental reservations.

Return type:

PaginatedList[NonrenewableRentalCompact]

renewable_details(reservation_id: str | RenewableRentalCompact | RenewableRentalExpanded) RenewableRentalExpanded[source]

Get detailed information about a renewable reservation by ID.

Parameters:

reservation_id (Union[str, RenewableRentalCompact, RenewableRentalExpanded]) – The ID or instance of the renewable reservation to retrieve.

Raises:

ValueError – If reservation_id is not a valid ID or instance.

Returns:

The detailed information about the renewable reservation.

Return type:

RenewableRentalExpanded

nonrenewable_details(reservation_id: str | NonrenewableRentalCompact | NonrenewableRentalExpanded) NonrenewableRentalExpanded[source]

Get detailed information about a non-renewable reservation by ID.

Parameters:

reservation_id (Union[str, NonrenewableRentalCompact, NonrenewableRentalExpanded]) – The ID or instance of the non-renewable reservation to retrieve.

Raises:

ValueError – If reservation_id is not a valid ID or instance.

Returns:

The detailed information about the non-renewable reservation.

Return type:

NonrenewableRentalExpanded

check_health(reservation_id: str | Reservation | RenewableRentalCompact | RenewableRentalExpanded | NonrenewableRentalCompact | NonrenewableRentalExpanded) LineHealth[source]

Check the health status of a reservation.

Parameters:

reservation_id (Union[str, RenewableRentalCompact, RenewableRentalExpanded, NonrenewableRentalCompact, NonrenewableRentalExpanded]) – The ID or instance of the reservation to check.

Raises:

ValueError – If reservation_id is not a valid ID or instance.

Returns:

The health status information for the reservation.

Return type:

LineHealth

update_renewable(reservation_id: str | RenewableRentalCompact | RenewableRentalExpanded, data: RenewableRentalUpdateRequest = None, *, user_notes: str = None, include_for_renewal: bool = None, mark_all_sms_read: bool = None) bool[source]

Update properties of a renewable reservation.

Parameters:
  • reservation_id (Union[str, RenewableRentalCompact, RenewableRentalExpanded]) – The ID or instance of the renewable reservation to update.

  • data (RenewableRentalUpdateRequest, optional) – Data to update. All kwargs will overwrite values in this object. Defaults to None.

  • user_notes (str, optional) – Custom notes for the reservation. Defaults to None.

  • include_for_renewal (bool, optional) – Whether to include this reservation in automatic renewals. Defaults to None.

  • mark_all_sms_read (bool, optional) – Whether to mark all SMS messages as read. Defaults to None.

Raises:

ValueError – If reservation_id is not valid or if no fields are provided to update.

Returns:

True if the update was successful, False otherwise.

Return type:

bool

update_nonrenewable(reservation_id: str | NonrenewableRentalCompact | NonrenewableRentalExpanded, data: NonrenewableRentalUpdateRequest = None, *, user_notes: str = None, mark_all_sms_read: bool = None) bool[source]

Update properties of a non-renewable reservation.

Parameters:
  • reservation_id (Union[str, NonrenewableRentalCompact, NonrenewableRentalExpanded]) – The ID or instance of the non-renewable reservation to update.

  • data (NonrenewableRentalUpdateRequest, optional) – Data to update. All kwargs will overwrite values in this object. Defaults to None.

  • user_notes (str, optional) – Custom notes for the reservation. Defaults to None.

  • mark_all_sms_read (bool, optional) – Whether to mark all SMS messages as read. Defaults to None.

Raises:

ValueError – If reservation_id is not valid or if no fields are provided to update.

Returns:

True if the update was successful, False otherwise.

Return type:

bool

refund_renewable(reservation_id: str | RenewableRentalCompact | RenewableRentalExpanded) bool[source]

Request a refund for a renewable reservation.

Parameters:

reservation_id (Union[str, RenewableRentalCompact, RenewableRentalExpanded]) – The ID or instance of the renewable reservation to refund.

Raises:

ValueError – If reservation_id is not a valid ID or instance.

Returns:

True if the refund request was successful, False otherwise.

Return type:

bool

refund_nonrenewable(reservation_id: str | NonrenewableRentalCompact | NonrenewableRentalExpanded) bool[source]

Request a refund for a non-renewable reservation.

Parameters:

reservation_id (Union[str, NonrenewableRentalCompact, NonrenewableRentalExpanded]) – The ID or instance of the non-renewable reservation to refund.

Raises:

ValueError – If reservation_id is not a valid ID or instance.

Returns:

True if the refund request was successful, False otherwise.

Return type:

bool

renew_overdue(reservation_id: str | RenewableRentalCompact | RenewableRentalExpanded) bool[source]

Renew an overdue renewable reservation.

This will cost api balance, so ensure you have sufficient funds before calling this method.

This method is used to manually renew individual overdue renewable reservations. For bulk renewal of active rentals, use the billing cycle renewal method instead.

Parameters:

reservation_id (Union[str, RenewableRentalCompact, RenewableRentalExpanded]) – The ID or instance of the overdue renewable reservation to renew.

Raises:

ValueError – If reservation_id is not a valid ID or instance.

Returns:

True if the renewal was successful, False otherwise.

Return type:

bool

extend_nonrenewable(data: RentalExtensionRequest = None, *, extension_duration: RentalDuration = None, rental_id: str | NonrenewableRentalCompact | NonrenewableRentalExpanded = None) bool[source]

Extend the duration of a non-renewable reservation.

This will cost api balance, so ensure you have sufficient funds before calling this method.

Parameters:
Raises:

ValueError – If both extension_duration and rental_id are not provided.

Returns:

True if the extension was successful, False otherwise.

Return type:

bool

Sales API

class SalesAPI(client: _ActionPerformer)[source]

API endpoints related to sales. Sales are created when a reservation or verification is sold, and can be queried for details.

list() PaginatedList[ReservationSaleCompact][source]

Fetch all sales associated with this account.

Returns:

A paginated list of sales.

Return type:

PaginatedList[ReservationSaleCompact]

get(sale_id: str | ReservationSaleCompact | ReservationSaleExpanded) ReservationSaleExpanded[source]

Retrieve details of a specific sale

Parameters:

sale_id (Union[str, ReservationSaleCompact, ReservationSaleExpanded]) – The ID or instance of the sale to retrieve.

Raises:

ValueError – If sale_id is not a valid ID or instance.

Returns:

The details of the requested sale.

Return type:

ReservationSaleExpanded

Billing Cycle API

class BillingCycleAPI(client: _ActionPerformer)[source]

API endpoints related to billing cycles. Renewable rentals are associated with billing cycles and can be manually assigned on rental creation or automatically assigned. A single billing cycle can have multiple renewable rentals. Billing cycles can be updated, renewed, and queried for invoices.

list() PaginatedList[BillingCycleCompact][source]

Fetch all billing cycles associated with this account.

get(billing_cycle_id: str) BillingCycleExpanded[source]

Get the details of a billing cycle by ID.

Parameters:

billing_cycle_id (str) – The ID of the billing cycle to retrieve.

Returns:

The detailed information about the billing cycle.

Return type:

BillingCycleExpanded

update(billing_cycle: str | BillingCycleCompact | BillingCycleExpanded, data: BillingCycleUpdateRequest = None, *, reminders_enabled: bool = None, nickname: str = None) bool[source]

Update a billing cycle.

Parameters:
  • billing_cycle (Union[str, BillingCycleCompact, BillingCycleExpanded]) – The ID or instance of the billing cycle to update.

  • data (BillingCycleUpdateRequest, optional) – Data to update. Overwritten by kwargs. Defaults to None.

  • reminders_enabled (bool, optional) – Whether email reminders are enabled. Defaults to None.

  • nickname (str, optional) – Your custom string to identify the billing cycle. Defaults to None.

Raises:

ValueError – If billing_cycle is not a valid ID or instance, or if no fields are provided to update.

Returns:

True if the update was successful, False otherwise.

Return type:

bool

invoices(billing_cycle_id: str | BillingCycleCompact | BillingCycleExpanded) PaginatedList[BillingCycleRenewalInvoice][source]

Get invoices for a specific billing cycle.

Parameters:

billing_cycle_id (Union[str, BillingCycleCompact, BillingCycleExpanded]) – The ID or instance of the billing cycle to retrieve invoices for.

Raises:

ValueError – If billing_cycle_id is not a valid ID or instance.

Returns:

A paginated list of billing cycle renewal invoices.

Return type:

PaginatedList[BillingCycleRenewalInvoice]

preview(billing_cycle_id: str | BillingCycleCompact | BillingCycleExpanded) BillingCycleRenewalInvoice[source]

Preview the next billing cycle invoice.

Parameters:

billing_cycle_id (Union[str, BillingCycleCompact, BillingCycleExpanded]) – The ID or instance of the billing cycle to preview.

Raises:

ValueError – If billing_cycle_id is not a valid ID or instance.

Returns:

The preview of the next billing cycle invoice.

Return type:

BillingCycleRenewalInvoice

renew(billing_cycle_id: str | BillingCycleCompact | BillingCycleExpanded) bool[source]

Renew the active rentals on your billing cycle. Will not renew overdue rentals. To renew overdue rentals, you must explicitly call textverified.reservations.renew_overdue_renewable_reservation on each overdue rental.

Parameters:

billing_cycle_id (Union[str, BillingCycleCompact, BillingCycleExpanded]) – The ID or instance of the billing cycle to renew.

Raises:

ValueError – If billing_cycle_id is not a valid ID or instance.

Returns:

True if the billing cycle was renewed successfully, False otherwise.

Return type:

bool

Wake API

class WakeAPI(client: _ActionPerformer)[source]

API endpoints related to waking lines.

create(reservation_id: str | Reservation | RenewableRentalCompact | RenewableRentalExpanded | NonrenewableRentalCompact | NonrenewableRentalExpanded) WakeResponse[source]

Create a wake request for a rental reservation.

Wake requests are used to activate rental numbers that are in sleep mode, making them available to receive SMS messages and voice calls. The wake process schedules a usage window during which the number will be active.

Parameters:

reservation_id (Union[str, Reservation, RenewableRentalCompact, RenewableRentalExpanded, NonrenewableRentalCompact, NonrenewableRentalExpanded]) – The ID or instance of the reservation to wake.

Raises:

ValueError – If reservation_id is not a valid ID or instance.

Returns:

The wake request details including scheduling information and usage window.

Return type:

WakeResponse

get(wake_request_id: str | WakeResponse) WakeResponse[source]

Get detailed information about a wake request by ID.

Parameters:

wake_request_id (Union[str, WakeResponse]) – The ID or instance of the wake request to retrieve.

Raises:

ValueError – If wake_request_id is not a valid ID or instance.

Returns:

The detailed information about the wake request including status and timing.

Return type:

WakeResponse

estimate_usage_window(reservation_id: str | Reservation | RenewableRentalCompact | RenewableRentalExpanded | NonrenewableRentalCompact | NonrenewableRentalExpanded) UsageWindowEstimateRequest[source]

Estimate the usage window timing for a reservation wake request.

This method provides an estimate of when a wake request would be scheduled without actually creating the wake request. Useful for planning when to wake a number for time-sensitive operations.

Parameters:

reservation_id (Union[str, Reservation, RenewableRentalCompact, RenewableRentalExpanded, NonrenewableRentalCompact, NonrenewableRentalExpanded]) – The ID or instance of the reservation to estimate wake timing for.

Raises:

ValueError – If reservation_id is not a valid ID or instance.

Returns:

The estimated usage window timing information.

Return type:

UsageWindowEstimateRequest

wait_for_number_wake(reservation_id: str | RenewableRentalCompact | RenewableRentalExpanded | NonrenewableRentalCompact | NonrenewableRentalExpanded, poll_frequency: float = 5.0) WakeResponse[source]

Create a wake request and wait for the number to become active.

This is a convenience method that combines creating a wake request and waiting for it to complete. The method will block until the usage window begins and the number is ready to receive SMS/calls.

Parameters:
Raises:

ValueError – If reservation_id is not valid or if the wake request creation fails.

Returns:

The wake response containing the usage window start time, end time, and other details.

Return type:

WakeResponse

wait_for_wake_request(wake_request_id: str | WakeResponse, poll_frequency: float = 5.0) WakeResponse[source]

Wait for an existing wake request to complete and become active.

This method blocks execution until the wake request’s usage window starts, meaning the number is ready to receive SMS messages and voice calls. Use this when you have an existing wake request and need to wait for it to become active.

Parameters:
  • wake_request_id (Union[str, WakeResponse]) – The ID or instance of the wake request to wait for.

  • poll_frequency (float) – The frequency (in seconds) to poll for the wake request status. Estimated usage window may change after wake request creation.

Raises:

ValueError – If wake_request_id is not valid or if the wake request is not properly scheduled.

Returns:

The wake response containing the usage window start time, end time, and other details.

Return type:

WakeResponse

PaginatedList

class PaginatedList(request_json: dict, parse_item: Callable[[dict], T], api_context: _ActionPerformer)[source]

Handles paginated API responses, allowing iteration over items and fetching additional pages as needed. You should not need to instantiate this class directly; use the API methods that return it instead.

Supports iteration and indexing, allowing you to access items as if it were a regular list. To exhaust all items, iterate over it using list(paginated_list) or call paginated_list.get_all_items().

get_all_items() List[T][source]

Get all items in the paginated list, fetching all pages if necessary.

Returns:

A list of all items in the paginated list.

Return type:

List[T]

Data Objects

This module contains auto-generated enums and dataclasses from the API schema.

class Account(username: str, current_balance: float)[source]
classmethod from_api(data: Dict[str, Any]) Account[source]
to_api() Dict[str, Any][source]
username: str

The username of the account holder.

current_balance: float

The current balance of the account.

class AddOnSnapshot(add_on_id: str, description: str, renewal_cost: float, already_renewed: bool)[source]
classmethod from_api(data: Dict[str, Any]) AddOnSnapshot[source]
to_api() Dict[str, Any][source]
add_on_id: str
description: str
renewal_cost: float
already_renewed: bool
class AreaCode(area_code: str, state: str)[source]
classmethod from_api(data: Dict[str, Any]) AreaCode[source]
to_api() Dict[str, Any][source]
area_code: str

Area code. Optionally supply this value when an `areaCodeSelectOption` is in the request body or parameter.

state: str

The US state associated with the area code.

class BackOrderReservationCompact(id: str, service_name: str, status: textverified.data.dtypes.BackOrderState)[source]
classmethod from_api(data: Dict[str, Any]) BackOrderReservationCompact[source]
to_api() Dict[str, Any][source]
id: str
service_name: str

Name of service

status: BackOrderState
class BackOrderReservationExpanded(id: str, service_name: str, sale_id: str, status: textverified.data.dtypes.BackOrderState, reservation_id: str | None = None)[source]
classmethod from_api(data: Dict[str, Any]) BackOrderReservationExpanded[source]
reservation_id: str | None = None
to_api() Dict[str, Any][source]
id: str
service_name: str
sale_id: str
status: BackOrderState
class BackOrderReservationWebhookEvent(back_order_id: str)[source]
classmethod from_api(data: Dict[str, Any]) BackOrderReservationWebhookEvent[source]
to_api() Dict[str, Any][source]
back_order_id: str

Id of the back order reservation.

class BackOrderState(value)[source]
to_api() str[source]
classmethod from_api(value: str) BackOrderState[source]
CREATED = 'created'
FULFILLED = 'fulfilled'
CANCELED = 'canceled'
class BearerToken(token: str, expires_in: float, expires_at: datetime.datetime)[source]
classmethod from_api(data: Dict[str, Any]) BearerToken[source]
to_api() Dict[str, Any][source]
token: str

Bearer token

expires_in: float

Seconds remaining until bearer token expires

expires_at: datetime

Timestamp of when the token will expire

class BillingCycleCompact(id: str, billing_cycle_ends_at: datetime.datetime, email_notifications_enabled: bool, state: str)[source]
classmethod from_api(data: Dict[str, Any]) BillingCycleCompact[source]
to_api() Dict[str, Any][source]
id: str

Id of the billing cycle

billing_cycle_ends_at: datetime
email_notifications_enabled: bool
state: str
class BillingCycleExpanded(id: str, renewed_through: datetime.datetime, billing_cycle_ends_at: datetime.datetime, email_notifications_enabled: bool, state: str, next_auto_renew_attempt: datetime.datetime | None = None)[source]
classmethod from_api(data: Dict[str, Any]) BillingCycleExpanded[source]
next_auto_renew_attempt: datetime | None = None
to_api() Dict[str, Any][source]
id: str

Id of the billing cycle

renewed_through: datetime
billing_cycle_ends_at: datetime
email_notifications_enabled: bool
state: str
class BillingCycleRenewalInvoice(created_at: datetime.datetime, id: str, excluded_rentals: List[textverified.data.dtypes.RentalSnapshot], included_rentals: List[textverified.data.dtypes.RentalSnapshot], is_paid_for: bool, total_cost: float)[source]
classmethod from_api(data: Dict[str, Any]) BillingCycleRenewalInvoice[source]
to_api() Dict[str, Any][source]
created_at: datetime
id: str
excluded_rentals: List[RentalSnapshot]
included_rentals: List[RentalSnapshot]
is_paid_for: bool
total_cost: float

Total amount cost of the invoice, in account credits.

class BillingCycleRenewalInvoicePreview(billing_cycle_id: str, renewal_estimate: textverified.data.dtypes.BillingCycleRenewalInvoice)[source]
classmethod from_api(data: Dict[str, Any]) BillingCycleRenewalInvoicePreview[source]
to_api() Dict[str, Any][source]
billing_cycle_id: str
renewal_estimate: BillingCycleRenewalInvoice
class BillingCycleUpdateRequest(reminders_enabled: bool | None = None, nickname: str | None = None)[source]

Supplying a value of ‘null’ or not supplying a value for any nullable properties will cause the property to be ignored.

classmethod from_api(data: Dict[str, Any]) BillingCycleUpdateRequest[source]
nickname: str | None = None
reminders_enabled: bool | None = None
to_api() Dict[str, Any][source]
class BillingCycleWebhookEvent(billing_cycle_id: str | None = None)[source]
billing_cycle_id: str | None = None
classmethod from_api(data: Dict[str, Any]) BillingCycleWebhookEvent[source]
to_api() Dict[str, Any][source]
class Call(to_value: str, created_at: datetime.datetime, id: str, from_value: str | None = None, recording_uri: str | None = None)[source]
classmethod from_api(data: Dict[str, Any]) Call[source]
from_value: str | None = None
recording_uri: str | None = None
to_api() Dict[str, Any][source]
to_value: str
created_at: datetime
id: str
class CallContext(reservation_id: str, twilio_context: textverified.data.dtypes.TwilioCallingContextDto)[source]
classmethod from_api(data: Dict[str, Any]) CallContext[source]
to_api() Dict[str, Any][source]
reservation_id: str

Id of the verification that this call context is associated with.

twilio_context: TwilioCallingContextDto
class CallSessionRequest(reservation_id: str)[source]
classmethod from_api(data: Dict[str, Any]) CallSessionRequest[source]
to_api() Dict[str, Any][source]
reservation_id: str
class CancelAction(can_cancel: bool)[source]
classmethod from_api(data: Dict[str, Any]) CancelAction[source]
to_api() Dict[str, Any][source]
can_cancel: bool
class Error(error_code: str | None = None, error_description: str | None = None)[source]
error_code: str | None = None
error_description: str | None = None
classmethod from_api(data: Dict[str, Any]) Error[source]
to_api() Dict[str, Any][source]
class KeysetPaginationDirectionality(value)[source]
to_api() str[source]
classmethod from_api(value: str) KeysetPaginationDirectionality[source]
FORWARD = 'forward'
REVERSE = 'reverse'
class LineHealth(line_number: str, checked_at: datetime.datetime | None = None)[source]
checked_at: datetime | None = None
classmethod from_api(data: Dict[str, Any]) LineHealth[source]
to_api() Dict[str, Any][source]
line_number: str

Line number associated with the reservation.

class LineReservationType(value)[source]
to_api() str[source]
classmethod from_api(value: str) LineReservationType[source]
VERIFICATION = 'verification'
RENTAL = 'rental'
class NewRentalRequest(allow_back_order_reservations: bool, always_on: bool, duration: textverified.data.dtypes.RentalDuration, is_renewable: bool, number_type: textverified.data.dtypes.NumberType, service_name: str, capability: textverified.data.dtypes.ReservationCapability, area_code_select_option: List[str] | None = None, billing_cycle_id_to_assign_to: str | None = None)[source]
area_code_select_option: List[str] | None = None
billing_cycle_id_to_assign_to: str | None = None
classmethod from_api(data: Dict[str, Any]) NewRentalRequest[source]
to_api() Dict[str, Any][source]
allow_back_order_reservations: bool

If set to true, a rental back order will be created if the requested rental is out of stock

always_on: bool

If set to true, a line that does not require wake up will be assigned if in stock

duration: RentalDuration
is_renewable: bool
number_type: NumberType
service_name: str

Name of the service

capability: ReservationCapability
class NewVerificationRequest(service_name: str, capability: textverified.data.dtypes.ReservationCapability, area_code_select_option: List[str] | None = None, carrier_select_option: List[str] | None = None, service_not_listed_name: str | None = None, max_price: float | None = None)[source]
area_code_select_option: List[str] | None = None
carrier_select_option: List[str] | None = None
classmethod from_api(data: Dict[str, Any]) NewVerificationRequest[source]
max_price: float | None = None
service_not_listed_name: str | None = None
to_api() Dict[str, Any][source]
service_name: str

abra

Type:

Example

capability: ReservationCapability
class NonrenewableRentalCompact(created_at: datetime.datetime, id: str, service_name: str, state: textverified.data.dtypes.ReservationState, number: str, always_on: bool, sale_id: str | None = None)[source]
classmethod from_api(data: Dict[str, Any]) NonrenewableRentalCompact[source]
sale_id: str | None = None
to_api() Dict[str, Any][source]
created_at: datetime
id: str
service_name: str
state: ReservationState
number: str
always_on: bool
class NonrenewableRentalExpanded(created_at: datetime.datetime, ends_at: datetime.datetime, id: str, refund: textverified.data.dtypes.RefundAction, service_name: str, state: textverified.data.dtypes.ReservationState, number: str, always_on: bool, sale_id: str | None = None)[source]
classmethod from_api(data: Dict[str, Any]) NonrenewableRentalExpanded[source]
sale_id: str | None = None
to_api() Dict[str, Any][source]
created_at: datetime
ends_at: datetime
id: str
refund: RefundAction
service_name: str
state: ReservationState
number: str
always_on: bool
class NonrenewableRentalUpdateRequest(user_notes: str | None = None, mark_all_sms_read: bool | None = None)[source]

Supplying a value of ‘null’ or not supplying a value for any nullable properties will cause the property to be ignored.

classmethod from_api(data: Dict[str, Any]) NonrenewableRentalUpdateRequest[source]
mark_all_sms_read: bool | None = None
to_api() Dict[str, Any][source]
user_notes: str | None = None
class NumberType(value)[source]
to_api() str[source]
classmethod from_api(value: str) NumberType[source]
MOBILE = 'mobile'
VOIP = 'voip'
LANDLINE = 'landline'
class PricingSnapshot(service_name: str, price: float)[source]
classmethod from_api(data: Dict[str, Any]) PricingSnapshot[source]
to_api() Dict[str, Any][source]
service_name: str

Name of the service.

price: float

Total cost.

class ReactivationAction(can_reactivate: bool)[source]
classmethod from_api(data: Dict[str, Any]) ReactivationAction[source]
to_api() Dict[str, Any][source]
can_reactivate: bool
class RefundAction(can_refund: bool, refundable_until: datetime.datetime | None = None)[source]
classmethod from_api(data: Dict[str, Any]) RefundAction[source]
refundable_until: datetime | None = None
to_api() Dict[str, Any][source]
can_refund: bool
class RenewableRentalCompact(created_at: datetime.datetime, id: str, service_name: str, state: textverified.data.dtypes.ReservationState, billing_cycle_id: str, is_included_for_next_renewal: bool, number: str, always_on: bool, sale_id: str | None = None)[source]
classmethod from_api(data: Dict[str, Any]) RenewableRentalCompact[source]
sale_id: str | None = None
to_api() Dict[str, Any][source]
created_at: datetime
id: str
service_name: str

yahoo

Type:

Example

state: ReservationState
billing_cycle_id: str
is_included_for_next_renewal: bool
number: str

2223334444

Type:

Example

always_on: bool
class RenewableRentalExpanded(created_at: datetime.datetime, id: str, refund: textverified.data.dtypes.RefundAction, service_name: str, state: textverified.data.dtypes.ReservationState, billing_cycle_id: str, is_included_for_next_renewal: bool, number: str, always_on: bool, sale_id: str | None = None)[source]
classmethod from_api(data: Dict[str, Any]) RenewableRentalExpanded[source]
sale_id: str | None = None
to_api() Dict[str, Any][source]
created_at: datetime
id: str
refund: RefundAction
service_name: str
state: ReservationState
billing_cycle_id: str
is_included_for_next_renewal: bool
number: str

2223334444

Type:

Example

always_on: bool
class RenewableRentalUpdateRequest(user_notes: str | None = None, include_for_renewal: bool | None = None, mark_all_sms_read: bool | None = None)[source]

Supplying a value of ‘null’ or not supplying a value for any nullable properties will cause the property to be ignored.

classmethod from_api(data: Dict[str, Any]) RenewableRentalUpdateRequest[source]
include_for_renewal: bool | None = None
mark_all_sms_read: bool | None = None
to_api() Dict[str, Any][source]
user_notes: str | None = None
class RentalDuration(value)[source]
to_api() str[source]
classmethod from_api(value: str) RentalDuration[source]
ONE_DAY = 'oneDay'
THREE_DAY = 'threeDay'
SEVEN_DAY = 'sevenDay'
FOURTEEN_DAY = 'fourteenDay'
THIRTY_DAY = 'thirtyDay'
NINETY_DAY = 'ninetyDay'
ONE_YEAR = 'oneYear'
class RentalExtensionRequest(extension_duration: textverified.data.dtypes.RentalDuration, rental_id: str)[source]
classmethod from_api(data: Dict[str, Any]) RentalExtensionRequest[source]
to_api() Dict[str, Any][source]
extension_duration: RentalDuration
rental_id: str
class RentalPriceCheckRequest(service_name: str, area_code: bool, number_type: textverified.data.dtypes.NumberType, capability: textverified.data.dtypes.ReservationCapability, always_on: bool, is_renewable: bool, duration: textverified.data.dtypes.RentalDuration, call_forwarding: bool | None = None, billing_cycle_id_to_assign_to: str | None = None)[source]
billing_cycle_id_to_assign_to: str | None = None
call_forwarding: bool | None = None
classmethod from_api(data: Dict[str, Any]) RentalPriceCheckRequest[source]
to_api() Dict[str, Any][source]
service_name: str

Name of the service

area_code: bool

Set to true if a specific area code will be requested when creating a rental, false if any area code can be used.

number_type: NumberType
capability: ReservationCapability
always_on: bool

True

Type:

Example

is_renewable: bool

True

Type:

Example

duration: RentalDuration
class RentalSnapshot(number: str, renewal_cost: float, service_name: str, already_renewed: bool, included_add_ons: List[textverified.data.dtypes.AddOnSnapshot], excluded_add_ons: List[textverified.data.dtypes.AddOnSnapshot])[source]
classmethod from_api(data: Dict[str, Any]) RentalSnapshot[source]
to_api() Dict[str, Any][source]
number: str
renewal_cost: float

Renewal cost, in account credits.

service_name: str
already_renewed: bool
included_add_ons: List[AddOnSnapshot]
excluded_add_ons: List[AddOnSnapshot]
class ReportAction(can_report: bool)[source]
classmethod from_api(data: Dict[str, Any]) ReportAction[source]
to_api() Dict[str, Any][source]
can_report: bool
class Reservation(id: str, reservation_type: textverified.data.dtypes.ReservationType, service_name: str)[source]
classmethod from_api(data: Dict[str, Any]) Reservation[source]
to_api() Dict[str, Any][source]
id: str

Id of the reservation

reservation_type: ReservationType
service_name: str

Name of service

class ReservationCapability(value)[source]
to_api() str[source]
classmethod from_api(value: str) ReservationCapability[source]
SMS = 'sms'
VOICE = 'voice'
SMS_AND_VOICE_COMBO = 'smsAndVoiceCombo'
class ReservationCreatedWebhookEvent(id: str, type: textverified.data.dtypes.LineReservationType)[source]
classmethod from_api(data: Dict[str, Any]) ReservationCreatedWebhookEvent[source]
to_api() Dict[str, Any][source]
id: str

Id of the created reservation.

type: LineReservationType
class ReservationSaleCompact(created_at: datetime.datetime, id: str, state: textverified.data.dtypes.ReservationSaleState, total_cost: float, updated_at: datetime.datetime)[source]
classmethod from_api(data: Dict[str, Any]) ReservationSaleCompact[source]
to_api() Dict[str, Any][source]
created_at: datetime
id: str
state: ReservationSaleState
total_cost: float

0.95

Type:

Example

updated_at: datetime
class ReservationSaleExpanded(created_at: datetime.datetime, id: str, back_order_reservations: List[textverified.data.dtypes.BackOrderReservationCompact], reservations: List[textverified.data.dtypes.Reservation], state: textverified.data.dtypes.ReservationSaleState, total: float, updated_at: datetime.datetime)[source]
classmethod from_api(data: Dict[str, Any]) ReservationSaleExpanded[source]
to_api() Dict[str, Any][source]
created_at: datetime
id: str
back_order_reservations: List[BackOrderReservationCompact]
reservations: List[Reservation]
state: ReservationSaleState
total: float

Total amount of the sale, in account credits.

updated_at: datetime
class ReservationSaleState(value)[source]
to_api() str[source]
classmethod from_api(value: str) ReservationSaleState[source]
CREATED = 'created'
PROCESSING = 'processing'
FAILED = 'failed'
SUCCEEDED = 'succeeded'
class ReservationState(value)[source]
to_api() str[source]
classmethod from_api(value: str) ReservationState[source]
VERIFICATION_PENDING = 'verificationPending'
VERIFICATION_COMPLETED = 'verificationCompleted'
VERIFICATION_CANCELED = 'verificationCanceled'
VERIFICATION_TIMED_OUT = 'verificationTimedOut'
VERIFICATION_REPORTED = 'verificationReported'
VERIFICATION_REFUNDED = 'verificationRefunded'
VERIFICATION_REUSED = 'verificationReused'
VERIFICATION_REACTIVATED = 'verificationReactivated'
RENEWABLE_ACTIVE = 'renewableActive'
RENEWABLE_OVERDUE = 'renewableOverdue'
RENEWABLE_EXPIRED = 'renewableExpired'
RENEWABLE_REFUNDED = 'renewableRefunded'
NONRENEWABLE_ACTIVE = 'nonrenewableActive'
NONRENEWABLE_EXPIRED = 'nonrenewableExpired'
NONRENEWABLE_REFUNDED = 'nonrenewableRefunded'
class ReservationType(value)[source]
to_api() str[source]
classmethod from_api(value: str) ReservationType[source]
RENEWABLE = 'renewable'
NONRENEWABLE = 'nonrenewable'
VERIFICATION = 'verification'
class ReuseAction(reusable_until: datetime.datetime | None = None)[source]
classmethod from_api(data: Dict[str, Any]) ReuseAction[source]
reusable_until: datetime | None = None
to_api() Dict[str, Any][source]
class Service(service_name: str, capability: textverified.data.dtypes.ReservationCapability)[source]
classmethod from_api(data: Dict[str, Any]) Service[source]
to_api() Dict[str, Any][source]
service_name: str

Name of the service. Supply this value when a `ServiceName` is required.

capability: ReservationCapability
class Sms(id: str, to_value: str, created_at: datetime, encrypted: bool, from_value: str | None = None, sms_content: str | None = None, parsed_code: str | None = None)[source]
classmethod from_api(data: Dict[str, Any]) Sms[source]
from_value: str | None = None
parsed_code: str | None = None
sms_content: str | None = None
to_api() Dict[str, Any][source]
id: str
to_value: str
created_at: datetime
encrypted: bool
class SmsWebhookEvent(to_value: str, created_at: datetime.datetime, encrypted: bool, from_value: str | None = None, sms_content: str | None = None, parsed_code: str | None = None, reservation_id: str | None = None)[source]
classmethod from_api(data: Dict[str, Any]) SmsWebhookEvent[source]
from_value: str | None = None
parsed_code: str | None = None
reservation_id: str | None = None
sms_content: str | None = None
to_api() Dict[str, Any][source]
to_value: str
created_at: datetime
encrypted: bool

True if the contents of the sms is encrypted at rest.

class TwilioCallingContextDto(token: str | None = None)[source]
classmethod from_api(data: Dict[str, Any]) TwilioCallingContextDto[source]
to_api() Dict[str, Any][source]
token: str | None = None
class UsageWindowEstimateRequest(reservation_id: str)[source]
classmethod from_api(data: Dict[str, Any]) UsageWindowEstimateRequest[source]
to_api() Dict[str, Any][source]
reservation_id: str

The reservation Id to get the estimated usage window for. If a valid reservation does not exist, a 400 response will be returned.

class UsageWindowEstimateResponse(reservation_id: str, estimated_window_start: datetime.datetime | None = None, estimated_window_end: datetime.datetime | None = None)[source]
estimated_window_end: datetime | None = None
estimated_window_start: datetime | None = None
classmethod from_api(data: Dict[str, Any]) UsageWindowEstimateResponse[source]
to_api() Dict[str, Any][source]
reservation_id: str

Id of the reservation that this usage window estimate is associated with.

class VerificationCompact(created_at: datetime.datetime, id: str, service_name: str, state: textverified.data.dtypes.ReservationState, total_cost: float, number: str)[source]
classmethod from_api(data: Dict[str, Any]) VerificationCompact[source]
to_api() Dict[str, Any][source]
created_at: datetime
id: str
service_name: str
state: ReservationState
total_cost: float

0.95

Type:

Example

number: str
class VerificationExpanded(number: str, created_at: datetime.datetime, ends_at: datetime.datetime, id: str, cancel: textverified.data.dtypes.CancelAction, reactivate: textverified.data.dtypes.ReactivationAction, report: textverified.data.dtypes.ReportAction, reuse: textverified.data.dtypes.ReuseAction, service_name: str, state: textverified.data.dtypes.ReservationState, total_cost: float)[source]
classmethod from_api(data: Dict[str, Any]) VerificationExpanded[source]
to_api() Dict[str, Any][source]
number: str
created_at: datetime
ends_at: datetime
id: str
cancel: CancelAction
reactivate: ReactivationAction
report: ReportAction
reuse: ReuseAction
service_name: str
state: ReservationState
total_cost: float

0.95

Type:

Example

class VerificationPriceCheckRequest(service_name: str, area_code: bool, carrier: bool, number_type: textverified.data.dtypes.NumberType, capability: textverified.data.dtypes.ReservationCapability)[source]
classmethod from_api(data: Dict[str, Any]) VerificationPriceCheckRequest[source]
to_api() Dict[str, Any][source]
service_name: str

yahoo

Type:

Example

area_code: bool

Set to true if a specific area code will be requested when creating a verification, false if any area code can be used.

carrier: bool

Set to true if a specific carrier will be requested when creating a verification, false if any carrier can be used.

number_type: NumberType
capability: ReservationCapability
class WakeRequest(reservation_id: str)[source]
classmethod from_api(data: Dict[str, Any]) WakeRequest[source]
to_api() Dict[str, Any][source]
reservation_id: str

The reservation Id to create a wake request for. If a valid reservation does not exist, a 400 response will be returned.

class WakeResponse(id: str, is_scheduled: bool, usage_window_start: datetime.datetime | None = None, usage_window_end: datetime.datetime | None = None, reservation_id: str | None = None)[source]
classmethod from_api(data: Dict[str, Any]) WakeResponse[source]
reservation_id: str | None = None
to_api() Dict[str, Any][source]
usage_window_end: datetime | None = None
usage_window_start: datetime | None = None
id: str

The Id of this wake request.

is_scheduled: bool

Indicates whether or not the wake request was successfully scheduled. If a wake request fails to be scheduled, then you will have to submit a new wake request. Too many wake requests may result in wake request throttling.

class WebhookEventBackOrderReservationWebhookEvent(attempt: int, occurred_at: datetime.datetime, data: textverified.data.dtypes.BackOrderReservationWebhookEvent, event: str, id: str)[source]
classmethod from_api(data: Dict[str, Any]) WebhookEventBackOrderReservationWebhookEvent[source]
to_api() Dict[str, Any][source]
attempt: int

Send attempt count

occurred_at: datetime

When the event occurred

data: BackOrderReservationWebhookEvent
event: str

Name of the event

id: str

Id of event

class WebhookEventBillingCycleWebhookEvent(attempt: int, occurred_at: datetime.datetime, data: textverified.data.dtypes.BillingCycleWebhookEvent, event: str, id: str)[source]
classmethod from_api(data: Dict[str, Any]) WebhookEventBillingCycleWebhookEvent[source]
to_api() Dict[str, Any][source]
attempt: int

Send attempt count

occurred_at: datetime

When the event occurred

data: BillingCycleWebhookEvent
event: str

Name of the event

id: str

Id of event

class WebhookEventReservationCreatedWebhookEvent(attempt: int, occurred_at: datetime.datetime, data: textverified.data.dtypes.ReservationCreatedWebhookEvent, event: str, id: str)[source]
classmethod from_api(data: Dict[str, Any]) WebhookEventReservationCreatedWebhookEvent[source]
to_api() Dict[str, Any][source]
attempt: int

Send attempt count

occurred_at: datetime

When the event occurred

data: ReservationCreatedWebhookEvent
event: str

Name of the event

id: str

Id of event

class WebhookEventSmsWebhookEvent(attempt: int, occurred_at: datetime.datetime, data: textverified.data.dtypes.SmsWebhookEvent, event: str, id: str)[source]
classmethod from_api(data: Dict[str, Any]) WebhookEventSmsWebhookEvent[source]
to_api() Dict[str, Any][source]
attempt: int

Send attempt count

occurred_at: datetime

When the event occurred

data: SmsWebhookEvent
event: str

Name of the event

id: str

Id of event