import requests
url = "https://api.platform.ankra.app/org/security/findings/{finding_id}/remediations"
headers = {"cookie": "ankra_session="}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {cookie: 'ankra_session='}};
fetch('https://api.platform.ankra.app/org/security/findings/{finding_id}/remediations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/security/findings/{finding_id}/remediations \
--cookie ankra_session={
"finding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refusals": [
{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_name": "<string>",
"image_repository": "<string>",
"occurrences": 123,
"reason": "<string>",
"repository": "<string>"
}
],
"runs": [
{
"created": true,
"run": {
"finding_ids": [
"<string>"
],
"findings": [
{
"from": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"package": "<string>",
"severity": "<string>",
"to": "<string>",
"vulnerability_id": "<string>"
}
],
"kind": "image_rebuild",
"proposal_key": "<string>",
"started_by": "person",
"title": "<string>",
"trigger": "<string>",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_name": "<string>",
"attempts": 123,
"branch": "<string>",
"cluster_ids": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"deadline_at": "2023-11-07T05:31:56Z",
"failed_head_shas": [
"<string>"
],
"finding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_repositories": [
"<string>"
],
"last_head_sha": "<string>",
"last_outcome": "<string>",
"last_pipeline_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_attempts": 123,
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pipeline_concluded_at": "2023-11-07T05:31:56Z",
"pipeline_repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pull_request_number": 123,
"pull_request_url": "<string>",
"repository": "<string>",
"requested_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "working",
"status_reason": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"verified_at": "2023-11-07T05:31:56Z",
"verified_head_sha": "<string>"
}
}
]
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}Start or reuse remediation runs for a security finding (browser session)
Opens or reuses the fix pull request per affected application repository (the image rebuild lane), starts or answers the live remediation run for each, and dispatches the pull request branch’s head through Ankra Pipelines under the default branch’s approved authority. Repeating the call reuses the live runs; nothing is approved, waived or accepted. The caller, a person through their session or their API token, is the one asking, so the organisation’s AI autonomy pause and the application’s keep_it_safe choice do not hold this start; they hold every step Ankra later takes on its own for the run, such as re-running its pipeline after an Ankra infrastructure error, which then stops the run at needs_human with the reason.
import requests
url = "https://api.platform.ankra.app/org/security/findings/{finding_id}/remediations"
headers = {"cookie": "ankra_session="}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {cookie: 'ankra_session='}};
fetch('https://api.platform.ankra.app/org/security/findings/{finding_id}/remediations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/security/findings/{finding_id}/remediations \
--cookie ankra_session={
"finding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refusals": [
{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_name": "<string>",
"image_repository": "<string>",
"occurrences": 123,
"reason": "<string>",
"repository": "<string>"
}
],
"runs": [
{
"created": true,
"run": {
"finding_ids": [
"<string>"
],
"findings": [
{
"from": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"package": "<string>",
"severity": "<string>",
"to": "<string>",
"vulnerability_id": "<string>"
}
],
"kind": "image_rebuild",
"proposal_key": "<string>",
"started_by": "person",
"title": "<string>",
"trigger": "<string>",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_name": "<string>",
"attempts": 123,
"branch": "<string>",
"cluster_ids": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"deadline_at": "2023-11-07T05:31:56Z",
"failed_head_shas": [
"<string>"
],
"finding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_repositories": [
"<string>"
],
"last_head_sha": "<string>",
"last_outcome": "<string>",
"last_pipeline_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_attempts": 123,
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pipeline_concluded_at": "2023-11-07T05:31:56Z",
"pipeline_repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pull_request_number": 123,
"pull_request_url": "<string>",
"repository": "<string>",
"requested_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "working",
"status_reason": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"verified_at": "2023-11-07T05:31:56Z",
"verified_head_sha": "<string>"
}
}
]
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}Authorizations
Browser session. Mutations also require X-Ankra-CSRF.