POST
/
api
/
v2
/
rules
/
create
Create custom rule
curl --request POST \
  --url https://zeropath.com/api/v2/rules/create \
  --header 'Content-Type: application/json' \
  --header 'X-ZeroPath-API-Token-Id: <api-key>' \
  --header 'X-ZeroPath-API-Token-Secret: <api-key>' \
  --data '{
  "organizationId": "<string>",
  "name": "<string>",
  "rule": "<string>",
  "globPattern": "**/*",
  "sourceTypes": [
    "HTTP_HANDLER"
  ],
  "repositoryIds": [
    "<string>"
  ]
}'
{
  "id": "<string>",
  "name": "<string>",
  "rule": "<string>",
  "globPattern": "<string>",
  "sourceTypes": [
    "HTTP_HANDLER"
  ],
  "repositoryIds": [
    "<string>"
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

X-ZeroPath-API-Token-Id
string
header
required
X-ZeroPath-API-Token-Secret
string
header
required

Body

application/json
name
string
required

Name for the custom rule

rule
string
required

Natural language description of the security rule

organizationId
string
globPattern
string
default:**/*

Glob pattern for files this rule applies to

sourceTypes
enum<string>[]

Source types this rule applies to

repositoryIds
string[]

Specific repository IDs to apply this rule to (if not specified, applies to all)

Response

Rule created successfully

id
string
required
name
string
required
rule
string
required

Natural language description of the security rule

globPattern
string
required
sourceTypes
enum<string>[]
required
repositoryIds
string[]
required
createdAt
string<date-time>
required
updatedAt
string<date-time>
required