> 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.

# Get an IP firewall profile

GET https://cdn.emnify.net/api/v1/ip_firewall_profile/{ip_firewall_profile_id}

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

`IpFirewallProfile` + `Get`

*Roles:* Administrator

Returns a single IP firewall profile by ID, including the full profile rule content, file name, and a list of attached service profiles.

Reference: https://docs.emnify.com/developers/api/ip-firewall-profile/ip-firewall-profile-get-by-id

## 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

## Response

### 200

IP firewall profile successfully retrieved.

- `id` (integer, optional) — Unique identifier of the IP firewall profile.
- `name` (string, optional) — Name of the IP firewall profile.
- `description` (string, optional) — Description of the IP firewall profile.
- `created` (string, optional) — Timestamp when the profile was created.
- `last_updated` (string, optional) — Timestamp when the profile was last modified.
- `last_uploaded` (string, optional) — Timestamp when the profile rules were last uploaded.
- `profile` (string, optional) — Firewall rules in line-oriented text format, one rule per line.
- `profile_file_name` (string, optional)
- `attached_service_profiles` (list of ApiV1IpFirewallProfileIpFirewallProfileIdGetResponsesContentApplicationJsonSchemaAttachedServiceProfilesItems, optional)

## Errors

### 401 Unauthorized Error

Missing or invalid Authorization header.

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

### 403 Forbidden Error

User doesn't have permission to get 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 ApiV1IpFirewallProfileIpFirewallProfileIdGetResponsesContentApplicationJsonSchemaErrorsItems, 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 ApiV1IpFirewallProfileIpFirewallProfileIdGetResponsesContentApplicationJsonSchemaErrorsItems, optional) — sub error descriptions

### 422 Unprocessable Entity Error

Unprocessable entity.

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

## Types

### ApiV1IpFirewallProfileIpFirewallProfileIdGetResponsesContentApplicationJsonSchemaAttachedServiceProfilesItems

- `id` (integer, optional)
- `name` (string, optional)

### ApiV1IpFirewallProfileIpFirewallProfileIdGetResponsesContentApplicationJsonSchemaErrorsItems

## Examples

**Response**

```json
{
  "id": 15,
  "name": "my rule profile",
  "description": "my perfect ip firewall rule profile",
  "created": "2026-03-09T09:02:20Z",
  "last_updated": "2026-03-09T09:02:20Z",
  "last_uploaded": "2026-03-09T09:02:20Z",
  "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": "example-profile.txt",
  "attached_service_profiles": [
    {
      "id": 1,
      "name": "example service profile 1"
    },
    {
      "id": 2,
      "name": "example service profile 2"
    }
  ],
  "attached_device_count": 50,
  "attached_service_profile_count": 15
}
```

**SDK Code**

```python IP Firewall Profile
import requests

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

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

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

print(response.json())
```

```javascript IP Firewall Profile
const url = 'https://cdn.emnify.net/api/v1/ip_firewall_profile/1.1';
const options = {method: 'GET', 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
package main

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

func main() {

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

	req, _ := http.NewRequest("GET", 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
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::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp IP Firewall Profile
using RestSharp;

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

```swift IP Firewall Profile
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 = "GET"
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()
```