HTTP API

Consensus

POST/api/v1/consensus/challenges/{challenge_id}/resolve
POST
/api/v1/consensus/challenges/{challenge_id}/resolve

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

challenge_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/consensus/challenges/string/resolve" \  -H "Content-Type: application/json" \  -d '{    "decision": "uphold"  }'
{  "challenge_id": "string",  "determination": "undetermined",  "fact_id": "string",  "fact_status": "pending_validation",  "stake_returned": 0,  "status": "under_review",  "validators_rewarded": 0,  "validators_slashed": 0}
GET/api/v1/consensus/facts
GET
/api/v1/consensus/facts

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

q?string

Full-text search query applied to the fact statement

page?integer

1-indexed page number

Formatint64
Range0 <= value
page_size?integer

Page size

Formatint64
Range0 <= value
sort_by?string

Sort field (created_at, consensus_deadline)

sort_order?string

Sort order (asc or desc)

Value in

  • "asc"
  • "desc"
filter?array<string>

Additional filter expressions in the form field:operator:value

Response Body

application/json

curl -X GET "https://example.com/api/v1/consensus/facts"
{  "facts": [    {      "category": "string",      "consensus_deadline": "2019-08-24T14:15:22Z",      "consensus_reached_at": "2019-08-24T14:15:22Z",      "created_at": "2019-08-24T14:15:22Z",      "determination": "undetermined",      "evidence": {},      "fact_id": "string",      "phase": "proposal",      "proposed_by": "string",      "statement": "string",      "status": "pending_validation"    }  ],  "pagination": {    "has_more": true,    "page": 0,    "page_size": 0,    "total": 0  }}
POST/api/v1/consensus/facts
POST
/api/v1/consensus/facts

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/consensus/facts" \  -H "Content-Type: application/json" \  -d '{    "category": "string",    "statement": "string"  }'
{  "consensus_deadline": "2019-08-24T14:15:22Z",  "current_validators": 0,  "fact_id": "string",  "proposed_at": "2019-08-24T14:15:22Z",  "required_validators": 0,  "statement": "string",  "status": "pending_validation"}
GET/api/v1/consensus/facts/{fact_id}
GET
/api/v1/consensus/facts/{fact_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

fact_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/consensus/facts/string"
{  "category": "string",  "consensus_deadline": "2019-08-24T14:15:22Z",  "consensus_reached_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "determination": "undetermined",  "evidence": {},  "fact_id": "string",  "phase": "proposal",  "proposed_by": "string",  "statement": "string",  "status": "pending_validation"}
POST/api/v1/consensus/facts/{fact_id}/attest
POST
/api/v1/consensus/facts/{fact_id}/attest

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

fact_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/consensus/facts/string/attest" \  -H "Content-Type: application/json" \  -d '{    "confidence": 0.1,    "vote": "confirm"  }'
{  "attestation_id": "string",  "consensus_update": {    "confirm_weight": 0.1,    "current_consensus": "undetermined",    "deny_weight": 0.1,    "total_attestations": 0,    "unclear_weight": 0.1  },  "fact_id": "string",  "validator": "string",  "vote": "confirm",  "weight": 0.1}
POST/api/v1/consensus/facts/{fact_id}/challenge
POST
/api/v1/consensus/facts/{fact_id}/challenge

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

fact_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/consensus/facts/string/challenge" \  -H "Content-Type: application/json" \  -d '{    "reason": "string"  }'
{  "challenge_id": "string",  "challenger": "string",  "fact_id": "string",  "review_deadline": "2019-08-24T14:15:22Z",  "stake": 0,  "status": "under_review"}
GET/api/v1/consensus/facts/{fact_id}/status
GET
/api/v1/consensus/facts/{fact_id}/status

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

fact_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/consensus/facts/string/status"
{  "consensus_status": {    "attestations": {      "confirm": 0,      "deny": 0,      "total": 0,      "unclear": 0    },    "confidence": 0.1,    "determination": "undetermined",    "phase": "proposal",    "weighted_votes": {      "confirm": 0.1,      "deny": 0.1,      "unclear": 0.1    }  },  "fact_id": "string",  "geographic_distribution": {    "continents": 0,    "countries": 0,    "distribution_score": 0.1  },  "statement": "string",  "status": "pending_validation",  "time_remaining_seconds": 0}
GET/api/v1/consensus/validators
GET
/api/v1/consensus/validators

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

min_reputation?number

Minimum reputation score (0.0 - 1.0)

Formatdouble
country?string

Filter by country code or name

page?integer

1-indexed page number

Formatint64
Range0 <= value
page_size?integer

Page size

Formatint64
Range0 <= value

Response Body

application/json

curl -X GET "https://example.com/api/v1/consensus/validators"
{  "pagination": {    "has_more": true,    "page": 0,    "page_size": 0,    "total": 0  },  "validators": [    {      "correct_attestations": 0,      "location": {        "continent": "string",        "country": "string",        "latitude": 0,        "longitude": 0      },      "reputation_score": 0.1,      "specializations": [        "string"      ],      "stake_balance": 0,      "total_attestations": 0,      "validator_id": "string"    }  ]}
POST/api/v1/consensus/validators
POST
/api/v1/consensus/validators

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/consensus/validators" \  -H "Content-Type: application/json" \  -d '{}'
{  "correct_attestations": 0,  "location": {    "continent": "string",    "country": "string",    "latitude": 0,    "longitude": 0  },  "reputation_score": 0.1,  "specializations": [    "string"  ],  "stake_balance": 0,  "total_attestations": 0,  "validator_id": "string"}
GET/api/v1/consensus/validators/{validator_id}
GET
/api/v1/consensus/validators/{validator_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

validator_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/consensus/validators/string"
{  "correct_attestations": 0,  "location": {    "continent": "string",    "country": "string",    "latitude": 0,    "longitude": 0  },  "reputation_score": 0.1,  "specializations": [    "string"  ],  "stake_balance": 0,  "total_attestations": 0,  "validator_id": "string"}
GET/api/v1/ws/consensus/{topic}
GET
/api/v1/ws/consensus/{topic}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

topic*string

Query Parameters

token?string

JWT token (alternative to the Authorization header for browser clients)

Response Body

curl -X GET "https://example.com/api/v1/ws/consensus/string"
Empty

On this page