# policies#update Update a policy by identifier Endpoint: PATCH /pm/api/v1/policies/{identifier} Version: 1.0 Security: ## Query parameters: - `git_commit_msg` (string) The commit message used in git when creating the policy Example: "harness policy commit msg" - `git_is_new_branch` (boolean) A flag to determine if the api should try and commit to a new branch Example: true - `git_base_branch` (string) If committing to a new branch, git_base_branch tells the api which branch to base the new branch from Example: "main" - `git_branch` (string) The git branch the policy resides in Example: "main" - `git_commit_sha` (string) The existing commit sha of the file being updated Example: "1369b45c20fc685113adcfd1a08a914180ff3c0d" - `git_file_id` (string) The existing file id of the file being updated, not required for bitbucket files Example: "1369b45c20fc685113adcfd1a08a914180ff3c0d" - `accountIdentifier` (string) Harness account ID Example: "eBqAoNchMLKigC_qZ5EdC" - `orgIdentifier` (string) Harness organization ID Example: "test-org" - `projectIdentifier` (string) Harness project ID Example: "test-project" ## Path parameters: - `identifier` (string, required) Identifier of the policy Example: "policy-1" ## Header parameters: - `x-api-key` (string) Harness PAT key used to perform authorization Example: "Enim illo omnis." ## Request fields (application/json): - `name` (string) The name of the policy Example: "Check that an approval step is present" - `rego` (string) The rego that defines the policy policy Example: "package test\ndeny[\"should say hello world\"] {input.message != \"world\"}" ## Response 400 fields (application/json): - `fault` (boolean, required) Is the error a server-side fault? Example: true - `id` (string, required) ID is a unique identifier for this particular occurrence of the problem. Example: "123abc" - `message` (string, required) Message is a human-readable explanation specific to this occurrence of the problem. Example: "parameter 'p' must be an integer" - `name` (string, required) Name is the name of this class of errors. Example: "bad_request" - `temporary` (boolean, required) Is the error temporary? Example: true - `timeout` (boolean, required) Is the error a timeout? Example: true ## Response 401 fields (application/vnd.goa.error): - `fault` (boolean, required) Is the error a server-side fault? Example: true - `id` (string, required) ID is a unique identifier for this particular occurrence of the problem. Example: "123abc" - `message` (string, required) Message is a human-readable explanation specific to this occurrence of the problem. Example: "parameter 'p' must be an integer" - `name` (string, required) Name is the name of this class of errors. Example: "bad_request" - `temporary` (boolean, required) Is the error temporary? Example: true - `timeout` (boolean, required) Is the error a timeout? Example: true ## Response 403 fields (application/vnd.goa.error): - `fault` (boolean, required) Is the error a server-side fault? Example: true - `id` (string, required) ID is a unique identifier for this particular occurrence of the problem. Example: "123abc" - `message` (string, required) Message is a human-readable explanation specific to this occurrence of the problem. Example: "parameter 'p' must be an integer" - `name` (string, required) Name is the name of this class of errors. Example: "bad_request" - `temporary` (boolean, required) Is the error temporary? Example: true - `timeout` (boolean, required) Is the error a timeout? Example: true ## Response 404 fields (application/vnd.goa.error): - `fault` (boolean, required) Is the error a server-side fault? Example: true - `id` (string, required) ID is a unique identifier for this particular occurrence of the problem. Example: "123abc" - `message` (string, required) Message is a human-readable explanation specific to this occurrence of the problem. Example: "parameter 'p' must be an integer" - `name` (string, required) Name is the name of this class of errors. Example: "bad_request" - `temporary` (boolean, required) Is the error temporary? Example: true - `timeout` (boolean, required) Is the error a timeout? Example: true ## Response 500 fields (application/vnd.goa.error): - `fault` (boolean, required) Is the error a server-side fault? Example: true - `id` (string, required) ID is a unique identifier for this particular occurrence of the problem. Example: "123abc" - `message` (string, required) Message is a human-readable explanation specific to this occurrence of the problem. Example: "parameter 'p' must be an integer" - `name` (string, required) Name is the name of this class of errors. Example: "bad_request" - `temporary` (boolean, required) Is the error temporary? Example: true - `timeout` (boolean, required) Is the error a timeout? Example: true ## Response 502 fields (application/vnd.goa.error): - `fault` (boolean, required) Is the error a server-side fault? Example: true - `id` (string, required) ID is a unique identifier for this particular occurrence of the problem. Example: "123abc" - `message` (string, required) Message is a human-readable explanation specific to this occurrence of the problem. Example: "parameter 'p' must be an integer" - `name` (string, required) Name is the name of this class of errors. Example: "bad_request" - `temporary` (boolean, required) Is the error temporary? Example: true - `timeout` (boolean, required) Is the error a timeout? Example: true