rules

List repo protection rules

Securityx-api-key
Request
path Parameters
repo_identifier
required
string
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

query
string

The substring by which the repository protection rules are filtered.

order
string
Default: "asc"

The order of the output.

Enum: "asc" "desc"
sort
string
Default: "created_at"

The field by which the protection rules are sorted.

Enum: "created_at" "identifier" "uid" "updated_at"
page
integer >= 1
Default: 1

The page to return.

limit
integer [ 1 .. 100 ]
Default: 30

The maximum number of results to return.

inherited
boolean
Default: false

The result should inherit entities from parent spaces.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

get/code/api/v1/repos/{repo_identifier}/rules
Request samples
Response samples
application/json
[
  • {
    }
]

Add repo protection rule

Securityx-api-key
Request
path Parameters
repo_identifier
required
string
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Request Body schema: application/json
ProtectionBranch (object) (OpenapiRuleDefinition)
description
string
identifier
string
object or null (ProtectionPattern)
state
string or null (EnumRuleState)
Enum: "active" "disabled" "monitor"
type
string (OpenapiRuleType)
Value: "branch"
uid
string
Deprecated
Responses
201

Created

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

post/code/api/v1/repos/{repo_identifier}/rules
Request samples
application/json
{
  • "definition": {
    },
  • "description": "string",
  • "identifier": "string",
  • "pattern": {
    },
  • "state": "active",
  • "type": "branch",
  • "uid": "string"
}
Response samples
application/json
{
  • "created": 0,
  • "created_by": {
    },
  • "definition": {
    },
  • "description": "string",
  • "identifier": "string",
  • "pattern": {
    },
  • "scope": 0,
  • "state": "active",
  • "type": "branch",
  • "updated": 0,
  • "user_groups": {
    },
  • "users": {
    }
}

Delete repo protection rule

Securityx-api-key
Request
path Parameters
repo_identifier
required
string
rule_identifier
required
string
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
204

No Content

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

delete/code/api/v1/repos/{repo_identifier}/rules/{rule_identifier}
Request samples
Response samples
application/json
{
  • "message": "string",
  • "values": {
    }
}

Get repo protection rule

Securityx-api-key
Request
path Parameters
repo_identifier
required
string
rule_identifier
required
string
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

get/code/api/v1/repos/{repo_identifier}/rules/{rule_identifier}
Request samples
Response samples
application/json
{
  • "created": 0,
  • "created_by": {
    },
  • "definition": {
    },
  • "description": "string",
  • "identifier": "string",
  • "pattern": {
    },
  • "scope": 0,
  • "state": "active",
  • "type": "branch",
  • "updated": 0,
  • "user_groups": {
    },
  • "users": {
    }
}

Update repo protection rule

Securityx-api-key
Request
path Parameters
repo_identifier
required
string
rule_identifier
required
string
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Request Body schema: application/json
ProtectionBranch (object) (OpenapiRuleDefinition)
description
string or null
identifier
string or null
object or null (ProtectionPattern)
state
string or null (EnumRuleState)
Enum: "active" "disabled" "monitor"
type
string (OpenapiRuleType)
Value: "branch"
uid
string or null
Deprecated
Responses
200

OK

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

patch/code/api/v1/repos/{repo_identifier}/rules/{rule_identifier}
Request samples
application/json
{
  • "definition": {
    },
  • "description": "string",
  • "identifier": "string",
  • "pattern": {
    },
  • "state": "active",
  • "type": "branch",
  • "uid": "string"
}
Response samples
application/json
{
  • "created": 0,
  • "created_by": {
    },
  • "definition": {
    },
  • "description": "string",
  • "identifier": "string",
  • "pattern": {
    },
  • "scope": 0,
  • "state": "active",
  • "type": "branch",
  • "updated": 0,
  • "user_groups": {
    },
  • "users": {
    }
}

List acc/org/proj protection rules

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

query
string

The substring by which the repository protection rules are filtered.

order
string
Default: "asc"

The order of the output.

Enum: "asc" "desc"
sort
string
Default: "created_at"

The field by which the protection rules are sorted.

Enum: "created_at" "identifier" "uid" "updated_at"
page
integer >= 1
Default: 1

The page to return.

limit
integer [ 1 .. 100 ]
Default: 30

The maximum number of results to return.

inherited
boolean
Default: false

The result should inherit entities from parent spaces.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

get/code/api/v1/rules
Request samples
Response samples
application/json
[
  • {
    }
]

Add acc/org/proj protection rule

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Request Body schema: application/json
ProtectionBranch (object) (OpenapiRuleDefinition)
description
string
identifier
string
object or null (ProtectionPattern)
state
string or null (EnumRuleState)
Enum: "active" "disabled" "monitor"
type
string (OpenapiRuleType)
Value: "branch"
uid
string
Deprecated
Responses
201

Created

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

post/code/api/v1/rules
Request samples
application/json
{
  • "definition": {
    },
  • "description": "string",
  • "identifier": "string",
  • "pattern": {
    },
  • "state": "active",
  • "type": "branch",
  • "uid": "string"
}
Response samples
application/json
{
  • "created": 0,
  • "created_by": {
    },
  • "definition": {
    },
  • "description": "string",
  • "identifier": "string",
  • "pattern": {
    },
  • "scope": 0,
  • "state": "active",
  • "type": "branch",
  • "updated": 0,
  • "user_groups": {
    },
  • "users": {
    }
}

Delete acc/org/proj protection rule

Securityx-api-key
Request
path Parameters
rule_identifier
required
string
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
204

No Content

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

delete/code/api/v1/rules/{rule_identifier}
Request samples
Response samples
application/json
{
  • "message": "string",
  • "values": {
    }
}

Get acc/org/proj protection rule

Securityx-api-key
Request
path Parameters
rule_identifier
required
string
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

get/code/api/v1/rules/{rule_identifier}
Request samples
Response samples
application/json
{
  • "created": 0,
  • "created_by": {
    },
  • "definition": {
    },
  • "description": "string",
  • "identifier": "string",
  • "pattern": {
    },
  • "scope": 0,
  • "state": "active",
  • "type": "branch",
  • "updated": 0,
  • "user_groups": {
    },
  • "users": {
    }
}

Update acc/org/proj protection rule

Securityx-api-key
Request
path Parameters
rule_identifier
required
string
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Request Body schema: application/json
ProtectionBranch (object) (OpenapiRuleDefinition)
description
string or null
identifier
string or null
object or null (ProtectionPattern)
state
string or null (EnumRuleState)
Enum: "active" "disabled" "monitor"
type
string (OpenapiRuleType)
Value: "branch"
uid
string or null
Deprecated
Responses
200

OK

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

patch/code/api/v1/rules/{rule_identifier}
Request samples
application/json
{
  • "definition": {
    },
  • "description": "string",
  • "identifier": "string",
  • "pattern": {
    },
  • "state": "active",
  • "type": "branch",
  • "uid": "string"
}
Response samples
application/json
{
  • "created": 0,
  • "created_by": {
    },
  • "definition": {
    },
  • "description": "string",
  • "identifier": "string",
  • "pattern": {
    },
  • "scope": 0,
  • "state": "active",
  • "type": "branch",
  • "updated": 0,
  • "user_groups": {
    },
  • "users": {
    }
}