Pull Requests

Access and Modify Pull Requests

Pull Requests#ListPullRequests

Security
Request
path Parameters
repositoryName
required
string
Example: drone-cli
query Parameters
accountId
required
string^[a-zA-Z0-9_-]{22}$

Harness Account ID

Example: accountId=abcdef1234567890ghijkl
orgId
string <= 128 characters ^[A-Za-z_][A-Za-z0-9_]*$

Harness Organization ID

Example: orgId=example_org
projectId
string <= 128 characters ^[A-Za-z_][A-Za-z0-9_]*$

Harness Project ID

Example: projectId=example_project
header Parameters
X-Api-Key
string

Harness personal or service access token

Example: Laborum hic perspiciatis itaque ut.
Responses
200

OK response.

400

BadRequest: Bad Request response.

401

Unauthorized: Unauthorized response.

403

Forbidden: Forbidden response.

429

TooManyRequests: Too Many Requests response.

500

InternalServerError: Internal Server Error response.

get/sto/api/v2/pull-requests/{repositoryName}
Request samples
Response samples
application/json
{
  • "pullRequestNumber": 6574989050465952000,
  • "pullRequestUrl": "Minima dolore velit magnam necessitatibus velit quo.",
  • "sourceBranch": "feat/shiny-object"
}

Pull Requests#FindPullRequestByID

Security
Request
path Parameters
repositoryName
required
string
Example: drone-cli
pullRequestNumber
required
integer <int64> >= 1

The number of the pullRequest to retrieve

Example: 11
query Parameters
accountId
required
string^[a-zA-Z0-9_-]{22}$

Harness Account ID

Example: accountId=abcdef1234567890ghijkl
orgId
string <= 128 characters ^[A-Za-z_][A-Za-z0-9_]*$

Harness Organization ID

Example: orgId=example_org
projectId
string <= 128 characters ^[A-Za-z_][A-Za-z0-9_]*$

Harness Project ID

Example: projectId=example_project
header Parameters
X-Api-Key
string

Harness personal or service access token

Example: Totam et.
Responses
200

OK response.

400

BadRequest: Bad Request response.

401

Unauthorized: Unauthorized response.

403

Forbidden: Forbidden response.

429

TooManyRequests: Too Many Requests response.

500

InternalServerError: Internal Server Error response.

get/sto/api/v2/pull-requests/{repositoryName}/{pullRequestNumber}
Request samples
Response samples
application/json
{
  • "pullRequestNumber": 6574989050465952000,
  • "pullRequestUrl": "Minima dolore velit magnam necessitatibus velit quo.",
  • "sourceBranch": "feat/shiny-object"
}

CalculateOccurrenceCorrelation Pull Requests

Determine if a path is correlated to a Pull Request.

Security
Request
query Parameters
accountId
required
string^[a-zA-Z0-9_-]{22}$

Harness Account ID

Example: accountId=abcdef1234567890ghijkl
orgId
string <= 128 characters ^[A-Za-z_][A-Za-z0-9_]*$

Harness Organization ID

Example: orgId=example_org
projectId
string <= 128 characters ^[A-Za-z_][A-Za-z0-9_]*$

Harness Project ID

Example: projectId=example_project
header Parameters
X-Api-Key
string

Harness personal or service access token

Example: Facere quisquam aut nemo minima.
Request Body schema: application/json
required
codePath
required
string
pullRequestNumber
required
integer <int64> >= 1
repositoryName
required
string
Responses
200

OK response.

400

BadRequest: Bad Request response.

401

Unauthorized: Unauthorized response.

403

Forbidden: Forbidden response.

429

TooManyRequests: Too Many Requests response.

500

InternalServerError: Internal Server Error response.

post/sto/api/v2/pull-requests/correlation
Request samples
application/json
{
  • "codePath": "path/to/code",
  • "pullRequestNumber": 11,
  • "repositoryName": "drone-cli"
}
Response samples
application/json
{
  • "correlated": true
}

Pull Requests#CreateFix

Use AI to augment the remediation steps for this Security Issue

Security
Request
query Parameters
accountId
required
string^[a-zA-Z0-9_-]{22}$

Harness Account ID

Example: accountId=abcdef1234567890ghijkl
orgId
string <= 128 characters ^[A-Za-z_][A-Za-z0-9_]*$

Harness Organization ID

Example: orgId=example_org
projectId
string <= 128 characters ^[A-Za-z_][A-Za-z0-9_]*$

Harness Project ID

Example: projectId=example_project
header Parameters
X-Api-Key
string

Harness personal or service access token

Example: Fugit omnis molestiae consequatur et rerum.
Request Body schema: application/json
required
description
required
string
id
required
string^[a-zA-Z0-9_-]{22}$

The ID of the Security Issue to create a Pull Request for

occurrenceId
required
integer <int64> >= 1
provider
required
string
pullBranch
required
string
remediationCode
required
string
remediationCodeEnd
required
integer <int64>
remediationCodePath
required
string
remediationCodeStart
required
integer <int64>
remediationContext
required
string
repositoryName
required
string
vulnerableCode
required
string
Responses
200

OK response.

400

BadRequest: Bad Request response.

401

Unauthorized: Unauthorized response.

403

Forbidden: Forbidden response.

429

TooManyRequests: Too Many Requests response.

500

InternalServerError: Internal Server Error response.

post/sto/api/v2/pull-requests/create
Request samples
application/json
{
  • "description": "A description of the Pull Request.",
  • "id": "1234567890abcdefghijkl",
  • "occurrenceId": 12345,
  • "provider": "Github",
  • "pullBranch": "develop",
  • "remediationCode": "func example() int {\n return 0\n}",
  • "remediationCodeEnd": 16,
  • "remediationCodePath": "path/to/code",
  • "remediationCodeStart": 14,
  • "remediationContext": "Context to the function.",
  • "repositoryName": "drone-cli",
  • "vulnerableCode": "func example() int {\n return 0\n}"
}
Response samples
application/json
{
  • "pullRequestNumber": 6574989050465952000,
  • "pullRequestUrl": "Minima dolore velit magnam necessitatibus velit quo.",
  • "sourceBranch": "feat/shiny-object"
}

Pull Requests#SuggestFix

Use AI to augment the remediation steps for this Security Issue

Security
Request
query Parameters
accountId
required
string^[a-zA-Z0-9_-]{22}$

Harness Account ID

Example: accountId=abcdef1234567890ghijkl
orgId
string <= 128 characters ^[A-Za-z_][A-Za-z0-9_]*$

Harness Organization ID

Example: orgId=example_org
projectId
string <= 128 characters ^[A-Za-z_][A-Za-z0-9_]*$

Harness Project ID

Example: projectId=example_project
header Parameters
X-Api-Key
string

Harness personal or service access token

Example: Dolor voluptates aliquid.
Request Body schema: application/json
required
id
required
string^[a-zA-Z0-9_-]{22}$

The ID of the Security Issue to create a Pull Request for

occurrenceId
required
integer <int64> >= 1
provider
required
string
pullRequestNumber
required
integer <int64> >= 1
remediationCode
required
string
remediationCodeEnd
required
integer <int64>
remediationCodePath
required
string
remediationCodeStart
required
integer <int64>
remediationContext
required
string
repositoryName
required
string
vulnerableCode
required
string
Responses
200

OK response.

400

BadRequest: Bad Request response.

401

Unauthorized: Unauthorized response.

403

Forbidden: Forbidden response.

429

TooManyRequests: Too Many Requests response.

500

InternalServerError: Internal Server Error response.

post/sto/api/v2/pull-requests/update
Request samples
application/json
{
  • "id": "1234567890abcdefghijkl",
  • "occurrenceId": 12345,
  • "provider": "Github",
  • "pullRequestNumber": 11,
  • "remediationCode": "func example() int {\n return 0\n}",
  • "remediationCodeEnd": 16,
  • "remediationCodePath": "path/to/code",
  • "remediationCodeStart": 14,
  • "remediationContext": "Context to the function.",
  • "repositoryName": "drone-cli",
  • "vulnerableCode": "func example() int {\n return 0\n}"
}
Response samples
application/json
{
  • "pullRequestNumber": 6574989050465952000,
  • "pullRequestUrl": "Minima dolore velit magnam necessitatibus velit quo.",
  • "sourceBranch": "feat/shiny-object"
}