Skip to content

REST Resource: projects.phoneNumberInstances

Resource: PhoneNumberInstance

The phone number instance resource.

A phone number instance represents a provisioned phone number or range of phone numbers.

JSON representation
{
  "name": string,
  "phoneNumber": {
    object (PhoneNumber)
  },
  "displayName": string,
  "labels": {
    string: string,
    ...
  },
  "incomingMessageHandlerUris": [
    string
  ],
  "incomingCallHandlerUris": [
    string
  ],
  "callRecordingTrigger": enum (RecordingTrigger),
  "createTime": string (Timestamp),
  "deleteTime": string (Timestamp),
  "activateTime": string (Timestamp),
  "lifecycleState": enum (LifecycleState),
  "range": {
    object (PhoneNumberRange)
  },
  "regulatoryListing": string,
  "compliant": boolean
}
Fields  
name string
Resource name of the phone number instance. It must match the pattern projects/*/phoneNumberInstances/*
phoneNumber object (PhoneNumber)
The phone number associated with the instance. Can only be set on creation.
displayName string
The display name of the phone number for use in the UI. Max length 100 characters.
labels map (key: string, value: string)
The labels associated with the phone number. Max key length 100. Max value length 1000. Max keys 50.
incomingMessageHandlerUris[] string
List of URIs in priority order where incoming messages will be sent to.

The first URI is the primary, and the subsequent URIs are used in order if the previous URIs fail. If no URIs are specified, then no action is taken when receiving messages.

Currently URIs must be fully qualified HTTP/HTTPS URLs, but this may change to include other types of URIs.

Maximum 5 URIs.
incomingCallHandlerUris[] string
List of URIs in priority order that will be executed for incoming calls.

The first URI is the primary, and the subsequent URIs are used in order if the previous URIs fail. If no URIs are specified, then no action is taken when receiving messages.

The following URIs are supported: - absolute http and https URIs. - sip URIs in the format sip:user@domain.com[:port] - tel URIs in the format tel:+phone_number

Additional URIs may be supported in the future.

Maximum 5 URIs.
callRecordingTrigger enum (RecordingTrigger)
The trigger that will start call recording.

You need to comply with certain laws and regulations, including those regarding obtaining consent to record. Enfonica recommends that you consult with your legal counsel to make sure that you are complying with all applicable laws in connection with communications you record or store using Enfonica.

Defaults to DISABLED.
createTime string (Timestamp format)
Output only. The creation time of the phone number instance.
deleteTime string (Timestamp format)
Output only. The deletion time of the phone number instance, if it has been deleted.
activateTime string (Timestamp format)
Output only. The time when the phone number instance became active. For a phone number purchased from inventory, this should match create_time. For a phone number that was ported in, this will be the time when the port in was successful. If not set, the instance has not become active. Output only.
lifecycleState enum (LifecycleState)
Output only. The state of the phone number instance in its lifecycle.
range object (PhoneNumberRange)
Output only. If this resource represents a range of phone numbers, this field will be set and will contain the details of the range. If this field is unset, this resource represents a single phone number.
regulatoryListing string
Output only. The regulatory listing associated with this phone number instance. This field specifies the end-user that is using this resource. The requirements for regulatory listings varies depending on the region and type of phone number. Of the form projects/*/regulatoryListings/*.
compliant boolean
Output only. Whether this phone number instance is compliant with the regulations for phone numbers that Enfonica has inferred. The value of this field is not a substitute for independent legal advice and should be used as a guide only.

PhoneNumberInstance.RecordingTrigger

The trigger to start call recording.

Enums  
RECORDING_TRIGGER_UNSPECIFIED Unspecified recording trigger.
DISABLED Recording is disabled for calls to this phone number instance.
ANSWER Recording will begin when calls to this phone number instance are answered.
BRIDGE Recording will begin when calls to this phone number instance are bridged. This won't include any messages or menus played before the call was bridged. This is useful if you want to record only conversations.

PhoneNumberInstance.LifecycleState

Lifecycle states of phone number instances.

Enums  
LIFECYCLE_STATE_UNSPECIFIED Unspecified lifecycle state.
ACTIVE The phone number instance is active and can be used.
DELETED The phone number instance has been deleted.
SUSPENDED The phone number instance has been suspended.
PENDING Activation for this phone number instance is pending, possibly because the associated phone number is awaiting port in.

This state is used when the associated phone number has not yet been activated (ie its activate_time is not set).

PhoneNumberRange

Describes a phone number range.

A phone number range is a group of phone number instances that are managed by a primary phone number instance representing the first phone number in the range.

Phone number ranges simplify the management of multiple contiguous phone numbers.

JSON representation
{
  "primaryPhoneNumberInstance": string,
  "startPhoneNumber": string,
  "endPhoneNumber": string,
  "size": number (int32)
}
Fields  
primaryPhoneNumberInstance string
The resource name of the primary phone number instance of the range.
startPhoneNumber string
The first phone number in the range.
endPhoneNumber string
The last phone number in the range.
size number (int32 format)
The total quantity of phone numbers in the range.

Methods

Methods  
create POST /v1beta1/{parent}/phoneNumberInstances
Creates a phone number instance. This provisions a phone number against a project.

The caller must have numbering.phoneNumberInstances.create permission on the project.
get GET /v1beta1/{name}
Retrieves a phone number instance identified by the supplied resource name.

The caller must have numbering.phoneNumberInstances.get permission on the project.
list GET /v1beta1/{parent}/phoneNumberInstances
Lists all phone number instances.

List returns phone number instances sorted by create_time descending.

The caller must have numbering.phoneNumberInstances.list permission on the project.
update PATCH /v1beta1/{name}
Updates a phone number instance.

The caller must have numbering.phoneNumberInstances.update permission on the project.
delete DELETE /v1beta1/{name}
Deletes a phone number instance. This disconnects the phone number.

The caller must have numbering.phoneNumberInstances.delete permission on the project.
move POST /v1beta1/{name}:move
Moves the phone number instance to another project.

Warning: moving a phone number instance may cause the current configuration of the phone number instance to stop working. Any connected flows or SIP domains will need to be reconfigured in the destination project. Any programmable handler will need to accept the signing key of the destination project.

The caller must have numbering.phoneNumberInstances.move permission on both the source and destination projects.
splitRange POST /v1beta1/{phone_number_instance}:splitRange
Splits a phone number range into two ranges.

To split a range, you specify how many numbers to keep in this range. These numbers are taken from the start of the range. The remaining numbers will be moved into a new range.

For example, if you have a range +61255501100-99 and you split it with a size of 20, then: - the original range will be modified to +61255501100-19 (size 20) - a new range will be created with +61255501120-99 (size 80)

The caller must have numbering.phoneNumberInstances.splitRange permission on the project.