Skip to main content

phone_numbers

Creates, updates, deletes, gets or lists a phone_numbers resource.

Overview

Namephone_numbers
TypeResource
Idaws.chime.phone_numbers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
associationsarrayThe phone number associations.
calling_namestringThe outbound calling name associated with the phone number. (pattern: <code>^$|^[a-zA-Z0-9 ]{2,15}$</code>)
calling_name_statusstringThe outbound calling name status. (Unassigned, UpdateInProgress, UpdateSucceeded, UpdateFailed)
capabilitiesobjectThe phone number capabilities.
countrystringThe phone number country. Format: ISO 3166-1 alpha-2. (pattern: <code>[A-Z]{2}</code>)
created_timestampstring (date-time)The phone number creation timestamp, in ISO 8601 format.
deletion_timestampstring (date-time)The deleted phone number timestamp, in ISO 8601 format.
e164_phone_numberstringThe phone number, in E.164 format. (pattern: <code>^+?[1-9]\d{1,14}$</code>)
phone_number_idstringThe phone number ID.
product_typestringThe phone number product type. (BusinessCalling, VoiceConnector, SipMediaApplicationDialIn)
statusstringThe phone number status. (AcquireInProgress, AcquireFailed, Unassigned, Assigned, ReleaseInProgress, DeleteInProgress, ReleaseFailed, DeleteFailed)
typestringThe phone number type. (Local, TollFree)
updated_timestampstring (date-time)The updated phone number timestamp, in ISO 8601 format.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_phone_numberselectphone_number_id, regionRetrieves details for the specified phone number ID, such as associations, capabilities, and product type.
list_phone_numbersselectregionstatus, product-type, filter-name, filter-value, max-results, next-tokenLists the phone numbers for the specified Amazon Chime account, Amazon Chime user, Amazon Chime Voice Connector, or Amazon Chime Voice Connector group.
update_phone_numberupdatephone_number_id, regionUpdates phone number details, such as product type or calling name, for the specified phone number ID. You can update one phone number detail at a time. For example, you can update either the product type or the calling name in one action. For toll-free numbers, you cannot use the Amazon Chime Business Calling product type. For numbers outside the U.S., you must use the Amazon Chime SIP Media Application Dial-In product type. Updates to outbound calling names can take 72 hours to complete. Pending updates to outbound calling names must be complete before you can request another update.
delete_phone_numberdeletephone_number_id, regionMoves the specified phone number into the Deletion queue. A phone number must be disassociated from any users or Amazon Chime Voice Connectors before it can be deleted. Deleted phone numbers remain in the Deletion queue for 7 days before they are deleted permanently.
batch_delete_phone_numberexecregion, PhoneNumberIdsMoves phone numbers into the Deletion queue. Phone numbers must be disassociated from any users or Amazon Chime Voice Connectors before they can be deleted. Phone numbers remain in the Deletion queue for 7 days before they are deleted permanently.
restore_phone_numberexecphone_number_id, regionMoves a phone number from the Deletion queue back into the phone number Inventory.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
phone_number_idstringThe phone number.
regionstringAWS region (default: us-east-1)
filter-namestringThe filter to use to limit the number of results.
filter-valuestringThe value to use for the filter.
max-resultsintegerThe maximum number of results to return in a single call.
next-tokenstringThe token to use to retrieve the next page of results.
product-typestringThe phone number product type.
statusstringThe phone number status.

SELECT examples

Retrieves details for the specified phone number ID, such as associations, capabilities, and product type.

SELECT
associations,
calling_name,
calling_name_status,
capabilities,
country,
created_timestamp,
deletion_timestamp,
e164_phone_number,
phone_number_id,
product_type,
status,
type,
updated_timestamp
FROM aws.chime.phone_numbers
WHERE phone_number_id = '{{ phone_number_id }}' -- required
AND region = '{{ region }}' -- required
;

UPDATE examples

Updates phone number details, such as product type or calling name, for the specified phone number ID. You can update one phone number detail at a time. For example, you can update either the product type or the calling name in one action. For toll-free numbers, you cannot use the Amazon Chime Business Calling product type. For numbers outside the U.S., you must use the Amazon Chime SIP Media Application Dial-In product type. Updates to outbound calling names can take 72 hours to complete. Pending updates to outbound calling names must be complete before you can request another update.

UPDATE aws.chime.phone_numbers
SET
ProductType = '{{ ProductType }}',
CallingName = '{{ CallingName }}'
WHERE
phone_number_id = '{{ phone_number_id }}' --required
AND region = '{{ region }}' --required
RETURNING
phone_number;

DELETE examples

Moves the specified phone number into the Deletion queue. A phone number must be disassociated from any users or Amazon Chime Voice Connectors before it can be deleted. Deleted phone numbers remain in the Deletion queue for 7 days before they are deleted permanently.

DELETE FROM aws.chime.phone_numbers
WHERE phone_number_id = '{{ phone_number_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Moves phone numbers into the Deletion queue. Phone numbers must be disassociated from any users or Amazon Chime Voice Connectors before they can be deleted. Phone numbers remain in the Deletion queue for 7 days before they are deleted permanently.

EXEC aws.chime.phone_numbers.batch_delete_phone_number
@region='{{ region }}' --required
@@json=
'{
"PhoneNumberIds": "{{ PhoneNumberIds }}"
}'
;