Skip to main content
POST
/
blockchain
/
events
Records a new event on the blockchain.
curl --request POST \
  --url https://api.example.com/blockchain/events \
  --header 'Content-Type: application/json' \
  --data '
{
  "event_type": "<string>",
  "timestamp": 123,
  "event_id": "<string>",
  "location": {
    "latitude": 123,
    "longitude": 123,
    "altitude": 123
  },
  "evidence_cid": "<string>",
  "drone_id": "<string>",
  "metadata": {}
}
'
{
  "gas_consumed": 1,
  "status": "<string>",
  "tx_hash": "<string>",
  "block_height": 1,
  "error_message": "<string>"
}

Body

application/json
event_type
string
required
timestamp
integer<int64>
required
event_id
string
location
object
evidence_cid
string
drone_id
string
metadata
object

Response

200 - application/json

Event recorded

Response for transaction status.

gas_consumed
integer<int64>
required

Gas consumed by the transaction.

Required range: x >= 0
status
string
required

Transaction status (e.g. "confirmed", "pending", "failed").

tx_hash
string
required

On-chain transaction hash.

block_height
integer<int64> | null

Block height at which the transaction was included.

Required range: x >= 0
error_message
string | null

Error message if the transaction failed.