> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.hive.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.hive.co/_mcp/server.

# Update custom event property

PUT https://api.hive.co/v2/events/custom-properties/{property_id}/
Content-Type: application/json

Full replacement — send both fields even when only one changes. A property's `value_type` is locked once any event has a value for it.

Reference: https://developers.hive.co/api-reference/hive-api/custom-event-properties/events-custom-properties-update

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `property_id` (integer, required)

### Headers

- `X-Partner-Id` (string, required) — Your OAuth application client ID.

### Body (application/json)

This endpoint expects a CustomEventPropertyWriteRequest.

- `name` (string, required)
- `value_type` (enum, required) — Declared value type of a CustomEventProperty. Lowercase because these values travel through the public API (`value_type` on the custom-properties routes).
  - Allowed values: `text`, `number`

## Response

### 200

- `id` (integer, required)
- `name` (string, required)
- `value_type` (string, required)
- `created_at` (datetime, required)
- `value_count` (integer, required)

## Errors

### 404 Not Found Error

Custom event property not found.

- `errors` (list of string, required)

### 409 Conflict Error

The name is taken, or the property has values so its type is locked.

- `errors` (list of string, required)

### 422 Unprocessable Entity Error

Validation failed. For a batch write this is all-or-nothing. Field errors are keyed by resource name, then item index, then field path, query-parameter errors are keyed by parameter name, service-level rejections use a flat `errors` list.

- `map from string to any`

## Examples

**Request**

```json
{
  "name": "string",
  "value_type": "text"
}
```

**Response**

```json
{
  "id": 1,
  "name": "string",
  "value_type": "string",
  "created_at": "2024-01-15T09:30:00Z",
  "value_count": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.hive.co/v2/events/custom-properties/1/"

payload = {
    "name": "string",
    "value_type": "text"
}
headers = {
    "X-Partner-Id": "X-Partner-Id",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.hive.co/v2/events/custom-properties/1/';
const options = {
  method: 'PUT',
  headers: {
    'X-Partner-Id': 'X-Partner-Id',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"name":"string","value_type":"text"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.hive.co/v2/events/custom-properties/1/"

	payload := strings.NewReader("{\n  \"name\": \"string\",\n  \"value_type\": \"text\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("X-Partner-Id", "X-Partner-Id")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.hive.co/v2/events/custom-properties/1/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-Partner-Id"] = 'X-Partner-Id'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"string\",\n  \"value_type\": \"text\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.hive.co/v2/events/custom-properties/1/")
  .header("X-Partner-Id", "X-Partner-Id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"string\",\n  \"value_type\": \"text\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.hive.co/v2/events/custom-properties/1/', [
  'body' => '{
  "name": "string",
  "value_type": "text"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'X-Partner-Id' => 'X-Partner-Id',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.hive.co/v2/events/custom-properties/1/");
var request = new RestRequest(Method.PUT);
request.AddHeader("X-Partner-Id", "X-Partner-Id");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"string\",\n  \"value_type\": \"text\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Partner-Id": "X-Partner-Id",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "string",
  "value_type": "text"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hive.co/v2/events/custom-properties/1/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```