Skip to main content

phone_numbers

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

Overview

Namephone_numbers
TypeResource
Idaws.chime_sdk_voice.phone_numbers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
associationsarrayThe phone number's 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's capabilities.
countrystringThe phone number's 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>)
namestringThe name of the phone number. (pattern: <code>^$|^[a-zA-Z0-9,._-]+(\s+[a-zA-Z0-9,._-]+)*$</code>)
order_idstringThe phone number's order ID. (pattern: <code>[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}</code>)
phone_number_arnstring (pattern: <code>.\S.</code>)
phone_number_idstringThe phone number's ID. (pattern: <code>.\S.</code>)
product_typestringThe phone number's product type. (VoiceConnector, SipMediaApplicationDialIn)
statusstringThe phone number's status. (Cancelled, PortinCancelRequested, PortinInProgress, AcquireInProgress, AcquireFailed, Unassigned, Assigned, ReleaseInProgress, DeleteInProgress, ReleaseFailed, DeleteFailed)
typestringThe phone number's 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 SDK account, Amazon Chime SDK user, Amazon Chime SDK Voice Connector, or Amazon Chime SDK Voice Connector group.
update_phone_numberupdatephone_number_id, regionUpdates phone number details, such as product type, calling name, or phone number 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, calling name, or phone number name in one action. For numbers outside the U.S., you must use the Amazon Chime SDK 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 SDK Voice Connectors before it can be deleted. Deleted phone numbers remain in the Deletion queue 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 SDK 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, regionRestores a deleted phone number.

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 ID of the phone number being restored.
regionstringAWS region (default: us-east-1)
filter-namestringThe filter to limit the number of results.
filter-valuestringThe filter value.
max-resultsintegerThe maximum number of results to return in a single call.
next-tokenstringThe token used to return the next page of results.
product-typestringThe phone number product types.
statusstringThe status of your organization's phone numbers.

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,
name,
order_id,
phone_number_arn,
phone_number_id,
product_type,
status,
type,
updated_timestamp
FROM aws.chime_sdk_voice.phone_numbers
WHERE phone_number_id = '{{ phone_number_id }}' -- required
AND region = '{{ region }}' -- required
;

UPDATE examples

Updates phone number details, such as product type, calling name, or phone number 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, calling name, or phone number name in one action. For numbers outside the U.S., you must use the Amazon Chime SDK 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_sdk_voice.phone_numbers
SET
ProductType = '{{ ProductType }}',
CallingName = '{{ CallingName }}',
Name = '{{ Name }}'
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 SDK Voice Connectors before it can be deleted. Deleted phone numbers remain in the Deletion queue queue for 7 days before they are deleted permanently.

DELETE FROM aws.chime_sdk_voice.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 SDK 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_sdk_voice.phone_numbers.batch_delete_phone_number
@region='{{ region }}' --required
@@json=
'{
"PhoneNumberIds": "{{ PhoneNumberIds }}"
}'
;