> This page is for Developers.

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

# Update a custom event

PATCH https://cdn.emnify.net/api/v1/event/custom/configuration/{custom_event_id}
Content-Type: application/json

Updates the name or the post filters of a custom event.
Send only the fields you want to change, and the others keep their values.
To remove all post filters, send an empty `post_filter_properties` array.
A request with neither field returns the custom event unchanged.

Each post filter property must be one that the custom event's template lists in `post_filter_properties`.


Reference: https://docs.emnify.com/developers/api/custom-events/patch-custom-event

## Authentication

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

## Request

### Path parameters

- `custom_event_id` (string, required)

### Body (application/json)

This endpoint expects a CustomEventPatchDto.

- `post_filter_properties` (list of ConfigurationInputPropertiesDto, optional) — Device targeting of this custom event, from the template's `post_filter_properties`. Replaces the existing post filters. Each coverage policy, service profile, and tag ID must belong to your organization.
- `name` (string, optional)

## Response

### 200

- `organisation` (WithIdInputDto, required)
- `template` (WithUuidInputDto, required)
- `configuration_properties` (list of ConfigurationInputPropertiesDto, required)
- `id` (string, required)
- `description` (string, required) — The template's description, or an empty string if the template is turned off.
- `translation_key_name` (string, required) — Portal translation key of the template's name, or an empty string if the template is turned off.
- `translation_key_description` (string, required) — Portal translation key of the template's description, or an empty string if the template is turned off.
- `supported_targeting_parameters` (list of SupportedTargetingParametersDto, required)
- `name` (string, optional)
- `post_filter_properties` (list of ConfigurationInputPropertiesDto, optional) — Device targeting of this custom event, from the template's `post_filter_properties`.
- `supported_action_ids` (list of string, optional) — Action IDs this event declares support for, used to decide which actions are offered for it. - Field absent: no restriction is declared, so every action whose `required_event_output_parameters` the event emits is offered. - Empty array: a declaration in its own right, so no actions are offered. - Non-empty list: intersected with the parameter check, so a listed action is offered only if the event also emits every parameter that action requires. The list can only narrow what's offered, never widen it.

## Errors

### 400 Bad Request Error

The request body is invalid, a post filter property isn't one that the custom event's template lists, or a post filter value fails the template's validators.

- `status_code` (integer, required) — HTTP status code of the response
- `message` (ErrorResponseMessage, required) — A human-readable reason for the error. Request-body validation failures list one entry per violated constraint.

### 403 Forbidden Error

You don't have permission to update custom events.

- `status_code` (integer, required) — HTTP status code of the response
- `message` (ErrorResponseMessage, required) — A human-readable reason for the error. Request-body validation failures list one entry per violated constraint.

### 404 Not Found Error

The custom event doesn't exist or isn't available to your organization, or a coverage policy, service profile, or tag ID in `post_filter_properties` doesn't belong to your organization.

- `status_code` (integer, required) — HTTP status code of the response
- `message` (ErrorResponseMessage, required) — A human-readable reason for the error. Request-body validation failures list one entry per violated constraint.

## Types

### ConfigurationInputPropertiesDto

- `property` (string, required)
- `value_array` (list of ConfigurationInputPropertiesDtoValueArrayItems, required) — The value, always as an array. ID arrays such as `tag_id[]` take numbers only. The `number`, `minute`, and `percentage` types also accept a numeric string, but `megabytes` and `severity` don't.

### WithIdInputDto

- `id` (double, required)

### WithUuidInputDto

- `id` (string, required)

### SupportedTargetingParametersDto

- `parameter` (string, required)
- `type` (enum, required)
  - Allowed values: `string`, `string[]`, `number`, `number[]`, `boolean`, `boolean[]`, `email`, `email[]`, `severity`, `percentage`, `megabytes`, `megabytes[]`, `tariff_id`, `tariff_id[]`, `ratezone`, `ratezone[]`, `service_profile_id`, `service_profile_id[]`, `tariff_profile_id`, `tariff_profile_id[]`, `tag_id`, `tag_id[]`, `recurrence`, `time`, `date`, `minute`, `pdp_connection_result`
- `description` (string, required)
- `validators` (list of ValidatorDto, optional)

### ErrorResponseMessage

A human-readable reason for the error. Request-body validation failures list one entry per violated constraint.

- string
- list of string

### ConfigurationInputPropertiesDtoValueArrayItems

- string
- double

### ValidatorDto

- `validator_type` (enum, required)
  - Allowed values: `maxCount`, `minCount`, `min`, `max`, `minLength`, `maxLength`, `uniqueItems`
- `validator_value` (string, required)

## Examples

### Rename and filter by coverage policy

**Request**

```json
{
  "post_filter_properties": [
    {
      "property": "endpoint.tariff_profile_id",
      "value_array": [
        12,
        56
      ]
    }
  ],
  "name": "More than 10 reconnects within an hour, two coverage policies"
}
```

**Response**

```json
{
  "organisation": {
    "id": 200
  },
  "template": {
    "id": "device-keeps-reconnecting-v1"
  },
  "configuration_properties": [
    {
      "property": "pdp_limit",
      "value_array": [
        10
      ]
    },
    {
      "property": "duration_minutes",
      "value_array": [
        60
      ]
    },
    {
      "property": "pdp_connection_result",
      "value_array": [
        "all"
      ]
    },
    {
      "property": "severity",
      "value_array": [
        1
      ]
    }
  ],
  "id": "01a1cf00-b153-743f-8b43-149b64e3da58",
  "description": "This event is triggered when a device reconnects more times than you set. You choose whether successful reconnects, rejected ones or both count.",
  "translation_key_name": "automations_rule_event_name_device_keeps_reconnecting",
  "translation_key_description": "automations_rule_event_description_device_keeps_reconnecting",
  "supported_targeting_parameters": [],
  "name": "More than 10 reconnects within an hour, two coverage policies",
  "post_filter_properties": [
    {
      "property": "endpoint.tariff_profile_id",
      "value_array": [
        12,
        56
      ]
    }
  ],
  "supported_action_ids": [
    "add_tags_to_device",
    "block_network_of_device",
    "remove_tags_from_device",
    "reset_device_data_session",
    "send_notification_with_email",
    "send_sms_to_device"
  ]
}
```

**SDK Code**

```python Rename and filter by coverage policy
import requests

url = "https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id"

payload = {
    "post_filter_properties": [
        {
            "property": "endpoint.tariff_profile_id",
            "value_array": [12, 56]
        }
    ],
    "name": "More than 10 reconnects within an hour, two coverage policies"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Rename and filter by coverage policy
const url = 'https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"post_filter_properties":[{"property":"endpoint.tariff_profile_id","value_array":[12,56]}],"name":"More than 10 reconnects within an hour, two coverage policies"}'
};

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

```go Rename and filter by coverage policy
package main

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

func main() {

	url := "https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id"

	payload := strings.NewReader("{\n  \"post_filter_properties\": [\n    {\n      \"property\": \"endpoint.tariff_profile_id\",\n      \"value_array\": [\n        12,\n        56\n      ]\n    }\n  ],\n  \"name\": \"More than 10 reconnects within an hour, two coverage policies\"\n}")

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

	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 Rename and filter by coverage policy
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"post_filter_properties\": [\n    {\n      \"property\": \"endpoint.tariff_profile_id\",\n      \"value_array\": [\n        12,\n        56\n      ]\n    }\n  ],\n  \"name\": \"More than 10 reconnects within an hour, two coverage policies\"\n}"

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

```java Rename and filter by coverage policy
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"post_filter_properties\": [\n    {\n      \"property\": \"endpoint.tariff_profile_id\",\n      \"value_array\": [\n        12,\n        56\n      ]\n    }\n  ],\n  \"name\": \"More than 10 reconnects within an hour, two coverage policies\"\n}")
  .asString();
```

```php Rename and filter by coverage policy
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id', [
  'body' => '{
  "post_filter_properties": [
    {
      "property": "endpoint.tariff_profile_id",
      "value_array": [
        12,
        56
      ]
    }
  ],
  "name": "More than 10 reconnects within an hour, two coverage policies"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Rename and filter by coverage policy
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"post_filter_properties\": [\n    {\n      \"property\": \"endpoint.tariff_profile_id\",\n      \"value_array\": [\n        12,\n        56\n      ]\n    }\n  ],\n  \"name\": \"More than 10 reconnects within an hour, two coverage policies\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Rename and filter by coverage policy
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "post_filter_properties": [
    [
      "property": "endpoint.tariff_profile_id",
      "value_array": [12, 56]
    ]
  ],
  "name": "More than 10 reconnects within an hour, two coverage policies"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Remove all post filters

**Request**

```json
{
  "post_filter_properties": []
}
```

**Response**

```json
{
  "organisation": {
    "id": 200
  },
  "template": {
    "id": "device-keeps-reconnecting-v1"
  },
  "configuration_properties": [
    {
      "property": "pdp_limit",
      "value_array": [
        10
      ]
    },
    {
      "property": "duration_minutes",
      "value_array": [
        60
      ]
    },
    {
      "property": "pdp_connection_result",
      "value_array": [
        "all"
      ]
    },
    {
      "property": "severity",
      "value_array": [
        1
      ]
    }
  ],
  "id": "01a1cf00-b153-743f-8b43-149b64e3da58",
  "description": "This event is triggered when a device reconnects more times than you set. You choose whether successful reconnects, rejected ones or both count.",
  "translation_key_name": "automations_rule_event_name_device_keeps_reconnecting",
  "translation_key_description": "automations_rule_event_description_device_keeps_reconnecting",
  "supported_targeting_parameters": [],
  "name": "More than 10 reconnects within an hour",
  "post_filter_properties": [],
  "supported_action_ids": [
    "add_tags_to_device",
    "block_network_of_device",
    "remove_tags_from_device",
    "reset_device_data_session",
    "send_notification_with_email",
    "send_sms_to_device"
  ]
}
```

**SDK Code**

```python Remove all post filters
import requests

url = "https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id"

payload = { "post_filter_properties": [] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Remove all post filters
const url = 'https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"post_filter_properties":[]}'
};

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

```go Remove all post filters
package main

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

func main() {

	url := "https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id"

	payload := strings.NewReader("{\n  \"post_filter_properties\": []\n}")

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

	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 Remove all post filters
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"post_filter_properties\": []\n}"

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

```java Remove all post filters
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"post_filter_properties\": []\n}")
  .asString();
```

```php Remove all post filters
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id', [
  'body' => '{
  "post_filter_properties": []
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Remove all post filters
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"post_filter_properties\": []\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove all post filters
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["post_filter_properties": []] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/event/custom/configuration/custom_event_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```