Skip to content

Create group

POST/firewall-groups

Firewall Management API · Firewall Groups

Create firewall group.

Required permissionfwcm.firewall.group:write

Parameters

Name In Type Required Description
X-Tenant-ID header string (uuid) Yes Tenant ID.

Request body

Content type: application/json

Request body fields

namestringrequired
Group name.
Must be 3–40 characters long.
configImportSourceFirewallIdstring (uuid)
ID for the firewall you're importing configuration settings from.
assignFirewallsarray of string (uuid)required
IDs for the firewalls you're adding to the group.
Each item must be at least 1 character long.
parentGroupIdstring (uuid)
Parent group ID, if your new group is a child group.

Request samples

curl -X POST "https://api-<data-region>.central.sophos.com/firewall/v1/firewall-groups" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>" -H "Content-Type: application/json" -d "{
  \"name\": \"Test group\",
  \"configImportSourceFirewallId\": \"df1f8ccf-1223-46ed-9042-6672a8326b8c\",
  \"assignFirewalls\": [
    \"df1f8ccf-1223-46ed-9042-6672a8326b8c\",
    \"97483e58-55d7-44fb-b03f-9422f106ef66\",
    \"7e5605c1-da16-4995-9679-767a8b79328d\"
  ],
  \"parentGroupId\": \"ab1f8ccf-1223-46ed-9042-6672a8326b8c\"
}"

import requests

response = requests.post(
    "https://api-<data-region>.central.sophos.com/firewall/v1/firewall-groups",
    headers={
        "Authorization": "Bearer <access-token>",
        "X-Tenant-ID": "<tenant-id>",
        "Content-Type": "application/json",
    },
    json={   'name': 'Test group',
    'configImportSourceFirewallId': 'df1f8ccf-1223-46ed-9042-6672a8326b8c',
    'assignFirewalls': [   'df1f8ccf-1223-46ed-9042-6672a8326b8c',
                           '97483e58-55d7-44fb-b03f-9422f106ef66',
                           '7e5605c1-da16-4995-9679-767a8b79328d'],
    'parentGroupId': 'ab1f8ccf-1223-46ed-9042-6672a8326b8c'},
)
print(response.json())

$headers = @{
    "Authorization" = "Bearer <access-token>"
    "X-Tenant-ID" = "<tenant-id>"
    "Content-Type" = "application/json"
}
$body = '{
  "name": "Test group",
  "configImportSourceFirewallId": "df1f8ccf-1223-46ed-9042-6672a8326b8c",
  "assignFirewalls": [
    "df1f8ccf-1223-46ed-9042-6672a8326b8c",
    "97483e58-55d7-44fb-b03f-9422f106ef66",
    "7e5605c1-da16-4995-9679-767a8b79328d"
  ],
  "parentGroupId": "ab1f8ccf-1223-46ed-9042-6672a8326b8c"
}'
Invoke-RestMethod -Method POST -Uri "https://api-<data-region>.central.sophos.com/firewall/v1/firewall-groups" -Headers $headers -Body $body -ContentType "application/json"

package main

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

func main() {
    req, err := http.NewRequest("POST", "https://api-<data-region>.central.sophos.com/firewall/v1/firewall-groups", strings.NewReader(`{
  "name": "Test group",
  "configImportSourceFirewallId": "df1f8ccf-1223-46ed-9042-6672a8326b8c",
  "assignFirewalls": [
    "df1f8ccf-1223-46ed-9042-6672a8326b8c",
    "97483e58-55d7-44fb-b03f-9422f106ef66",
    "7e5605c1-da16-4995-9679-767a8b79328d"
  ],
  "parentGroupId": "ab1f8ccf-1223-46ed-9042-6672a8326b8c"
}`))
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer <access-token>")
    req.Header.Set("X-Tenant-ID", "<tenant-id>")
    req.Header.Set("Content-Type", "application/json")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}

const response = await fetch("https://api-<data-region>.central.sophos.com/firewall/v1/firewall-groups", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <access-token>",
    "X-Tenant-ID": "<tenant-id>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "name": "Test group",
  "configImportSourceFirewallId": "df1f8ccf-1223-46ed-9042-6672a8326b8c",
  "assignFirewalls": [
    "df1f8ccf-1223-46ed-9042-6672a8326b8c",
    "97483e58-55d7-44fb-b03f-9422f106ef66",
    "7e5605c1-da16-4995-9679-767a8b79328d"
  ],
  "parentGroupId": "ab1f8ccf-1223-46ed-9042-6672a8326b8c"
}),
});
const data = await response.json();
console.log(data);

Responses

201 — Group created successfully.

Response fields

idstring (uuid)required
Group ID.
namestringrequired
Group name.
Must be 3–40 characters long.
parentGroupobject
Group ID.
Show child attributesHide child attributes
idstring (uuid)required
Group ID.
namestring
Group name.
Must be 1–250 characters long.
tenantobjectrequired
Tenant ID.
Show child attributesHide child attributes
idstring (uuid)required
Tenant ID.
lockedByManagingAccountbooleanrequired
Shows if the group is locked by managing account.
firewallsobjectrequired
Associated firewall IDs.
Show child attributesHide child attributes
totalintegerrequired
Number of firewalls in this firewall group.
itemsCountintegerrequired
Number of list items.
itemsarray of objectrequired
Items must be unique.
Firewall ID.
Show child attributesHide child attributes
idstring (uuid)required
Firewall ID.
configImportobject
Firewall group configuration import status.
Show child attributesHide child attributes
sourceFirewallobjectrequired
Firewall ID.
Show child attributesHide child attributes
idstring (uuid)required
Firewall ID.
percentCompleteintegerrequired
Group creation progress (percentage).
Must be ≥ 0 and ≤ 100.
statusstring (enum)required
Configuration import status.
Must be one of: success, initializing, initializingFailed, initializingFailedExport, uploaded, uploadFailed, downloadFailed, processing, failed.
errorsarray of object
Configuration import errors.
Show child attributesHide child attributes
entityNamestring (string)required
subEntityNamestring (string)
messagesarray of objectrequired
Error messages.
Show child attributesHide child attributes
codestring
Error code.
messagestring
Error message.
createdByobjectrequired
Show child attributesHide child attributes
idstring
Principal email or client ID.
typestring (enum)
Principal type.
Must be one of: user, service.
namestring
User principal name.
accountTypestringrequired
Account type.
Must be one of: partner, tenant.
accountIdstring (uuid)required
Account ID.
createdAtstring (date-time)required
updatedByobject
Show child attributesHide child attributes
idstring
Principal email or client ID.
typestring (enum)
Principal type.
Must be one of: user, service.
namestring
User principal name.
accountTypestringrequired
Account type.
Must be one of: partner, tenant.
accountIdstring (uuid)required
Account ID.
updatedAtstring (date-time)

Errors

Status Meaning
400 Bad request.
401 Authentication required.
403 Authorization required.
404 Resource not found.
500 Unexpected error.

All error responses share the same shape — see the error response object.

Response examples

201

{
  "id": "b88df1aa-1fc2-472b-983d-d77f5c96e525",
  "name": "Test Group",
  "parentGroup": {
    "id": "ab1f8ccf-1223-46ed-9042-6672a8326b8c"
  },
  "tenant": {
    "id": "127194e4-2338-4179-9709-946b36cd75ca"
  },
  "lockedByManagingAccount": false,
  "firewalls": {
    "total": 3,
    "itemsCount": 3,
    "items": [
      {
        "id": "df1f8ccf-1223-46ed-9042-6672a8326b8c"
      },
      {
        "id": "97483e58-55d7-44fb-b03f-9422f106ef66"
      },
      {
        "id": "7e5605c1-da16-4995-9679-767a8b79328d"
      }
    ]
  },
  "configImport": {
    "sourceFirewall": {
      "id": "df1f8ccf-1223-46ed-9042-6672a8326b8c"
    },
    "percentComplete": 0,
    "status": "initializing"
  },
  "createdBy": {
    "id": "97483e58-55d7-44fb-b03f-9422f106ef66",
    "type": "user",
    "name": "example",
    "accountId": "97483e58-55d7-44fb-b03f-9422f106ef66",
    "accountType": "customer"
  },
  "createdAt": "2022-03-30T05:43:59.492Z"
}

See the guide for a narrative walkthrough of this API.