release_phone_number

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'
)
Parameters
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.

Return type
dict
Returns
Response Syntax
{
    '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

  • (dict) --
    • PhoneNumberArn (string) --

      The PhoneNumberArn of the phone number that was released.

    • PhoneNumberId (string) --

      The PhoneNumberId of the phone number that was released.

    • PhoneNumber (string) --

      The phone number that was released.

    • Status (string) --

      The current status of the request.

    • IsoCountryCode (string) --

      The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.

    • MessageType (string) --

      The message type that was associated with the phone number.

    • NumberCapabilities (list) --

      Specifies if the number could be used for text messages, voice, or both.

      • (string) --
    • NumberType (string) --

      The type of number that was released.

    • MonthlyLeasingPrice (string) --

      The monthly price of the phone number, in US dollars.

    • TwoWayEnabled (boolean) --

      By default this is set to false. When set to true you can receive incoming text messages from your end recipients.

    • TwoWayChannelArn (string) --

      The Amazon Resource Name (ARN) of the TwoWayChannel.

    • SelfManagedOptOutsEnabled (boolean) --

      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.

    • OptOutListName (string) --

      The name of the OptOutList that was associated with the phone number.

    • CreatedTimestamp (datetime) --

      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