Get reports for an organization
curl --request POST \
--url https://app.chainpatrol.io/api/v2/public/getOrganizationReports \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"slug": "<string>",
"limit": 10.5,
"cursor": 123,
"searchQuery": "<string>",
"reporterQuery": "<string>",
"excludeAutomation": false,
"onlyRejected": false,
"reviewStatuses": [],
"reviewedByUserId": 123,
"startDate": "<string>",
"endDate": "<string>",
"brandIds": [
123
]
}
'import requests
url = "https://app.chainpatrol.io/api/v2/public/getOrganizationReports"
payload = {
"slug": "<string>",
"limit": 10.5,
"cursor": 123,
"searchQuery": "<string>",
"reporterQuery": "<string>",
"excludeAutomation": False,
"onlyRejected": False,
"reviewStatuses": [],
"reviewedByUserId": 123,
"startDate": "<string>",
"endDate": "<string>",
"brandIds": [123]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
slug: '<string>',
limit: 10.5,
cursor: 123,
searchQuery: '<string>',
reporterQuery: '<string>',
excludeAutomation: false,
onlyRejected: false,
reviewStatuses: [],
reviewedByUserId: 123,
startDate: '<string>',
endDate: '<string>',
brandIds: [123]
})
};
fetch('https://app.chainpatrol.io/api/v2/public/getOrganizationReports', 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://app.chainpatrol.io/api/v2/public/getOrganizationReports",
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([
'slug' => '<string>',
'limit' => 10.5,
'cursor' => 123,
'searchQuery' => '<string>',
'reporterQuery' => '<string>',
'excludeAutomation' => false,
'onlyRejected' => false,
'reviewStatuses' => [
],
'reviewedByUserId' => 123,
'startDate' => '<string>',
'endDate' => '<string>',
'brandIds' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <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://app.chainpatrol.io/api/v2/public/getOrganizationReports"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"limit\": 10.5,\n \"cursor\": 123,\n \"searchQuery\": \"<string>\",\n \"reporterQuery\": \"<string>\",\n \"excludeAutomation\": false,\n \"onlyRejected\": false,\n \"reviewStatuses\": [],\n \"reviewedByUserId\": 123,\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"brandIds\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://app.chainpatrol.io/api/v2/public/getOrganizationReports")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"limit\": 10.5,\n \"cursor\": 123,\n \"searchQuery\": \"<string>\",\n \"reporterQuery\": \"<string>\",\n \"excludeAutomation\": false,\n \"onlyRejected\": false,\n \"reviewStatuses\": [],\n \"reviewedByUserId\": 123,\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"brandIds\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.chainpatrol.io/api/v2/public/getOrganizationReports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"limit\": 10.5,\n \"cursor\": 123,\n \"searchQuery\": \"<string>\",\n \"reporterQuery\": \"<string>\",\n \"excludeAutomation\": false,\n \"onlyRejected\": false,\n \"reviewStatuses\": [],\n \"reviewedByUserId\": 123,\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"brandIds\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"reports": [
{
"id": 123,
"title": "<string>",
"description": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"attachments": [
{
"id": 123,
"url": "<string>"
}
],
"proposals": [
{
"asset": {
"id": 123,
"content": "<string>",
"scans": [
{
"id": 123,
"createdAt": "<string>",
"enrichments": [
{
"id": 123,
"type": "<string>",
"status": "<string>",
"output": null
}
],
"output": null
}
]
}
}
],
"reporter": {
"id": 123,
"fullName": "<string>",
"avatarUrl": "<string>"
},
"externalReporter": {
"id": 123,
"displayName": "<string>",
"avatarUrl": "<string>",
"platform": "<string>"
}
}
],
"nextCursor": 123
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Organization Reports
Get Organization Reports (Deprecated)
Get reports for an organization based on organization slug and filters
POST
/
public
/
getOrganizationReports
Get reports for an organization
curl --request POST \
--url https://app.chainpatrol.io/api/v2/public/getOrganizationReports \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"slug": "<string>",
"limit": 10.5,
"cursor": 123,
"searchQuery": "<string>",
"reporterQuery": "<string>",
"excludeAutomation": false,
"onlyRejected": false,
"reviewStatuses": [],
"reviewedByUserId": 123,
"startDate": "<string>",
"endDate": "<string>",
"brandIds": [
123
]
}
'import requests
url = "https://app.chainpatrol.io/api/v2/public/getOrganizationReports"
payload = {
"slug": "<string>",
"limit": 10.5,
"cursor": 123,
"searchQuery": "<string>",
"reporterQuery": "<string>",
"excludeAutomation": False,
"onlyRejected": False,
"reviewStatuses": [],
"reviewedByUserId": 123,
"startDate": "<string>",
"endDate": "<string>",
"brandIds": [123]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
slug: '<string>',
limit: 10.5,
cursor: 123,
searchQuery: '<string>',
reporterQuery: '<string>',
excludeAutomation: false,
onlyRejected: false,
reviewStatuses: [],
reviewedByUserId: 123,
startDate: '<string>',
endDate: '<string>',
brandIds: [123]
})
};
fetch('https://app.chainpatrol.io/api/v2/public/getOrganizationReports', 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://app.chainpatrol.io/api/v2/public/getOrganizationReports",
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([
'slug' => '<string>',
'limit' => 10.5,
'cursor' => 123,
'searchQuery' => '<string>',
'reporterQuery' => '<string>',
'excludeAutomation' => false,
'onlyRejected' => false,
'reviewStatuses' => [
],
'reviewedByUserId' => 123,
'startDate' => '<string>',
'endDate' => '<string>',
'brandIds' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <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://app.chainpatrol.io/api/v2/public/getOrganizationReports"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"limit\": 10.5,\n \"cursor\": 123,\n \"searchQuery\": \"<string>\",\n \"reporterQuery\": \"<string>\",\n \"excludeAutomation\": false,\n \"onlyRejected\": false,\n \"reviewStatuses\": [],\n \"reviewedByUserId\": 123,\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"brandIds\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://app.chainpatrol.io/api/v2/public/getOrganizationReports")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"limit\": 10.5,\n \"cursor\": 123,\n \"searchQuery\": \"<string>\",\n \"reporterQuery\": \"<string>\",\n \"excludeAutomation\": false,\n \"onlyRejected\": false,\n \"reviewStatuses\": [],\n \"reviewedByUserId\": 123,\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"brandIds\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.chainpatrol.io/api/v2/public/getOrganizationReports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"limit\": 10.5,\n \"cursor\": 123,\n \"searchQuery\": \"<string>\",\n \"reporterQuery\": \"<string>\",\n \"excludeAutomation\": false,\n \"onlyRejected\": false,\n \"reviewStatuses\": [],\n \"reviewedByUserId\": 123,\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"brandIds\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"reports": [
{
"id": 123,
"title": "<string>",
"description": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"attachments": [
{
"id": 123,
"url": "<string>"
}
],
"proposals": [
{
"asset": {
"id": 123,
"content": "<string>",
"scans": [
{
"id": 123,
"createdAt": "<string>",
"enrichments": [
{
"id": 123,
"type": "<string>",
"status": "<string>",
"output": null
}
],
"output": null
}
]
}
}
],
"reporter": {
"id": 123,
"fullName": "<string>",
"avatarUrl": "<string>"
},
"externalReporter": {
"id": 123,
"displayName": "<string>",
"avatarUrl": "<string>",
"platform": "<string>"
}
}
],
"nextCursor": 123
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}This endpoint is deprecated. Please use the new RESTful endpoint GET /organization/reports instead. This endpoint will be removed in a future version.
Quick Start
Authentication
Include your API key in theX-API-KEY header:
X-API-KEY: <api-key>
Pagination
Make sure to use thelimit and cursor parameters to paginate through the results.
Filtering
Dates
When filtering by dates you need to provide both thestartDate and endDate parameters.
Only Rejected
You can filter for only reports with a rejected proposals by setting theonlyRejected parameter to true.
The reports returned will have proposals inside, however not all proposals will be rejected, as a report can have multiple proposals inside, and some may be rejected while others are approved. So you need to look through the data if you want only rejected proposals.Authorizations
Your API key. This is required by most endpoints to access our API programatically. Reach out to us at support@chainpatrol.io to get an API key for your use.
Body
application/json
Required range:
1 <= x <= 20Available options:
TODO, IN_PROGRESS, CLOSED Available options:
APPROVE, REJECT, SKIP, ESCALATE Was this page helpful?
⌘I