Process a Report
curl --request POST \
--url https://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"decisions": [
{
"mutationId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"amend": {},
"reason": "<string>",
"reject": true
}
]
}
'import requests
url = "https://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide"
payload = { "decisions": [
{
"mutationId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"amend": {},
"reason": "<string>",
"reject": True
}
] }
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({
decisions: [
{
mutationId: '248df4b7-aa70-47b8-a036-33ac447e668d',
amend: {},
reason: '<string>',
reject: true
}
]
})
};
fetch('https://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide', 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://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide",
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([
'decisions' => [
[
'mutationId' => '248df4b7-aa70-47b8-a036-33ac447e668d',
'amend' => [
],
'reason' => '<string>',
'reject' => true
]
]
]),
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://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide"
payload := strings.NewReader("{\n \"decisions\": [\n {\n \"mutationId\": \"248df4b7-aa70-47b8-a036-33ac447e668d\",\n \"amend\": {},\n \"reason\": \"<string>\",\n \"reject\": true\n }\n ]\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://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"decisions\": [\n {\n \"mutationId\": \"248df4b7-aa70-47b8-a036-33ac447e668d\",\n \"amend\": {},\n \"reason\": \"<string>\",\n \"reject\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide")
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 \"decisions\": [\n {\n \"mutationId\": \"248df4b7-aa70-47b8-a036-33ac447e668d\",\n \"amend\": {},\n \"reason\": \"<string>\",\n \"reject\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"mutations": [
{
"allowance": "<string>",
"allowedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"allower": {
"name": "<string>"
},
"amended": [
"<string>"
],
"causedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"changedAt": "2023-11-07T05:31:56Z",
"changes": {},
"createdAt": "2023-11-07T05:31:56Z",
"decidedAt": "2023-11-07T05:31:56Z",
"decidedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"decider": {
"name": "<string>"
},
"entity": {
"name": "<string>"
},
"entityId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"entityType": "<string>",
"evidence": [
{
"eventId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"messageId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"quotes": [
"<string>"
],
"sealed": "<string>",
"stance": "<string>"
}
],
"heldByAgent": true,
"id": "248df4b7-aa70-47b8-a036-33ac447e668d",
"mine": true,
"op": "<string>",
"owner": {
"id": "248df4b7-aa70-47b8-a036-33ac447e668d",
"name": "<string>"
},
"proposal": {},
"rationale": "<string>",
"reason": "<string>",
"refs": {},
"related": {
"name": "<string>"
},
"relatedId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"revertedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"reverts": "248df4b7-aa70-47b8-a036-33ac447e668d",
"rule": {
"name": "<string>"
},
"ruleId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"source": "<string>",
"status": "<string>",
"supersededBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"user": {
"name": "<string>"
},
"userId": "248df4b7-aa70-47b8-a036-33ac447e668d"
}
],
"report": {
"counterparty": {
"name": "<string>"
},
"counterpartyId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"createdAt": "2023-11-07T05:31:56Z",
"decidedAt": "2023-11-07T05:31:56Z",
"decidedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"decider": {
"name": "<string>"
},
"engagement": {
"name": "<string>"
},
"engagementId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"engagements": [
{
"changes": 123,
"drafts": {
"disposition": "<string>",
"future": {},
"present": {},
"proposals": [
{
"allowance": "<string>",
"allowedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"allower": {
"name": "<string>"
},
"amended": [
"<string>"
],
"causedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"changedAt": "2023-11-07T05:31:56Z",
"changes": {},
"createdAt": "2023-11-07T05:31:56Z",
"decidedAt": "2023-11-07T05:31:56Z",
"decidedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"decider": {
"name": "<string>"
},
"entity": {
"name": "<string>"
},
"entityId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"entityType": "<string>",
"evidence": [
{
"eventId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"messageId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"quotes": [
"<string>"
],
"sealed": "<string>",
"stance": "<string>"
}
],
"heldByAgent": true,
"id": "248df4b7-aa70-47b8-a036-33ac447e668d",
"mine": true,
"op": "<string>",
"owner": {
"id": "248df4b7-aa70-47b8-a036-33ac447e668d",
"name": "<string>"
},
"proposal": {},
"rationale": "<string>",
"reason": "<string>",
"refs": {},
"related": {
"name": "<string>"
},
"relatedId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"revertedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"reverts": "248df4b7-aa70-47b8-a036-33ac447e668d",
"rule": {
"name": "<string>"
},
"ruleId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"source": "<string>",
"status": "<string>",
"supersededBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"user": {
"name": "<string>"
},
"userId": "248df4b7-aa70-47b8-a036-33ac447e668d"
}
],
"refs": {}
},
"engagement": {
"name": "<string>"
},
"engagementId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"threadIds": [
"248df4b7-aa70-47b8-a036-33ac447e668d"
]
}
],
"fields": {},
"id": "248df4b7-aa70-47b8-a036-33ac447e668d",
"keyContacts": [
{
"id": "248df4b7-aa70-47b8-a036-33ac447e668d",
"name": "<string>"
}
],
"meetingAddress": "<string>",
"mine": true,
"movedAt": "2023-11-07T05:31:56Z",
"open": true,
"periodEnd": "2023-11-07T05:31:56Z",
"periodStart": "2023-11-07T05:31:56Z",
"type": "counterparty",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"code": 123,
"context": {},
"error": "<string>",
"status": "<string>"
}{
"code": 123,
"context": {},
"error": "<string>",
"status": "<string>"
}{
"code": 123,
"context": {},
"error": "<string>",
"status": "<string>"
}{
"code": 123,
"context": {},
"error": "<string>",
"status": "<string>"
}{
"code": 123,
"context": {},
"error": "<string>",
"status": "<string>"
}{
"code": 123,
"context": {},
"error": "<string>",
"status": "<string>"
}Reports
Process a Report
Marks the report reviewed: decides its drafts, on any of its deals — approve, amend or reject each — and closes the report over them, in one transaction. No decisions closes it as it stands. The close is the counterparty’s checkpoint, for all its deals: the agent’s next change on one of them after it, or the next draft, opens the counterparty’s next report, listing every change since. A draft proposed while you read, or left undecided, stays open and starts the next report. An owner or admin of the organization only, signed in or with their own API key. An organization’s API key acts as an agent, and is refused.
POST
/
organization
/
{organizationId}
/
reports
/
{reportId}
/
decide
Process a Report
curl --request POST \
--url https://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"decisions": [
{
"mutationId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"amend": {},
"reason": "<string>",
"reject": true
}
]
}
'import requests
url = "https://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide"
payload = { "decisions": [
{
"mutationId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"amend": {},
"reason": "<string>",
"reject": True
}
] }
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({
decisions: [
{
mutationId: '248df4b7-aa70-47b8-a036-33ac447e668d',
amend: {},
reason: '<string>',
reject: true
}
]
})
};
fetch('https://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide', 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://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide",
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([
'decisions' => [
[
'mutationId' => '248df4b7-aa70-47b8-a036-33ac447e668d',
'amend' => [
],
'reason' => '<string>',
'reject' => true
]
]
]),
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://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide"
payload := strings.NewReader("{\n \"decisions\": [\n {\n \"mutationId\": \"248df4b7-aa70-47b8-a036-33ac447e668d\",\n \"amend\": {},\n \"reason\": \"<string>\",\n \"reject\": true\n }\n ]\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://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"decisions\": [\n {\n \"mutationId\": \"248df4b7-aa70-47b8-a036-33ac447e668d\",\n \"amend\": {},\n \"reason\": \"<string>\",\n \"reject\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sonar.turtle.xyz/v1/organization/{organizationId}/reports/{reportId}/decide")
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 \"decisions\": [\n {\n \"mutationId\": \"248df4b7-aa70-47b8-a036-33ac447e668d\",\n \"amend\": {},\n \"reason\": \"<string>\",\n \"reject\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"mutations": [
{
"allowance": "<string>",
"allowedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"allower": {
"name": "<string>"
},
"amended": [
"<string>"
],
"causedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"changedAt": "2023-11-07T05:31:56Z",
"changes": {},
"createdAt": "2023-11-07T05:31:56Z",
"decidedAt": "2023-11-07T05:31:56Z",
"decidedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"decider": {
"name": "<string>"
},
"entity": {
"name": "<string>"
},
"entityId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"entityType": "<string>",
"evidence": [
{
"eventId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"messageId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"quotes": [
"<string>"
],
"sealed": "<string>",
"stance": "<string>"
}
],
"heldByAgent": true,
"id": "248df4b7-aa70-47b8-a036-33ac447e668d",
"mine": true,
"op": "<string>",
"owner": {
"id": "248df4b7-aa70-47b8-a036-33ac447e668d",
"name": "<string>"
},
"proposal": {},
"rationale": "<string>",
"reason": "<string>",
"refs": {},
"related": {
"name": "<string>"
},
"relatedId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"revertedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"reverts": "248df4b7-aa70-47b8-a036-33ac447e668d",
"rule": {
"name": "<string>"
},
"ruleId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"source": "<string>",
"status": "<string>",
"supersededBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"user": {
"name": "<string>"
},
"userId": "248df4b7-aa70-47b8-a036-33ac447e668d"
}
],
"report": {
"counterparty": {
"name": "<string>"
},
"counterpartyId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"createdAt": "2023-11-07T05:31:56Z",
"decidedAt": "2023-11-07T05:31:56Z",
"decidedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"decider": {
"name": "<string>"
},
"engagement": {
"name": "<string>"
},
"engagementId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"engagements": [
{
"changes": 123,
"drafts": {
"disposition": "<string>",
"future": {},
"present": {},
"proposals": [
{
"allowance": "<string>",
"allowedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"allower": {
"name": "<string>"
},
"amended": [
"<string>"
],
"causedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"changedAt": "2023-11-07T05:31:56Z",
"changes": {},
"createdAt": "2023-11-07T05:31:56Z",
"decidedAt": "2023-11-07T05:31:56Z",
"decidedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"decider": {
"name": "<string>"
},
"entity": {
"name": "<string>"
},
"entityId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"entityType": "<string>",
"evidence": [
{
"eventId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"messageId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"quotes": [
"<string>"
],
"sealed": "<string>",
"stance": "<string>"
}
],
"heldByAgent": true,
"id": "248df4b7-aa70-47b8-a036-33ac447e668d",
"mine": true,
"op": "<string>",
"owner": {
"id": "248df4b7-aa70-47b8-a036-33ac447e668d",
"name": "<string>"
},
"proposal": {},
"rationale": "<string>",
"reason": "<string>",
"refs": {},
"related": {
"name": "<string>"
},
"relatedId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"revertedBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"reverts": "248df4b7-aa70-47b8-a036-33ac447e668d",
"rule": {
"name": "<string>"
},
"ruleId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"source": "<string>",
"status": "<string>",
"supersededBy": "248df4b7-aa70-47b8-a036-33ac447e668d",
"user": {
"name": "<string>"
},
"userId": "248df4b7-aa70-47b8-a036-33ac447e668d"
}
],
"refs": {}
},
"engagement": {
"name": "<string>"
},
"engagementId": "248df4b7-aa70-47b8-a036-33ac447e668d",
"threadIds": [
"248df4b7-aa70-47b8-a036-33ac447e668d"
]
}
],
"fields": {},
"id": "248df4b7-aa70-47b8-a036-33ac447e668d",
"keyContacts": [
{
"id": "248df4b7-aa70-47b8-a036-33ac447e668d",
"name": "<string>"
}
],
"meetingAddress": "<string>",
"mine": true,
"movedAt": "2023-11-07T05:31:56Z",
"open": true,
"periodEnd": "2023-11-07T05:31:56Z",
"periodStart": "2023-11-07T05:31:56Z",
"type": "counterparty",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"code": 123,
"context": {},
"error": "<string>",
"status": "<string>"
}{
"code": 123,
"context": {},
"error": "<string>",
"status": "<string>"
}{
"code": 123,
"context": {},
"error": "<string>",
"status": "<string>"
}{
"code": 123,
"context": {},
"error": "<string>",
"status": "<string>"
}{
"code": 123,
"context": {},
"error": "<string>",
"status": "<string>"
}{
"code": 123,
"context": {},
"error": "<string>",
"status": "<string>"
}Authorizations
bearerAuthapiKeyAuth
Path Parameters
Body
application/json

