- [Resource: PhoneNumber](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers#PhoneNumber)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers#PhoneNumber.SCHEMA_REPRESENTATION)
  - [LifecycleState](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers#PhoneNumber.LifecycleState)
  - [AllowedSipTrunks](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers#PhoneNumber.AllowedSipTrunks)
    - [JSON representation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers#PhoneNumber.AllowedSipTrunks.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers#METHODS_SUMMARY)

## Resource: PhoneNumber

Represents a phone number. `PhoneNumber` resources enable phone calls to be answered by Dialogflow services and are added to a project through a `PhoneNumberOrder`.

| JSON representation |
|---|
| ``` { "name": string, "phoneNumber": string, "conversationProfile": string, "lifecycleState": enum (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers#PhoneNumber.LifecycleState`), "purgeTime": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "allowedSipTrunks": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers#PhoneNumber.AllowedSipTrunks`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `name` | `string` Optional. The unique identifier of this phone number. Required for `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.phoneNumbers/patch#google.cloud.dialogflow.v2beta1.PhoneNumbers.UpdatePhoneNumber` method. Format: `projects/<Project ID>/phoneNumbers/<PhoneNumber ID>`. Format: `projects/<Project ID>/locations/<Location ID>/phoneNumbers/<PhoneNumber ID>`. |
| `phoneNumber` | `string` Output only. Phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. An example of a correctly formatted phone number: +15556767888. |
| `conversationProfile` | `string` Optional. The conversation profile calls to this `PhoneNumber` should use. The project ID here should be the same as the one in `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers#PhoneNumber.FIELDS.name`. Format: `projects/<Project ID>/conversationProfiles/<ConversationProfile ID>`. Format: `projects/<Project ID>/locations/<Location ID>/conversationProfiles/<ConversationProfile ID>`. |
| `lifecycleState` | ``enum (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers#PhoneNumber.LifecycleState`)`` Output only. The state of the `PhoneNumber`. Defaults to `ACTIVE`. `PhoneNumber` objects set to `DELETE_REQUESTED` always decline incoming calls and can be removed completely within 30 days. |
| `purgeTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time at which this resource will be purged. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| Restricts inbound calls The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `allowedSipTrunks` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers#PhoneNumber.AllowedSipTrunks`)`` Optional. Only allow calls from the specified SIP trunks. |
| End of mutually exclusive fields. ||

### LifecycleState

The states that a `PhoneNumber` can be in.

| Enums ||
|---|---|
| `LIFECYCLE_STATE_UNSPECIFIED` | This value is never used. |
| `ACTIVE` | Number is active and can receive phone calls. |
| `DELETE_REQUESTED` | Number is pending deletion, and cannot receive calls. |

### AllowedSipTrunks

List of SIP trunks that are allowed to make calls to this phone number.

| JSON representation |
|---|
| ``` { "sipTrunks": [ string ], "carrierIds": [ string ] } ``` |

| Fields ||
|---|---|
| `sipTrunks[]` | `string` List of SIP trunks that are allowed to make calls to this phone number. If empty, any SIP trunk is allowed. |
| `carrierIds[]` | `string` Optional. List of GTP carrier IDs allowed to make calls to this phone number. Used for private interconnects where standard SIP trunks aren't applicable. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers/delete` | Requests deletion of a `PhoneNumber`. |
| ### `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers/list` | Returns the list of all phone numbers in the specified project. |
| ### `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers/patch` | Updates the specified `PhoneNumber`. |
| ### `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.phoneNumbers/undelete` | Cancels the deletion request for a `PhoneNumber`. |