Approvals

This contains APIs for Approvals.

Gets Approval Instances by Execution Id

Gets Approval Instances by Execution Id [Beta]

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

execution-id
required
string

Pipeline Execution identifier

query Parameters
approval_status
string

This filters approval instances based on status

Enum: "WAITING" "APPROVED" "REJECTED" "FAILED" "ABORTED" "EXPIRED"
approval_type
string

This filters approval instances based on type

Enum: "HarnessApproval" "JiraApproval" "CustomApproval" "ServiceNowApproval"
node_execution_id
string

This filters approval instances based on runtime identifier of the step

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Responses
200

Approval Instances list response body

400

Bad Request

get/v1/orgs/{org}/projects/{project}/approvals/execution/{execution-id}
Request samples
Response samples
[
  • {
    }
]

Approve or Reject an Execution by Pipeline Execution ID

Approve or Reject an Execution by Pipeline Execution ID [Beta]

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

execution-id
required
string

Pipeline Execution identifier

query Parameters
callback_id
string

This filters approval instances based on callback id given in the step parameters

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Request Body schema: application/json

Request Body for Harness Approval Activity

comments
string
action
string >= 0 characters
Enum: "APPROVE" "REJECT"
Array of objects (ApproverInputDTO)
Responses
200

Approval Instance response body

400

Bad Request

post/v1/orgs/{org}/projects/{project}/approvals/execution/{execution-id}
Request samples
application/json
{
  • "comments": "string",
  • "action": "APPROVE",
  • "approver_inputs": [
    ]
}
Response samples
{
  • "id": "example_approval_instance",
  • "type": "HarnessApproval",
  • "status": "WAITING",
  • "deadline": 1683953545329,
  • "details": {
    },
  • "error_message": "example error message"
}

Approve or Reject a Pipeline Execution

Securityx-api-key
Request
path Parameters
approvalInstanceId
required
string

Approval Identifier for the entity

query Parameters
accountIdentifier
string

Account Identifier for the Entity.

Request Body schema:
required

Details of approval activity

action
required
string

Approval activity action

Enum: "APPROVE" "REJECT"
Array of objects (ApproverInput)

Custom data to capture at the time of approval

comments
string

Approval activity with the comment

autoApprove
boolean
Responses
400

Bad Request

500

Internal Server Error

default

Returns a newly added Harness Approval activity

post/pipeline/api/approvals/{approvalInstanceId}/harness/activity
Request samples
{
  • "action": "APPROVE",
  • "approverInputs": [
    ],
  • "comments": "string",
  • "autoApprove": true
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}