Skip to main content
POST
/
v1
/
assessments
/
revisions
/
{revision_id}
/
approve
Approve an assessment revision
curl --request POST \
  --url https://api.app.chainloop.dev/v1/assessments/revisions/{revision_id}/approve \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "review_note": "review_note"
}
'
import requests

url = "https://api.app.chainloop.dev/v1/assessments/revisions/{revision_id}/approve"

payload = { "review_note": "review_note" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({review_note: 'review_note'})
};

fetch('https://api.app.chainloop.dev/v1/assessments/revisions/{revision_id}/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.app.chainloop.dev/v1/assessments/revisions/{revision_id}/approve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'review_note' => 'review_note'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.app.chainloop.dev/v1/assessments/revisions/{revision_id}/approve"

payload := strings.NewReader("{\n \"review_note\": \"review_note\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.app.chainloop.dev/v1/assessments/revisions/{revision_id}/approve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"review_note\": \"review_note\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.app.chainloop.dev/v1/assessments/revisions/{revision_id}/approve")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"review_note\": \"review_note\"\n}"

response = http.request(request)
puts response.read_body
{
  "result": {
    "justification_code": null,
    "note": "note",
    "approval_status": "ASSESSMENT_APPROVAL_STATUS_UNSPECIFIED",
    "reviewed_at": "2000-01-23T04:56:07.000Z",
    "created_at": "2000-01-23T04:56:07.000Z",
    "assessment_id": "assessment_id",
    "fixable_summary": "fixable_summary",
    "project_version_id": "project_version_id",
    "reviewer": {
      "intercom_hash": "intercom_hash",
      "created_at": "2000-01-23T04:56:07.000Z",
      "last_name": "last_name",
      "id": "id",
      "first_name": "first_name",
      "email": "email",
      "instance_admin": true
    },
    "fixable_feasibility": 5.962133916683182,
    "confidence_breakdown": {
      "schema_version": "schema_version",
      "scores": {
        "key": {
          "reason": "reason",
          "abstained": true,
          "value": 2.3021358869347655
        }
      },
      "derived": {
        "rollup_active_axes": 9,
        "dominant_low_axis": {
          "reason": "reason",
          "axis": "axis",
          "value": 3.616076749251911
        },
        "rollup": 7.061401241503109
      }
    },
    "created_by": {
      "api_token": {
        "id": "id"
      },
      "type": "ASSESSMENT_CREATOR_TYPE_UNSPECIFIED",
      "user": {
        "intercom_hash": "intercom_hash",
        "created_at": "2000-01-23T04:56:07.000Z",
        "last_name": "last_name",
        "id": "id",
        "first_name": "first_name",
        "email": "email",
        "instance_admin": true
      },
      "ai_agent": {
        "name": "name"
      }
    },
    "revision": 1,
    "products": [
      {
        "purl_glob": "purl_glob"
      },
      {
        "purl_glob": "purl_glob"
      }
    ],
    "review_note": "review_note",
    "scope": null,
    "confidence_score": 5.637376656633329,
    "id": "id",
    "fixable_status": "FIXABLE_STATUS_UNSPECIFIED",
    "status": null
  }
}
{
"code": 0,
"details": [
"details",
"details"
],
"message": "message"
}
{
"code": 6,
"details": [
"details",
"details"
],
"message": "message"
}
{
"code": 1,
"details": [
"details",
"details"
],
"message": "message"
}
{
"code": 5,
"details": [
"details",
"details"
],
"message": "message"
}
{
"code": 5,
"details": [
{
"@type": "@type"
},
{
"@type": "@type"
}
],
"message": "message"
}

Authorizations

Authorization
string
header
required

Bearer token for authentication

Path Parameters

revision_id
string
required

Revision ID to approve

Body

application/json

Request to approve a pending assessment revision

review_note
string

Optional reviewer note

Response

A successful response.

Response for ApproveAssessmentRevision method

result
AssessmentRevision · object

Immutable snapshot of an assessment at a revision number, with authorship and review audit trails

Example:
{
"justification_code": null,
"note": "note",
"approval_status": "ASSESSMENT_APPROVAL_STATUS_UNSPECIFIED",
"reviewed_at": "2000-01-23T04:56:07.000Z",
"created_at": "2000-01-23T04:56:07.000Z",
"assessment_id": "assessment_id",
"fixable_summary": "fixable_summary",
"project_version_id": "project_version_id",
"reviewer": {
"intercom_hash": "intercom_hash",
"created_at": "2000-01-23T04:56:07.000Z",
"last_name": "last_name",
"id": "id",
"first_name": "first_name",
"email": "email",
"instance_admin": true
},
"fixable_feasibility": 5.962133916683182,
"confidence_breakdown": {
"schema_version": "schema_version",
"scores": {
"key": {
"reason": "reason",
"abstained": true,
"value": 2.3021358869347655
}
},
"derived": {
"rollup_active_axes": 9,
"dominant_low_axis": {
"reason": "reason",
"axis": "axis",
"value": 3.616076749251911
},
"rollup": 7.061401241503109
}
},
"created_by": {
"api_token": { "id": "id" },
"type": "ASSESSMENT_CREATOR_TYPE_UNSPECIFIED",
"user": {
"intercom_hash": "intercom_hash",
"created_at": "2000-01-23T04:56:07.000Z",
"last_name": "last_name",
"id": "id",
"first_name": "first_name",
"email": "email",
"instance_admin": true
},
"ai_agent": { "name": "name" }
},
"revision": 1,
"products": [
{ "purl_glob": "purl_glob" },
{ "purl_glob": "purl_glob" }
],
"review_note": "review_note",
"scope": null,
"confidence_score": 5.637376656633329,
"id": "id",
"fixable_status": "FIXABLE_STATUS_UNSPECIFIED",
"status": null
}