Add Trusted Rules to a Device

Saves a list of trusted rules for a specific device. Each rule includes a rule ID and may include a comment and an expiration date. The expiration date must be in the future. The deviceName must represent an actual device, not a group or ALL_FIREWALLS.

Resource name: /api/v1/trusted-rules/rules

Request Method: POST

Request parameters

Parameter Type Description
deviceName
mandatory
string The device's tree name (required). Use the GET /devices method from the Devices Setup Resource Group to get device tree name.
rules array of objects List of rule objects to be trusted.
id
mandatory
string ID of the rule (required).
comment string Optional comment.
expirationDate string Expiration date in yyyy-MM-dd format. Must be in the future.

Request example

Copy
{
  "deviceName": "branch-firewall-01",
  "rules": [
    {
      "id": "rule-987",
      "comment": "Temporary access for partner system",
      "expirationDate": "2025-12-31"
    },
    {
      "id": "rule-654"
    }
  ]
}

cUrl Example

Copy
curl -X POST "https://<localhost>/api/v1/trusted-rules/rules" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "deviceName": "branch-firewall-01",
    "rules": [
      {
        "id": "rule-987",
        "comment": "Temporary access for partner system",
        "expirationDate": "2025-12-31"
      },
      {
        "id": "rule-654"
      }
    ]
  }'

Status codes

Code Description
200 List of saved and failed rules
400 Bad request due to invalid input
401 Unauthorized
403 Forbidden
404 Not Found
423 Locked
429 Too Many Requests
500 Internal Server Error
503 Service Unavailable

Response parameters

Parameter Type Description
trustedRuleIds array of strings Successfully saved rule IDs.
failedRuleIds array of strings Rule IDs that failed to save.
failureReasons object Map of rule IDs to error messages.

Response example success 200

Copy
{
  "trustedRuleIds": ["rule-987"],
  "failedRuleIds": ["rule-654"],
  "failureReasons": {
    "rule-654": "Expiration date must be in the future"
  }
}

Response example failure 400

Copy
{
  "error": "Bad Request",
  "description": "Invalid expiration date format",
  "fieldErrors": [
    {
      "field": "expirationDate",
      "error": "Date must be in the future"
    }
  ]
}