REST API

Interact with the Convex network using our RESTful API endpoints

Getting Started

The Convex REST API allows you to interact with the network programmatically. All API endpoints are served over HTTPS and return responses in JSON format.

Base URL: http://peer.convex.live:8080/api/v1

API Endpoints

GET/api/v1/status

Get the current status of the Convex network including version, block height, and network health.

Example Request

curl http://peer.convex.live:8080/api/v1/status

Example Response

{
  "status": "healthy",
  "version": "1.0.0",
  "blockHeight": 1234567,
  "timestamp": "2024-01-20T12:00:00Z"
}
POST/api/v1/transactions

Submit a new transaction to the Convex network.

Example Request

curl -X POST http://peer.convex.live:8080/api/v1/transactions \
-H "Content-Type: application/json" \
-d '{
  "sender": "0x...",
  "action": "transfer",
  "params": {
    "to": "0x...",
    "amount": 1000
  }
}'

Example Response

{
  "transactionHash": "0x...",
  "status": "pending",
  "timestamp": "2024-01-20T12:00:00Z"
}
GET/api/v1/accounts/{address}

Retrieve account information including balance and transaction history.

Example Request

curl http://peer.convex.live:8080/api/v1/accounts/0x...

Example Response

{
  "address": "0x...",
  "balance": 5000,
  "nonce": 42,
  "lastActivity": "2024-01-20T12:00:00Z"
}
GET/api/v1/blocks/{height}

Get detailed information about a specific block by its height.

Example Request

curl http://peer.convex.live:8080/api/v1/blocks/1234567

Example Response

{
  "height": 1234567,
  "hash": "0x...",
  "timestamp": "2024-01-20T12:00:00Z",
  "transactions": ["0x...", "0x..."]
}