# Update Contact Property

> PATCH /contact-properties/:id — update an existing contact property.

`PATCH /contact-properties/:id`

Update an existing contact property.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `contact_property_id` | string | Yes | The Contact Property ID. |

> **Note:** The `key` and `type` fields cannot be changed after creation. This preserves data integrity for existing contact values.

**Body parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `fallback_value` | string | number | No | The default value to use when the property is not set for a contact. Must match the type of the property. |

**Node.js**

```js
import { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

const { data, error } = await mb.contactProperties.update('b6d24b8e-af0b-4c3c-be0c-359bbd97381e', {
  "fallback_value": "Example Company"
});
console.log({ data, error });
```

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::ContactProperties.update("b6d24b8e-af0b-4c3c-be0c-359bbd97381e", {
  "fallback_value": "Example Company"
})
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

$sendping->contactProperties->update('b6d24b8e-af0b-4c3c-be0c-359bbd97381e', [
  'fallback_value' => "Example Company"
]);
```

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

sendping.ContactProperties.update("b6d24b8e-af0b-4c3c-be0c-359bbd97381e", {
  "fallback_value": "Example Company"
})
```

**Go**

```go
import "github.com/shekhu10/sendping-sdks/sendping-go"

client := sendping.NewClient("mb_xxxxxxxxx")

property, err := client.ContactProperties.Update("b6d24b8e-af0b-4c3c-be0c-359bbd97381e", &sendping.UpdateContactPropertyRequest{
    FallbackValue: "Example Company",
})
```

**Rust**

```rust
use sendping::{SendPing, UpdateContactPropertyOptions};

let mb = SendPing::new("mb_xxxxxxxxx");

let params = UpdateContactPropertyOptions::new()
    .with_fallback_value(serde_json::json!("Example Company"));
let _property = mb.contact_properties.update("b6d24b8e-af0b-4c3c-be0c-359bbd97381e", params).await?;
```

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.contactProperties().update(
        "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
        "Example Company");
```

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

var resp = await sendping.ContactPropertyUpdateAsync(
    "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
    "Example Company");
```

**cURL**

```bash
curl -X PATCH 'https://www.sendping.co/api/contact-properties/b6d24b8e-af0b-4c3c-be0c-359bbd97381e' \
  -H 'Authorization: Bearer mb_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "fallback_value": "Example Company"
}'
```

**CLI**

```bash
sendping contact-properties update b6d24b8e-af0b-4c3c-be0c-359bbd97381e \
  --fallback-value 'Example Company'
```

### Response

```json
{
  "object": "contact_property",
  "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
}
```
