curl --request POST \
--url https://api.trustblock.run/v1/audit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"conductedAt": 123,
"project": {
"name": "<string>",
"links": {
"website": "<string>",
"twitter": "<string>",
"discord": "<string>",
"telegram": "<string>",
"github": "<string>",
"youtube": "<string>",
"linkedIn": "<string>"
},
"tags": [],
"chains": [],
"email": "<string>"
},
"contracts": [
{
"type": "onChain",
"address": "<string>"
}
],
"issues": [
{
"name": "<string>",
"description": "<string>"
}
],
"reportFileCid": "<string>",
"reportUrl": "<string>",
"aggregationId": "<string>"
}
'import requests
url = "https://api.trustblock.run/v1/audit"
payload = {
"name": "<string>",
"description": "<string>",
"conductedAt": 123,
"project": {
"name": "<string>",
"links": {
"website": "<string>",
"twitter": "<string>",
"discord": "<string>",
"telegram": "<string>",
"github": "<string>",
"youtube": "<string>",
"linkedIn": "<string>"
},
"tags": [],
"chains": [],
"email": "<string>"
},
"contracts": [
{
"type": "onChain",
"address": "<string>"
}
],
"issues": [
{
"name": "<string>",
"description": "<string>"
}
],
"reportFileCid": "<string>",
"reportUrl": "<string>",
"aggregationId": "<string>"
}
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({
name: '<string>',
description: '<string>',
conductedAt: 123,
project: {
name: '<string>',
links: {
website: '<string>',
twitter: '<string>',
discord: '<string>',
telegram: '<string>',
github: '<string>',
youtube: '<string>',
linkedIn: '<string>'
},
tags: [],
chains: [],
email: '<string>'
},
contracts: [{type: 'onChain', address: '<string>'}],
issues: [{name: '<string>', description: '<string>'}],
reportFileCid: '<string>',
reportUrl: '<string>',
aggregationId: '<string>'
})
};
fetch('https://api.trustblock.run/v1/audit', 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.trustblock.run/v1/audit",
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([
'name' => '<string>',
'description' => '<string>',
'conductedAt' => 123,
'project' => [
'name' => '<string>',
'links' => [
'website' => '<string>',
'twitter' => '<string>',
'discord' => '<string>',
'telegram' => '<string>',
'github' => '<string>',
'youtube' => '<string>',
'linkedIn' => '<string>'
],
'tags' => [
],
'chains' => [
],
'email' => '<string>'
],
'contracts' => [
[
'type' => 'onChain',
'address' => '<string>'
]
],
'issues' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'reportFileCid' => '<string>',
'reportUrl' => '<string>',
'aggregationId' => '<string>'
]),
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.trustblock.run/v1/audit"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conductedAt\": 123,\n \"project\": {\n \"name\": \"<string>\",\n \"links\": {\n \"website\": \"<string>\",\n \"twitter\": \"<string>\",\n \"discord\": \"<string>\",\n \"telegram\": \"<string>\",\n \"github\": \"<string>\",\n \"youtube\": \"<string>\",\n \"linkedIn\": \"<string>\"\n },\n \"tags\": [],\n \"chains\": [],\n \"email\": \"<string>\"\n },\n \"contracts\": [\n {\n \"type\": \"onChain\",\n \"address\": \"<string>\"\n }\n ],\n \"issues\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"reportFileCid\": \"<string>\",\n \"reportUrl\": \"<string>\",\n \"aggregationId\": \"<string>\"\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.trustblock.run/v1/audit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conductedAt\": 123,\n \"project\": {\n \"name\": \"<string>\",\n \"links\": {\n \"website\": \"<string>\",\n \"twitter\": \"<string>\",\n \"discord\": \"<string>\",\n \"telegram\": \"<string>\",\n \"github\": \"<string>\",\n \"youtube\": \"<string>\",\n \"linkedIn\": \"<string>\"\n },\n \"tags\": [],\n \"chains\": [],\n \"email\": \"<string>\"\n },\n \"contracts\": [\n {\n \"type\": \"onChain\",\n \"address\": \"<string>\"\n }\n ],\n \"issues\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"reportFileCid\": \"<string>\",\n \"reportUrl\": \"<string>\",\n \"aggregationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trustblock.run/v1/audit")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conductedAt\": 123,\n \"project\": {\n \"name\": \"<string>\",\n \"links\": {\n \"website\": \"<string>\",\n \"twitter\": \"<string>\",\n \"discord\": \"<string>\",\n \"telegram\": \"<string>\",\n \"github\": \"<string>\",\n \"youtube\": \"<string>\",\n \"linkedIn\": \"<string>\"\n },\n \"tags\": [],\n \"chains\": [],\n \"email\": \"<string>\"\n },\n \"contracts\": [\n {\n \"type\": \"onChain\",\n \"address\": \"<string>\"\n }\n ],\n \"issues\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"reportFileCid\": \"<string>\",\n \"reportUrl\": \"<string>\",\n \"aggregationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"extra": {
"requestId": "<string>"
}
}{
"message": "Not found.",
"extra": {
"requestId": "<string>"
},
"code": "<string>",
"diagnoses": [
{}
]
}{
"message": "Not found.",
"extra": {
"requestId": "<string>"
},
"code": "<string>",
"diagnoses": [
{}
]
}Publish an audit
Trustblock API route to create a new audit
curl --request POST \
--url https://api.trustblock.run/v1/audit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"conductedAt": 123,
"project": {
"name": "<string>",
"links": {
"website": "<string>",
"twitter": "<string>",
"discord": "<string>",
"telegram": "<string>",
"github": "<string>",
"youtube": "<string>",
"linkedIn": "<string>"
},
"tags": [],
"chains": [],
"email": "<string>"
},
"contracts": [
{
"type": "onChain",
"address": "<string>"
}
],
"issues": [
{
"name": "<string>",
"description": "<string>"
}
],
"reportFileCid": "<string>",
"reportUrl": "<string>",
"aggregationId": "<string>"
}
'import requests
url = "https://api.trustblock.run/v1/audit"
payload = {
"name": "<string>",
"description": "<string>",
"conductedAt": 123,
"project": {
"name": "<string>",
"links": {
"website": "<string>",
"twitter": "<string>",
"discord": "<string>",
"telegram": "<string>",
"github": "<string>",
"youtube": "<string>",
"linkedIn": "<string>"
},
"tags": [],
"chains": [],
"email": "<string>"
},
"contracts": [
{
"type": "onChain",
"address": "<string>"
}
],
"issues": [
{
"name": "<string>",
"description": "<string>"
}
],
"reportFileCid": "<string>",
"reportUrl": "<string>",
"aggregationId": "<string>"
}
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({
name: '<string>',
description: '<string>',
conductedAt: 123,
project: {
name: '<string>',
links: {
website: '<string>',
twitter: '<string>',
discord: '<string>',
telegram: '<string>',
github: '<string>',
youtube: '<string>',
linkedIn: '<string>'
},
tags: [],
chains: [],
email: '<string>'
},
contracts: [{type: 'onChain', address: '<string>'}],
issues: [{name: '<string>', description: '<string>'}],
reportFileCid: '<string>',
reportUrl: '<string>',
aggregationId: '<string>'
})
};
fetch('https://api.trustblock.run/v1/audit', 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.trustblock.run/v1/audit",
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([
'name' => '<string>',
'description' => '<string>',
'conductedAt' => 123,
'project' => [
'name' => '<string>',
'links' => [
'website' => '<string>',
'twitter' => '<string>',
'discord' => '<string>',
'telegram' => '<string>',
'github' => '<string>',
'youtube' => '<string>',
'linkedIn' => '<string>'
],
'tags' => [
],
'chains' => [
],
'email' => '<string>'
],
'contracts' => [
[
'type' => 'onChain',
'address' => '<string>'
]
],
'issues' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'reportFileCid' => '<string>',
'reportUrl' => '<string>',
'aggregationId' => '<string>'
]),
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.trustblock.run/v1/audit"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conductedAt\": 123,\n \"project\": {\n \"name\": \"<string>\",\n \"links\": {\n \"website\": \"<string>\",\n \"twitter\": \"<string>\",\n \"discord\": \"<string>\",\n \"telegram\": \"<string>\",\n \"github\": \"<string>\",\n \"youtube\": \"<string>\",\n \"linkedIn\": \"<string>\"\n },\n \"tags\": [],\n \"chains\": [],\n \"email\": \"<string>\"\n },\n \"contracts\": [\n {\n \"type\": \"onChain\",\n \"address\": \"<string>\"\n }\n ],\n \"issues\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"reportFileCid\": \"<string>\",\n \"reportUrl\": \"<string>\",\n \"aggregationId\": \"<string>\"\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.trustblock.run/v1/audit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conductedAt\": 123,\n \"project\": {\n \"name\": \"<string>\",\n \"links\": {\n \"website\": \"<string>\",\n \"twitter\": \"<string>\",\n \"discord\": \"<string>\",\n \"telegram\": \"<string>\",\n \"github\": \"<string>\",\n \"youtube\": \"<string>\",\n \"linkedIn\": \"<string>\"\n },\n \"tags\": [],\n \"chains\": [],\n \"email\": \"<string>\"\n },\n \"contracts\": [\n {\n \"type\": \"onChain\",\n \"address\": \"<string>\"\n }\n ],\n \"issues\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"reportFileCid\": \"<string>\",\n \"reportUrl\": \"<string>\",\n \"aggregationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trustblock.run/v1/audit")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conductedAt\": 123,\n \"project\": {\n \"name\": \"<string>\",\n \"links\": {\n \"website\": \"<string>\",\n \"twitter\": \"<string>\",\n \"discord\": \"<string>\",\n \"telegram\": \"<string>\",\n \"github\": \"<string>\",\n \"youtube\": \"<string>\",\n \"linkedIn\": \"<string>\"\n },\n \"tags\": [],\n \"chains\": [],\n \"email\": \"<string>\"\n },\n \"contracts\": [\n {\n \"type\": \"onChain\",\n \"address\": \"<string>\"\n }\n ],\n \"issues\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"reportFileCid\": \"<string>\",\n \"reportUrl\": \"<string>\",\n \"aggregationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"extra": {
"requestId": "<string>"
}
}{
"message": "Not found.",
"extra": {
"requestId": "<string>"
},
"code": "<string>",
"diagnoses": [
{}
]
}{
"message": "Not found.",
"extra": {
"requestId": "<string>"
},
"code": "<string>",
"diagnoses": [
{}
]
}Authorizations
Authorization: Bearer <key>.
For the project and card routes, the key is an API key belonging to an onboarded integrator or
to an active audit provider. The publishing routes accept only an audit provider's credential.
Sending no Authorization header produces 401; sending one that is not recognised produces
403.
Body
Milliseconds since the Unix epoch, of when the audit was conducted. Rejected if earlier than 2008-01-01 or later than the moment the request is handled.
file requires reportFileCid, obtained by uploading through the authorization route.
web requires reportUrl, a link to the provider's own published report.
file, web Show child attributes
Show child attributes
1- On-chain contract
- Public repository contract
- Private repository contract
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required when reportType is file.
Required when reportType is web.
Required for providers whose publishing mode is automatic or aggregated, and rejected for providers publishing manually.