curl --request POST \
--url https://app.blockgence.com/v1/incident \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"chain": "ethereum",
"exploit_tx": "<string>",
"victim": "<string>",
"addresses": [
"<string>"
],
"addresses_source": "<string>",
"hops": 2,
"fanout": 4,
"since": 0,
"window_days": 123,
"max_credits": 200,
"name": "<string>",
"watch": {
"create": true,
"follow_hops": true,
"shared": false
},
"protocol_addresses": [
{
"address": "<string>",
"source": "<string>",
"role": "protocol"
}
]
}
'import requests
url = "https://app.blockgence.com/v1/incident"
payload = {
"chain": "ethereum",
"exploit_tx": "<string>",
"victim": "<string>",
"addresses": ["<string>"],
"addresses_source": "<string>",
"hops": 2,
"fanout": 4,
"since": 0,
"window_days": 123,
"max_credits": 200,
"name": "<string>",
"watch": {
"create": True,
"follow_hops": True,
"shared": False
},
"protocol_addresses": [
{
"address": "<string>",
"source": "<string>",
"role": "protocol"
}
]
}
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({
chain: 'ethereum',
exploit_tx: '<string>',
victim: '<string>',
addresses: ['<string>'],
addresses_source: '<string>',
hops: 2,
fanout: 4,
since: 0,
window_days: 123,
max_credits: 200,
name: '<string>',
watch: {create: true, follow_hops: true, shared: false},
protocol_addresses: [{address: '<string>', source: '<string>', role: 'protocol'}]
})
};
fetch('https://app.blockgence.com/v1/incident', 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.blockgence.com/v1/incident",
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([
'chain' => 'ethereum',
'exploit_tx' => '<string>',
'victim' => '<string>',
'addresses' => [
'<string>'
],
'addresses_source' => '<string>',
'hops' => 2,
'fanout' => 4,
'since' => 0,
'window_days' => 123,
'max_credits' => 200,
'name' => '<string>',
'watch' => [
'create' => true,
'follow_hops' => true,
'shared' => false
],
'protocol_addresses' => [
[
'address' => '<string>',
'source' => '<string>',
'role' => 'protocol'
]
]
]),
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.blockgence.com/v1/incident"
payload := strings.NewReader("{\n \"chain\": \"ethereum\",\n \"exploit_tx\": \"<string>\",\n \"victim\": \"<string>\",\n \"addresses\": [\n \"<string>\"\n ],\n \"addresses_source\": \"<string>\",\n \"hops\": 2,\n \"fanout\": 4,\n \"since\": 0,\n \"window_days\": 123,\n \"max_credits\": 200,\n \"name\": \"<string>\",\n \"watch\": {\n \"create\": true,\n \"follow_hops\": true,\n \"shared\": false\n },\n \"protocol_addresses\": [\n {\n \"address\": \"<string>\",\n \"source\": \"<string>\",\n \"role\": \"protocol\"\n }\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.blockgence.com/v1/incident")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"ethereum\",\n \"exploit_tx\": \"<string>\",\n \"victim\": \"<string>\",\n \"addresses\": [\n \"<string>\"\n ],\n \"addresses_source\": \"<string>\",\n \"hops\": 2,\n \"fanout\": 4,\n \"since\": 0,\n \"window_days\": 123,\n \"max_credits\": 200,\n \"name\": \"<string>\",\n \"watch\": {\n \"create\": true,\n \"follow_hops\": true,\n \"shared\": false\n },\n \"protocol_addresses\": [\n {\n \"address\": \"<string>\",\n \"source\": \"<string>\",\n \"role\": \"protocol\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blockgence.com/v1/incident")
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 \"chain\": \"ethereum\",\n \"exploit_tx\": \"<string>\",\n \"victim\": \"<string>\",\n \"addresses\": [\n \"<string>\"\n ],\n \"addresses_source\": \"<string>\",\n \"hops\": 2,\n \"fanout\": 4,\n \"since\": 0,\n \"window_days\": 123,\n \"max_credits\": 200,\n \"name\": \"<string>\",\n \"watch\": {\n \"create\": true,\n \"follow_hops\": true,\n \"shared\": false\n },\n \"protocol_addresses\": [\n {\n \"address\": \"<string>\",\n \"source\": \"<string>\",\n \"role\": \"protocol\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"detail": "<string>",
"error": "<string>"
}{
"detail": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<string>",
"error": "<string>"
}{
"error": "source_unavailable",
"detail": "<string>",
"source": "<string>",
"reason": "<string>",
"retryable": true,
"chain": "<string>",
"primitive": "<string>",
"operation": "<string>",
"target": "<string>",
"http_status": 123,
"retry_after": 123,
"upstream_message": "<string>",
"source_fault": true,
"failure_cause": "<string>"
}Iniciar el playbook de incidente
Crea una tarea asíncrona que analiza un incidente y deja armado el caso en un solo pedido. Responde 202 con el
job_id; el avance se consulta en GET /v1/incident/{job_id}.
Cuerpo del pedido, con una sola entrada entre exploit_tx, victim y addresses:
chain: red EVM (por defectoethereum);exploit_tx: transacción del exploit;victim: dirección de la víctima; el rastro sale de ella;addresses: hasta 60 direcciones del atacante, conaddresses_sourceobligatorio (de dónde sale la lista). La atribución es de esa fuente, no de blockgence;hops(de 1 a 5, por defecto 2) yfanout(de 1 a 10, por defecto 4): saltos y ramas por nodo del rastreo. Un valor fuera de rango se ajusta al extremo;since: desde cuándo seguir los fondos (unix), convictimoaddresses;window_days: días de la ventana del rastreo desde la fecha del exploit o desdesince. Conexploit_tx, 30 por defecto y hasta 180;0significa sin límite. Convictimoaddressesrequieresince;max_credits: tope de créditos de los pasos, sin la orquestación (por defecto 200, hasta 5,000);name: nombre del caso;watch:{create, follow_hops, shared}, para crear en Guard una vigilancia por cada cuenta del atacante. Sinwatch, las vigilancias solo se ofrecen;protocol_addresses: hasta 20 direcciones del protocolo,{address, role, source}, para reconocer devoluciones.
Los pasos, en orden, son decode, attacker, stolen, trace (en tandas de hasta 5 semillas), freeze,
case, postmortem y watchlist. Cada uno termina ok, skipped o error, con su motivo, su evidencia y
los créditos que costó (credits).
La orquestación se cobra al crear la tarea, y cada paso que termina bien se cobra aparte. Un paso que falla no
se cobra. Si los créditos del mes o max_credits no alcanzan para un paso, ese paso sale skipped y la tarea
sigue sin él.
El mismo pedido de la misma clave de API dentro de las 24 horas devuelve esa tarea (200,
idempotent_replay: true) sin cobro, salvo que haya terminado en error, se haya interrumpido o su caso se haya
borrado. Se admiten hasta 2 tareas en curso por clave de API; por encima de eso, la respuesta es 429 sin cobro.
Un pedido inválido responde 400 sin cobro.
Costo: 40 créditos al crear la tarea, y aparte cada paso que termina bien, hasta el tope de max_credits del pedido. Un paso que falla no se cobra. Repetir el mismo pedido devuelve la tarea que ya existe, sin cobro.
curl --request POST \
--url https://app.blockgence.com/v1/incident \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"chain": "ethereum",
"exploit_tx": "<string>",
"victim": "<string>",
"addresses": [
"<string>"
],
"addresses_source": "<string>",
"hops": 2,
"fanout": 4,
"since": 0,
"window_days": 123,
"max_credits": 200,
"name": "<string>",
"watch": {
"create": true,
"follow_hops": true,
"shared": false
},
"protocol_addresses": [
{
"address": "<string>",
"source": "<string>",
"role": "protocol"
}
]
}
'import requests
url = "https://app.blockgence.com/v1/incident"
payload = {
"chain": "ethereum",
"exploit_tx": "<string>",
"victim": "<string>",
"addresses": ["<string>"],
"addresses_source": "<string>",
"hops": 2,
"fanout": 4,
"since": 0,
"window_days": 123,
"max_credits": 200,
"name": "<string>",
"watch": {
"create": True,
"follow_hops": True,
"shared": False
},
"protocol_addresses": [
{
"address": "<string>",
"source": "<string>",
"role": "protocol"
}
]
}
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({
chain: 'ethereum',
exploit_tx: '<string>',
victim: '<string>',
addresses: ['<string>'],
addresses_source: '<string>',
hops: 2,
fanout: 4,
since: 0,
window_days: 123,
max_credits: 200,
name: '<string>',
watch: {create: true, follow_hops: true, shared: false},
protocol_addresses: [{address: '<string>', source: '<string>', role: 'protocol'}]
})
};
fetch('https://app.blockgence.com/v1/incident', 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.blockgence.com/v1/incident",
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([
'chain' => 'ethereum',
'exploit_tx' => '<string>',
'victim' => '<string>',
'addresses' => [
'<string>'
],
'addresses_source' => '<string>',
'hops' => 2,
'fanout' => 4,
'since' => 0,
'window_days' => 123,
'max_credits' => 200,
'name' => '<string>',
'watch' => [
'create' => true,
'follow_hops' => true,
'shared' => false
],
'protocol_addresses' => [
[
'address' => '<string>',
'source' => '<string>',
'role' => 'protocol'
]
]
]),
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.blockgence.com/v1/incident"
payload := strings.NewReader("{\n \"chain\": \"ethereum\",\n \"exploit_tx\": \"<string>\",\n \"victim\": \"<string>\",\n \"addresses\": [\n \"<string>\"\n ],\n \"addresses_source\": \"<string>\",\n \"hops\": 2,\n \"fanout\": 4,\n \"since\": 0,\n \"window_days\": 123,\n \"max_credits\": 200,\n \"name\": \"<string>\",\n \"watch\": {\n \"create\": true,\n \"follow_hops\": true,\n \"shared\": false\n },\n \"protocol_addresses\": [\n {\n \"address\": \"<string>\",\n \"source\": \"<string>\",\n \"role\": \"protocol\"\n }\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.blockgence.com/v1/incident")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"ethereum\",\n \"exploit_tx\": \"<string>\",\n \"victim\": \"<string>\",\n \"addresses\": [\n \"<string>\"\n ],\n \"addresses_source\": \"<string>\",\n \"hops\": 2,\n \"fanout\": 4,\n \"since\": 0,\n \"window_days\": 123,\n \"max_credits\": 200,\n \"name\": \"<string>\",\n \"watch\": {\n \"create\": true,\n \"follow_hops\": true,\n \"shared\": false\n },\n \"protocol_addresses\": [\n {\n \"address\": \"<string>\",\n \"source\": \"<string>\",\n \"role\": \"protocol\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blockgence.com/v1/incident")
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 \"chain\": \"ethereum\",\n \"exploit_tx\": \"<string>\",\n \"victim\": \"<string>\",\n \"addresses\": [\n \"<string>\"\n ],\n \"addresses_source\": \"<string>\",\n \"hops\": 2,\n \"fanout\": 4,\n \"since\": 0,\n \"window_days\": 123,\n \"max_credits\": 200,\n \"name\": \"<string>\",\n \"watch\": {\n \"create\": true,\n \"follow_hops\": true,\n \"shared\": false\n },\n \"protocol_addresses\": [\n {\n \"address\": \"<string>\",\n \"source\": \"<string>\",\n \"role\": \"protocol\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"detail": "<string>",
"error": "<string>"
}{
"detail": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<string>",
"error": "<string>"
}{
"error": "source_unavailable",
"detail": "<string>",
"source": "<string>",
"reason": "<string>",
"retryable": true,
"chain": "<string>",
"primitive": "<string>",
"operation": "<string>",
"target": "<string>",
"http_status": 123,
"retry_after": 123,
"upstream_message": "<string>",
"source_fault": true,
"failure_cause": "<string>"
}Autorizaciones
Encabezados
Cuerpo
Respuesta
Tarea creada. La respuesta trae el job_id, el estado inicial de cada paso e idempotent_replay: false.