Create a new audit
curl --request POST \
--url https://api.trustblock.run/v1/audit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"reportFileCid": "<string>",
"reportType": "file",
"name": "<string>",
"description": "<string>",
"conductedAt": 123,
"project": {
"links": {
"website": "<string>",
"twitter": "<string>",
"discord": "<string>",
"telegram": "<string>",
"github": "<string>",
"youtube": "<string>",
"linkedIn": "<string>"
},
"name": "<string>",
"tags": [],
"chains": [],
"email": "<string>"
},
"contracts": [
{
"type": "onChain",
"chain": "<string>",
"address": "<string>"
}
],
"issues": [
{
"name": "<string>",
"description": "<string>",
"status": "<string>",
"severity": "<string>"
}
]
}
'import requests
url = "https://api.trustblock.run/v1/audit"
payload = {
"reportFileCid": "<string>",
"reportType": "file",
"name": "<string>",
"description": "<string>",
"conductedAt": 123,
"project": {
"links": {
"website": "<string>",
"twitter": "<string>",
"discord": "<string>",
"telegram": "<string>",
"github": "<string>",
"youtube": "<string>",
"linkedIn": "<string>"
},
"name": "<string>",
"tags": [],
"chains": [],
"email": "<string>"
},
"contracts": [
{
"type": "onChain",
"chain": "<string>",
"address": "<string>"
}
],
"issues": [
{
"name": "<string>",
"description": "<string>",
"status": "<string>",
"severity": "<string>"
}
]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
reportFileCid: '<string>',
reportType: 'file',
name: '<string>',
description: '<string>',
conductedAt: 123,
project: {
links: {
website: '<string>',
twitter: '<string>',
discord: '<string>',
telegram: '<string>',
github: '<string>',
youtube: '<string>',
linkedIn: '<string>'
},
name: '<string>',
tags: [],
chains: [],
email: '<string>'
},
contracts: [{type: 'onChain', chain: '<string>', address: '<string>'}],
issues: [
{
name: '<string>',
description: '<string>',
status: '<string>',
severity: '<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([
'reportFileCid' => '<string>',
'reportType' => 'file',
'name' => '<string>',
'description' => '<string>',
'conductedAt' => 123,
'project' => [
'links' => [
'website' => '<string>',
'twitter' => '<string>',
'discord' => '<string>',
'telegram' => '<string>',
'github' => '<string>',
'youtube' => '<string>',
'linkedIn' => '<string>'
],
'name' => '<string>',
'tags' => [
],
'chains' => [
],
'email' => '<string>'
],
'contracts' => [
[
'type' => 'onChain',
'chain' => '<string>',
'address' => '<string>'
]
],
'issues' => [
[
'name' => '<string>',
'description' => '<string>',
'status' => '<string>',
'severity' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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 \"reportFileCid\": \"<string>\",\n \"reportType\": \"file\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conductedAt\": 123,\n \"project\": {\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 \"name\": \"<string>\",\n \"tags\": [],\n \"chains\": [],\n \"email\": \"<string>\"\n },\n \"contracts\": [\n {\n \"type\": \"onChain\",\n \"chain\": \"<string>\",\n \"address\": \"<string>\"\n }\n ],\n \"issues\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"status\": \"<string>\",\n \"severity\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
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("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"reportFileCid\": \"<string>\",\n \"reportType\": \"file\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conductedAt\": 123,\n \"project\": {\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 \"name\": \"<string>\",\n \"tags\": [],\n \"chains\": [],\n \"email\": \"<string>\"\n },\n \"contracts\": [\n {\n \"type\": \"onChain\",\n \"chain\": \"<string>\",\n \"address\": \"<string>\"\n }\n ],\n \"issues\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"status\": \"<string>\",\n \"severity\": \"<string>\"\n }\n ]\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["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"reportFileCid\": \"<string>\",\n \"reportType\": \"file\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conductedAt\": 123,\n \"project\": {\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 \"name\": \"<string>\",\n \"tags\": [],\n \"chains\": [],\n \"email\": \"<string>\"\n },\n \"contracts\": [\n {\n \"type\": \"onChain\",\n \"chain\": \"<string>\",\n \"address\": \"<string>\"\n }\n ],\n \"issues\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"status\": \"<string>\",\n \"severity\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"extra": {
"requestId": "<string>"
},
"id": "<string>"
}Endpoints
Create a new audit
Trustblock API route to create a new audit
POST
/
v1
/
audit
Create a new audit
curl --request POST \
--url https://api.trustblock.run/v1/audit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"reportFileCid": "<string>",
"reportType": "file",
"name": "<string>",
"description": "<string>",
"conductedAt": 123,
"project": {
"links": {
"website": "<string>",
"twitter": "<string>",
"discord": "<string>",
"telegram": "<string>",
"github": "<string>",
"youtube": "<string>",
"linkedIn": "<string>"
},
"name": "<string>",
"tags": [],
"chains": [],
"email": "<string>"
},
"contracts": [
{
"type": "onChain",
"chain": "<string>",
"address": "<string>"
}
],
"issues": [
{
"name": "<string>",
"description": "<string>",
"status": "<string>",
"severity": "<string>"
}
]
}
'import requests
url = "https://api.trustblock.run/v1/audit"
payload = {
"reportFileCid": "<string>",
"reportType": "file",
"name": "<string>",
"description": "<string>",
"conductedAt": 123,
"project": {
"links": {
"website": "<string>",
"twitter": "<string>",
"discord": "<string>",
"telegram": "<string>",
"github": "<string>",
"youtube": "<string>",
"linkedIn": "<string>"
},
"name": "<string>",
"tags": [],
"chains": [],
"email": "<string>"
},
"contracts": [
{
"type": "onChain",
"chain": "<string>",
"address": "<string>"
}
],
"issues": [
{
"name": "<string>",
"description": "<string>",
"status": "<string>",
"severity": "<string>"
}
]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
reportFileCid: '<string>',
reportType: 'file',
name: '<string>',
description: '<string>',
conductedAt: 123,
project: {
links: {
website: '<string>',
twitter: '<string>',
discord: '<string>',
telegram: '<string>',
github: '<string>',
youtube: '<string>',
linkedIn: '<string>'
},
name: '<string>',
tags: [],
chains: [],
email: '<string>'
},
contracts: [{type: 'onChain', chain: '<string>', address: '<string>'}],
issues: [
{
name: '<string>',
description: '<string>',
status: '<string>',
severity: '<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([
'reportFileCid' => '<string>',
'reportType' => 'file',
'name' => '<string>',
'description' => '<string>',
'conductedAt' => 123,
'project' => [
'links' => [
'website' => '<string>',
'twitter' => '<string>',
'discord' => '<string>',
'telegram' => '<string>',
'github' => '<string>',
'youtube' => '<string>',
'linkedIn' => '<string>'
],
'name' => '<string>',
'tags' => [
],
'chains' => [
],
'email' => '<string>'
],
'contracts' => [
[
'type' => 'onChain',
'chain' => '<string>',
'address' => '<string>'
]
],
'issues' => [
[
'name' => '<string>',
'description' => '<string>',
'status' => '<string>',
'severity' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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 \"reportFileCid\": \"<string>\",\n \"reportType\": \"file\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conductedAt\": 123,\n \"project\": {\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 \"name\": \"<string>\",\n \"tags\": [],\n \"chains\": [],\n \"email\": \"<string>\"\n },\n \"contracts\": [\n {\n \"type\": \"onChain\",\n \"chain\": \"<string>\",\n \"address\": \"<string>\"\n }\n ],\n \"issues\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"status\": \"<string>\",\n \"severity\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
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("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"reportFileCid\": \"<string>\",\n \"reportType\": \"file\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conductedAt\": 123,\n \"project\": {\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 \"name\": \"<string>\",\n \"tags\": [],\n \"chains\": [],\n \"email\": \"<string>\"\n },\n \"contracts\": [\n {\n \"type\": \"onChain\",\n \"chain\": \"<string>\",\n \"address\": \"<string>\"\n }\n ],\n \"issues\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"status\": \"<string>\",\n \"severity\": \"<string>\"\n }\n ]\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["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"reportFileCid\": \"<string>\",\n \"reportType\": \"file\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conductedAt\": 123,\n \"project\": {\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 \"name\": \"<string>\",\n \"tags\": [],\n \"chains\": [],\n \"email\": \"<string>\"\n },\n \"contracts\": [\n {\n \"type\": \"onChain\",\n \"chain\": \"<string>\",\n \"address\": \"<string>\"\n }\n ],\n \"issues\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"status\": \"<string>\",\n \"severity\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"extra": {
"requestId": "<string>"
},
"id": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Available options:
application/json Body
application/json
- File Report
- Web Report
Available options:
file Show child attributes
Show child attributes
contracts
(On Chain Contract · object | Public Repository Contract · object | Private Repository Contract · object)[]
required
- On Chain Contract
- Public Repository Contract
- Private Repository Contract
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I