## Update a phone number

`client.PhoneNumbers.Update(ctx, phoneNumberID, body) (*PhoneNumberUpdateResponse, error)`

**put** `/v3/phone_numbers/{phoneNumberId}`

Updates the forwarding number for a phone number. The forwarding number is where inbound calls will be forwarded to.

Pass an empty string to clear the forwarding number.

### Parameters

- `phoneNumberID string`

- `body PhoneNumberUpdateParams`

  - `ForwardingNumber param.Field[string]`

    The forwarding number in E.164 format. Set to null or empty string to clear.

### Returns

- `type PhoneNumberUpdateResponse struct{…}`

  - `ID string`

    Unique identifier for the phone number

  - `ForwardingNumber string`

    The forwarding number after the update. Null when cleared.

  - `PhoneNumber string`

    Phone number in E.164 format

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/linq-team/linq-go"
  "github.com/linq-team/linq-go/option"
)

func main() {
  client := linqgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  phoneNumber, err := client.PhoneNumbers.Update(
    context.TODO(),
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    linqgo.PhoneNumberUpdateParams{
      ForwardingNumber: linqgo.String("+12025559999"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", phoneNumber.ID)
}
```

#### Response

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "phone_number": "+12025551234",
  "forwarding_number": "+12025559999"
}
```
