curl --request POST \
--url https://api.outerlayer.ai/v1/work-items/{workItemId}/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"comment": {
"clientCommentId": "<string>",
"artifact": "<string>",
"body": "",
"criterion": "<string>",
"sessionId": "<string>"
},
"schemaVersion": 1
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items/{workItemId}/comments"
payload = {
"comment": {
"clientCommentId": "<string>",
"artifact": "<string>",
"body": "",
"criterion": "<string>",
"sessionId": "<string>"
},
"schemaVersion": 1
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
comment: {
clientCommentId: '<string>',
artifact: '<string>',
body: JSON.stringify(''),
criterion: '<string>',
sessionId: '<string>'
},
schemaVersion: 1
})
};
fetch('https://api.outerlayer.ai/v1/work-items/{workItemId}/comments', 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.outerlayer.ai/v1/work-items/{workItemId}/comments",
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([
'comment' => [
'clientCommentId' => '<string>',
'artifact' => '<string>',
'body' => '',
'criterion' => '<string>',
'sessionId' => '<string>'
],
'schemaVersion' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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.outerlayer.ai/v1/work-items/{workItemId}/comments"
payload := strings.NewReader("{\n \"comment\": {\n \"clientCommentId\": \"<string>\",\n \"artifact\": \"<string>\",\n \"body\": \"\",\n \"criterion\": \"<string>\",\n \"sessionId\": \"<string>\"\n },\n \"schemaVersion\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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.outerlayer.ai/v1/work-items/{workItemId}/comments")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": {\n \"clientCommentId\": \"<string>\",\n \"artifact\": \"<string>\",\n \"body\": \"\",\n \"criterion\": \"<string>\",\n \"sessionId\": \"<string>\"\n },\n \"schemaVersion\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/{workItemId}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": {\n \"clientCommentId\": \"<string>\",\n \"artifact\": \"<string>\",\n \"body\": \"\",\n \"criterion\": \"<string>\",\n \"sessionId\": \"<string>\"\n },\n \"schemaVersion\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created": true,
"id": "<string>",
"thread": {
"criterion": "<string>",
"waitingOn": "person"
},
"unchanged": true
}
}{
"data": {
"created": true,
"id": "<string>",
"thread": {
"criterion": "<string>",
"waitingOn": "person"
},
"unchanged": true
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Post a comment on a work item's general thread or a criterion thread
Posts one comment. Omitting criterion posts on the item’s general thread; naming one posts on that criterion’s own thread. pass/fail are a person’s verdict on the whole item: they are refused on a criterion thread (verdict_on_criterion) and from an agent session or a machine key (verdict_needs_person). attach makes an artifact the criterion’s proof, superseding whatever it replaces; ready hands the thread back to a person (refused from a person with ready_needs_agent). Only a person’s fail on the general thread asks an agent to amend; a plain comment never does. No verdict can be recorded on an item that is not reviewable (not_reviewable). An artifact is accepted only with attach (artifact_needs_attach). Retrying with the same clientCommentId returns the comment already recorded; reusing one for a different comment or on another work item is refused (comment_conflict).
curl --request POST \
--url https://api.outerlayer.ai/v1/work-items/{workItemId}/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"comment": {
"clientCommentId": "<string>",
"artifact": "<string>",
"body": "",
"criterion": "<string>",
"sessionId": "<string>"
},
"schemaVersion": 1
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items/{workItemId}/comments"
payload = {
"comment": {
"clientCommentId": "<string>",
"artifact": "<string>",
"body": "",
"criterion": "<string>",
"sessionId": "<string>"
},
"schemaVersion": 1
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
comment: {
clientCommentId: '<string>',
artifact: '<string>',
body: JSON.stringify(''),
criterion: '<string>',
sessionId: '<string>'
},
schemaVersion: 1
})
};
fetch('https://api.outerlayer.ai/v1/work-items/{workItemId}/comments', 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.outerlayer.ai/v1/work-items/{workItemId}/comments",
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([
'comment' => [
'clientCommentId' => '<string>',
'artifact' => '<string>',
'body' => '',
'criterion' => '<string>',
'sessionId' => '<string>'
],
'schemaVersion' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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.outerlayer.ai/v1/work-items/{workItemId}/comments"
payload := strings.NewReader("{\n \"comment\": {\n \"clientCommentId\": \"<string>\",\n \"artifact\": \"<string>\",\n \"body\": \"\",\n \"criterion\": \"<string>\",\n \"sessionId\": \"<string>\"\n },\n \"schemaVersion\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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.outerlayer.ai/v1/work-items/{workItemId}/comments")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": {\n \"clientCommentId\": \"<string>\",\n \"artifact\": \"<string>\",\n \"body\": \"\",\n \"criterion\": \"<string>\",\n \"sessionId\": \"<string>\"\n },\n \"schemaVersion\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/{workItemId}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": {\n \"clientCommentId\": \"<string>\",\n \"artifact\": \"<string>\",\n \"body\": \"\",\n \"criterion\": \"<string>\",\n \"sessionId\": \"<string>\"\n },\n \"schemaVersion\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created": true,
"id": "<string>",
"thread": {
"criterion": "<string>",
"waitingOn": "person"
},
"unchanged": true
}
}{
"data": {
"created": true,
"id": "<string>",
"thread": {
"criterion": "<string>",
"waitingOn": "person"
},
"unchanged": true
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Factory id the request is scoped to.
API key (sk_outerlayer_*)
Path Parameters
Body
Response
The comment already existed (idempotent retry).
Show child attributes
Show child attributes