File Catalog Api Create File Rule

File Catalog Api Create File Rule
Create a rule from a catalog entry

Creates a SHA-256 Rule (rank CUSTOM_GLOBAL) for the entry; the hash is taken from the entry, never from the request. The rule is attached to no Policy, so it enforces nothing until it is attached and published. Requires the ADMIN or SECURITY_OPERATOR role.

Request
URI
POST
https://{api_host}/api/v1/file-catalog/{fileId}/rule
COPY
Path Parameters
integer
fileId
Required  

File catalog entry id

fileId example
101

Request Body

The Rule name and the action for the SHA-256 Rule that is created from the entry.

CreateFileRuleRequest of type(s) application/json
Required  

Show optional properties

{
    "ruleName": "string",
    "action": "string"
}
{
    "ruleName": "Ban backup-agent.sh",
    "action": "PREVENT"
}
string
ruleName
Required  

Name of the new Rule, validated as for POST /api/v1/rules

string
action
Required  

The action chosen when creating a rule from a catalog entry: PREVENT bans the file (stored as BLOCK, the entry becomes BANNED) and ALLOW approves it. The value is matched case-insensitively.

  • PREVENT: Creates a BLOCK rule for the file's SHA-256 and sets the entry to BANNED
  • ALLOW: Creates an ALLOW rule for the file's SHA-256 and sets the entry to APPROVED
Enumeration: PREVENT, ALLOW
Authentication
This operation uses the following authentication methods.
Responses
201

201 Created successful response envelope. The entry as updated and the created Rule

Returns CreateFileRuleResponse of type(s) application/json
{
    "file": {
        "fileId": 101,
        "fileName": "backup-agent.sh",
        "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
        "fileKind": "SCRIPT",
        "globalState": "BANNED",
        "hypervisorCount": 2,
        "rule": {
            "ruleId": 1000002,
            "name": "Ban backup-agent.sh",
            "action": "BLOCK",
            "ruleRank": "CUSTOM_GLOBAL",
            "isEnabled": true,
            "attachment": "NOT_ATTACHED",
            "attachedPolicyCount": 0
        }
    },
    "rule": {
        "ruleId": 1000002,
        "name": "Ban backup-agent.sh",
        "description": "Created from the file catalog for backup-agent.sh",
        "ruleType": "HASH",
        "matchData": "{\"sha256_hash\":\"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"file_name_hint\":\"backup-agent.sh\",\"file_size_bytes\":2048}",
        "action": "BLOCK",
        "ruleRank": "CUSTOM_GLOBAL",
        "minAgentVersion": "1.0.0",
        "guid": "00000000-0000-4000-8000-000000000040",
        "isEnabled": true,
        "isBuiltIn": false,
        "revision": 1,
        "createdBy": 1,
        "updatedBy": 1,
        "policyCount": 0,
        "createdAt": "2026-01-15T10:30:00Z",
        "updatedAt": "2026-01-15T10:30:00Z"
    }
}
object
file
Required  

One distinct file, keyed by SHA-256. Absent fields are omitted from the JSON.

object
rule
Required  

A Rule (Built-in or Custom).


400

400 Bad Request: INVALID_ACTION, INVALID_RULE_NAME, DUPLICATE_RULE_NAME or MALFORMED_REQUEST

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


401

401 Unauthorized: UNAUTHENTICATED when the VTP_SESSION cookie is missing, unknown, expired or revoked

Returns Unauthenticated of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


403

403 Forbidden: FORBIDDEN or CSRF_ERROR. CSRF_ERROR when the X-XSRF-TOKEN header is missing or wrong on a POST, PUT, PATCH or DELETE (only POST /api/v1/auth/login is exempt, and a request without a valid session gets 401 UNAUTHENTICATED instead); PASSWORD_CHANGE_REQUIRED when the account must change its password first (only GET /api/v1/auth/session, POST /api/v1/auth/logout and POST /api/v1/auth/change-password are exempt); LICENSE_REQUIRED or LICENSE_EXPIRED while the license pool is restricted (no license, or expired past grace) (exempt: every route under /api/v1/auth, GET /api/v1/user/preferences, GET /api/v1/licensing/summary and POST /api/v1/licensing/licenses)

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


404

404 Not Found: FILE_NOT_FOUND

Returns ApiErrorResponse of type(s) application/json
"ApiErrorResponse Object"
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


409

409 Conflict: FILE_RULE_ALREADY_EXISTS

Returns ApiErrorResponse of type(s) application/json
"ApiErrorResponse Object"
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"ruleName":"string","action":"string"}' https://{api_host}/api/v1/file-catalog/{fileId}/rule