> 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 an IP firewall profile

PATCH https://cdn.emnify.net/api/v1/ip_firewall_profile/{ip_firewall_profile_id}
Content-Type: application/json

**Required permissions** Beta [Learn more](/developers/api-guidelines/permissions#how-permissions-work)

`IpFirewallProfile` + `Update`

*Roles:* Administrator

Updates an existing IP firewall profile by ID.

If `profile` is provided, it is validated before update.
Rules use a line-oriented text format: `<ACTION> <PROTOCOL> <DIRECTION> <ADDRESS...> [PORTS:...] [# COMMENT]`.
Only rules with `OUT` are enforced.

Use the `dry_run` query parameter to validate the profile without persisting changes.

Reference: https://docs.emnify.com/developers/api/ip-firewall-profile/ip-firewall-profile-update

## Authentication

- `Authorization` header (bearer token, required) — An `auth_token` should be provided to authenticate a session. To obtain an `auth_token`, see the [`/api/v1/authenticate` **POST** request](/developers/api/authentication/authenticate).

## Request

### Path parameters

- `ip_firewall_profile_id` (double, required) — The IP firewall profile ID

### Query parameters

- `dry_run` (boolean, optional, default: false) — When set to `true`, validates the profile rules without persisting changes. Returns validation results only.

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional)
- `description` (string, optional)
- `profile` (string, optional) — Full rules text; validated on every update request.
- `profile_file_name` (string, optional)

## Response

### 200

IP firewall profile successfully updated.

- `IP Firewall Profile_IPFirewallProfileUpdate_Response_200`
  - PatchIPFirewallProfileResponse: PatchIPFirewallProfileResponse
  - PatchIPFirewallProfileDryRunResponse: PatchIPFirewallProfileDryRunResponse

## Errors

### 400 Bad Request Error

Invalid payload. See HTTP response body for details.

- `IPFirewallProfileUpdateRequestBadRequestError`
  - UpdateIPFirewallProfileError: UpdateIPFirewallProfileError
  - UpdateIPFirewallProfileValidationFailed: UpdateIPFirewallProfileValidationFailed

### 401 Unauthorized Error

Missing or invalid Authorization header.

- `error_code` (integer, optional)
- `error_token` (string, optional)
- `message` (string, optional)
- `errors` (list of ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaErrorsItems, optional) — sub error descriptions

### 403 Forbidden Error

User doesn't have permission to update IP firewall profiles, or the organization doesn't subscribe to the IP firewall.

- `error_token` (string, required)
- `message` (string, required)
- `error_code` (integer, optional)
- `errors` (list of ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaErrorsItems, optional) — sub error descriptions

### 404 Not Found Error

IP firewall profile not found.

- `error_token` (string, required)
- `message` (string, required)
- `error_code` (integer, optional)
- `errors` (list of ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaErrorsItems, optional) — sub error descriptions

### 422 Unprocessable Entity Error

The profile ID or the request fields are invalid. `name` can have up to 50 characters, `description` up to 200, and `profile_file_name` up to 50, and `profile_file_name` must end in `.txt`.

- `IPFirewallProfileUpdateRequestUnprocessableEntityError`
  - UpdateIPFirewallProfileError: UpdateIPFirewallProfileError
  - UpdateIPFirewallProfileInvalidFields: UpdateIPFirewallProfileInvalidFields

## Types

### PatchIPFirewallProfileResponse

Successful save

- `id` (integer, optional)
- `name` (string, optional)
- `description` (string, optional)
- `created` (string, optional)
- `last_updated` (string, optional)
- `last_uploaded` (string, optional)
- `profile` (string, optional)
- `profile_file_name` (string, optional)
- `validation_issues` (ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf0ValidationIssues, optional)

### PatchIPFirewallProfileDryRunResponse

dry_run=true and validation succeeded

- `validation_issues` (ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf1ValidationIssues, required)

### UpdateIPFirewallProfileError

- `error_code` (integer, optional)
- `error_token` (string, optional)
- `message` (string, optional)
- `errors` (list of ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf0ErrorsItems, optional) — sub error descriptions

### UpdateIPFirewallProfileValidationFailed

- `validation_issues` (ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf1ValidationIssues, required)

### ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaErrorsItems

### UpdateIPFirewallProfileError

- `error_token` (string, required)
- `message` (string, required)
- `error_code` (integer, optional)
- `errors` (list of ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf0ErrorsItems, optional) — sub error descriptions

### UpdateIPFirewallProfileInvalidFields

- `validation_issues` (ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf1ValidationIssues, optional)

### ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf0ValidationIssues

- `valid` (boolean, optional)
- `message` (string, optional)
- `errors` (list of ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf0ValidationIssuesErrorsItems, optional)
- `warnings` (list of ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf0ValidationIssuesWarningsItems, optional)

### ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf1ValidationIssues

- `valid` (boolean, optional)
- `message` (string, optional)

### ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf0ErrorsItems

### ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf0ValidationIssuesErrorsItems

- `linenumber` (integer, optional)
- `field` (string, optional)
- `code` (string, optional)
- `msg` (string, optional)
- `params` (map from string to any, optional)

### ApiV1IpFirewallProfileIpFirewallProfileIdPatchResponsesContentApplicationJsonSchemaOneOf0ValidationIssuesWarningsItems

- `linenumber` (integer, optional)
- `field` (string, optional)
- `code` (string, optional)
- `msg` (string, optional)
- `params` (map from string to any, optional)

## Examples

### IP Firewall Profile Updated

**Response**

```json
{
  "created": "2026-03-09T09:02:20Z",
  "description": "my perfect ip firewall rule profile",
  "id": 1234,
  "last_updated": "2026-03-09T09:02:20Z",
  "last_uploaded": "2026-03-09T09:02:20Z",
  "name": "my rule profile",
  "profile": "ALLOW UDP OUT IP:8.8.8.8 IP:8.8.4.4 PORTS:53\nALLOW TCP OUT IP:203.0.113.10 PORTS:8883\nALLOW TCP OUT CIDR:52.95.0.0/16 PORTS:443\n",
  "profile_file_name": "my_rules.txt",
  "validation_issues": {
    "errors": [],
    "valid": true,
    "warnings": []
  }
}
```

**SDK Code**

```python IP Firewall Profile Updated
import requests

url = "https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript IP Firewall Profile Updated
const url = 'https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1';
const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};

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

```go IP Firewall Profile Updated
package main

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

func main() {

	url := "https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby IP Firewall Profile Updated
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java IP Firewall Profile Updated
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php IP Firewall Profile Updated
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp IP Firewall Profile Updated
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift IP Firewall Profile Updated
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers

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()
```

### Dry run validation only

**Response**

```json
{
  "validation_issues": {
    "errors": [],
    "valid": true,
    "warnings": []
  }
}
```

**SDK Code**

```python Dry run validation only
import requests

url = "https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript Dry run validation only
const url = 'https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1';
const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};

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

```go Dry run validation only
package main

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

func main() {

	url := "https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby Dry run validation only
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Dry run validation only
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Dry run validation only
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Dry run validation only
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Dry run validation only
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers

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()
```

### Partial update (name only)

**Request**

```json
{
  "name": "renamed-profile"
}
```

**Response**

```json
{
  "created": "2026-03-09T09:02:20Z",
  "description": "my perfect ip firewall rule profile",
  "id": 1234,
  "last_updated": "2026-03-09T09:02:20Z",
  "last_uploaded": "2026-03-09T09:02:20Z",
  "name": "my rule profile",
  "profile": "ALLOW UDP OUT IP:8.8.8.8 IP:8.8.4.4 PORTS:53\nALLOW TCP OUT IP:203.0.113.10 PORTS:8883\nALLOW TCP OUT CIDR:52.95.0.0/16 PORTS:443\n",
  "profile_file_name": "my_rules.txt",
  "validation_issues": {
    "errors": [],
    "valid": true,
    "warnings": []
  }
}
```

**SDK Code**

```python Partial update (name only)
import requests

url = "https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1"

payload = { "name": "renamed-profile" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Partial update (name only)
const url = 'https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"renamed-profile"}'
};

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

```go Partial update (name only)
package main

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

func main() {

	url := "https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1"

	payload := strings.NewReader("{\n  \"name\": \"renamed-profile\"\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 Partial update (name only)
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1")

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  \"name\": \"renamed-profile\"\n}"

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

```java Partial update (name only)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"renamed-profile\"\n}")
  .asString();
```

```php Partial update (name only)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1', [
  'body' => '{
  "name": "renamed-profile"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Partial update (name only)
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"renamed-profile\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Partial update (name only)
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1")! 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()
```

### Validate new rules without saving (use with query dry_run=true)

**Request**

```json
{
  "profile": "ALLOW UDP OUT IP:8.8.8.8 IP:8.8.4.4 PORTS:53\nALLOW TCP OUT IP:203.0.113.10 PORTS:8883\nALLOW TCP OUT CIDR:52.95.0.0/16 PORTS:443\n"
}
```

**Response**

```json
{
  "created": "2026-03-09T09:02:20Z",
  "description": "my perfect ip firewall rule profile",
  "id": 1234,
  "last_updated": "2026-03-09T09:02:20Z",
  "last_uploaded": "2026-03-09T09:02:20Z",
  "name": "my rule profile",
  "profile": "ALLOW UDP OUT IP:8.8.8.8 IP:8.8.4.4 PORTS:53\nALLOW TCP OUT IP:203.0.113.10 PORTS:8883\nALLOW TCP OUT CIDR:52.95.0.0/16 PORTS:443\n",
  "profile_file_name": "my_rules.txt",
  "validation_issues": {
    "errors": [],
    "valid": true,
    "warnings": []
  }
}
```

**SDK Code**

```python Validate new rules without saving (use with query dry_run=true)
import requests

url = "https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1"

payload = { "profile": "ALLOW UDP OUT IP:8.8.8.8 IP:8.8.4.4 PORTS:53
ALLOW TCP OUT IP:203.0.113.10 PORTS:8883
ALLOW TCP OUT CIDR:52.95.0.0/16 PORTS:443
" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Validate new rules without saving (use with query dry_run=true)
const url = 'https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"profile":"ALLOW UDP OUT IP:8.8.8.8 IP:8.8.4.4 PORTS:53\nALLOW TCP OUT IP:203.0.113.10 PORTS:8883\nALLOW TCP OUT CIDR:52.95.0.0/16 PORTS:443\n"}'
};

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

```go Validate new rules without saving (use with query dry_run=true)
package main

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

func main() {

	url := "https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1"

	payload := strings.NewReader("{\n  \"profile\": \"ALLOW UDP OUT IP:8.8.8.8 IP:8.8.4.4 PORTS:53\\nALLOW TCP OUT IP:203.0.113.10 PORTS:8883\\nALLOW TCP OUT CIDR:52.95.0.0/16 PORTS:443\\n\"\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 Validate new rules without saving (use with query dry_run=true)
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1")

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  \"profile\": \"ALLOW UDP OUT IP:8.8.8.8 IP:8.8.4.4 PORTS:53\\nALLOW TCP OUT IP:203.0.113.10 PORTS:8883\\nALLOW TCP OUT CIDR:52.95.0.0/16 PORTS:443\\n\"\n}"

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

```java Validate new rules without saving (use with query dry_run=true)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"profile\": \"ALLOW UDP OUT IP:8.8.8.8 IP:8.8.4.4 PORTS:53\\nALLOW TCP OUT IP:203.0.113.10 PORTS:8883\\nALLOW TCP OUT CIDR:52.95.0.0/16 PORTS:443\\n\"\n}")
  .asString();
```

```php Validate new rules without saving (use with query dry_run=true)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1', [
  'body' => '{
  "profile": "ALLOW UDP OUT IP:8.8.8.8 IP:8.8.4.4 PORTS:53\\nALLOW TCP OUT IP:203.0.113.10 PORTS:8883\\nALLOW TCP OUT CIDR:52.95.0.0/16 PORTS:443\\n"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Validate new rules without saving (use with query dry_run=true)
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"profile\": \"ALLOW UDP OUT IP:8.8.8.8 IP:8.8.4.4 PORTS:53\\nALLOW TCP OUT IP:203.0.113.10 PORTS:8883\\nALLOW TCP OUT CIDR:52.95.0.0/16 PORTS:443\\n\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Validate new rules without saving (use with query dry_run=true)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["profile": "ALLOW UDP OUT IP:8.8.8.8 IP:8.8.4.4 PORTS:53
ALLOW TCP OUT IP:203.0.113.10 PORTS:8883
ALLOW TCP OUT CIDR:52.95.0.0/16 PORTS:443
"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1")! 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()
```