release_phone_number
(**kwargs)¶Releases an existing origination phone number in your account. Once released, a phone number is no longer available for sending messages.
If the origination phone number has deletion protection enabled or is associated with a pool, an Error is returned.
See also: AWS API Documentation
Request Syntax
response = client.release_phone_number(
PhoneNumberId='string'
)
[REQUIRED]
The PhoneNumberId or PhoneNumberArn of the phone number to release. You can use DescribePhoneNumbers to get the values for PhoneNumberId and PhoneNumberArn.
{
'PhoneNumberArn': 'string',
'PhoneNumberId': 'string',
'PhoneNumber': 'string',
'Status': 'PENDING'|'ACTIVE'|'ASSOCIATING'|'DISASSOCIATING'|'DELETED',
'IsoCountryCode': 'string',
'MessageType': 'TRANSACTIONAL'|'PROMOTIONAL',
'NumberCapabilities': [
'SMS'|'VOICE',
],
'NumberType': 'SHORT_CODE'|'LONG_CODE'|'TOLL_FREE'|'TEN_DLC',
'MonthlyLeasingPrice': 'string',
'TwoWayEnabled': True|False,
'TwoWayChannelArn': 'string',
'SelfManagedOptOutsEnabled': True|False,
'OptOutListName': 'string',
'CreatedTimestamp': datetime(2015, 1, 1)
}
Response Structure
The PhoneNumberArn of the phone number that was released.
The PhoneNumberId of the phone number that was released.
The phone number that was released.
The current status of the request.
The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.
The message type that was associated with the phone number.
Specifies if the number could be used for text messages, voice, or both.
The type of number that was released.
The monthly price of the phone number, in US dollars.
By default this is set to false. When set to true you can receive incoming text messages from your end recipients.
The Amazon Resource Name (ARN) of the TwoWayChannel.
By default this is set to false. When an end recipient sends a message that begins with HELP or STOP to one of your dedicated numbers, Amazon Pinpoint automatically replies with a customizable message and adds the end recipient to the OptOutList. When set to true you're responsible for responding to HELP and STOP requests. You're also responsible for tracking and honoring opt-out requests.
The name of the OptOutList that was associated with the phone number.
The time when the phone number was created, in UNIX epoch time format.
Exceptions
PinpointSMSVoiceV2.Client.exceptions.ThrottlingException
PinpointSMSVoiceV2.Client.exceptions.AccessDeniedException
PinpointSMSVoiceV2.Client.exceptions.ResourceNotFoundException
PinpointSMSVoiceV2.Client.exceptions.ValidationException
PinpointSMSVoiceV2.Client.exceptions.ConflictException
PinpointSMSVoiceV2.Client.exceptions.InternalServerException