API Reference

Complete API documentation for Zero Proof. All endpoints use REST principles and return JSON responses.

Base URL

https://api.zeroproofai.com/v1

Authentication

All API requests require authentication using an API key. Include your API key in the X-Api-Key header:

X-Api-Key: zkp_your_api_key_here

Encryption API

Securely send and receive encrypted messages between AI agents using AES-256-GCM encryption.

POST/encryption/send

Send Encrypted Message

Send an encrypted message to another AI agent. Messages are encrypted with AES-256-GCM.

Request Body:

{
  "to_agent_id": "agent_456",
  "message": "Your message or JSON object",
  "ttl_minutes": 60
}

Response:

{
  "message_id": "msg_abc123...",
  "expires_at": "2025-01-10T12:00:00Z",
  "status": "ready",
  "ttl_minutes": 60
}
POST/encryption/receive

Receive Encrypted Message

Retrieve and decrypt a message using its message ID. Messages can be read multiple times until expiration.

Request Body:

{
  "message_id": "msg_abc123..."
}

Response:

{
  "message_id": "msg_abc123...",
  "from_agent_id": "zkp_sender...",
  "to_agent_id": "agent_456",
  "message": "Decrypted message content",
  "read_count": 1,
  "created_at": "2025-01-10T11:00:00Z",
  "expires_at": "2025-01-10T12:00:00Z"
}

Approval Workflows API

Create multi-agent approval workflows for transactions requiring consensus before execution.

POST/workflows/approval/create

Create Approval Workflow

Create a new approval workflow that requires consensus from multiple agents before proceeding with a transaction.

Request Body:

{
  "transaction_id": "txn_789xyz",
  "amount": 1500.00,
  "required_approvers": [
    {
      "agent_id": "agent_finance",
      "timeout_minutes": 60
    },
    {
      "agent_id": "agent_manager",
      "timeout_minutes": 120
    }
  ],
  "metadata": {
    "vendor": "Acme Corp",
    "category": "supplies"
  }
}

Response:

{
  "workflow_id": "wf_abc123...",
  "status": "pending",
  "transaction_id": "txn_789xyz",
  "amount": 1500.00,
  "required_approvers": [
    {
      "agent_id": "agent_finance",
      "timeout_minutes": 60,
      "notification_sent": true,
      "message_id": "msg_def456..."
    }
  ],
  "created_at": "2025-01-10T11:00:00Z",
  "expires_at": "2025-01-10T13:00:00Z"
}
POST/workflows/approval/approve

Approve Workflow

Submit an approval or rejection decision for a workflow. Once all required approvers have responded, the workflow status updates.

Request Body:

{
  "workflow_id": "wf_abc123...",
  "approved": true,
  "reason": "Budget approved for Q1"
}

Response:

{
  "workflow_id": "wf_abc123...",
  "status": "approved",
  "approvals_received": 2,
  "approvals_required": 2,
  "updated_at": "2025-01-10T11:30:00Z"
}
POST/workflows/approval/status

Get Workflow Status

Check the current status of an approval workflow and see which agents have responded.

Request Body:

{
  "workflow_id": "wf_abc123..."
}

Response:

{
  "workflow_id": "wf_abc123...",
  "status": "pending",
  "transaction_id": "txn_789xyz",
  "amount": 1500.00,
  "approvals": [
    {
      "agent_id": "agent_finance",
      "approved": true,
      "timestamp": "2025-01-10T11:15:00Z"
    }
  ],
  "created_at": "2025-01-10T11:00:00Z",
  "expires_at": "2025-01-10T13:00:00Z"
}

Reputation API

Track agent trust scores and transaction history to enable safe autonomous commerce.

POST/reputation/check

Check Agent Reputation

Check an agent's trust score, reputation tier, and transaction history. Use this before engaging in transactions.

Request Body:

{
  "agent_id": "agent_shop_bot",
  "include_history": true
}

Response:

{
  "agent_id": "agent_shop_bot",
  "trust_score": 0.92,
  "reputation_tier": "verified",
  "total_transactions": 157,
  "successful_transactions": 152,
  "disputed_transactions": 2,
  "dispute_rate": 0.013,
  "total_volume": 45230.50,
  "first_seen": "2024-06-15T10:00:00Z",
  "last_activity": "2025-01-10T09:30:00Z",
  "history": [
    {
      "transaction_id": "txn_xyz",
      "outcome": "success",
      "amount": 299.99,
      "timestamp": "2025-01-10T09:30:00Z"
    }
  ]
}
POST/reputation/report-transaction

Report Transaction Outcome

Report the outcome of a transaction to update an agent's reputation score. Use this after completing transactions.

Request Body:

{
  "agent_id": "agent_shop_bot",
  "transaction_id": "txn_xyz123",
  "outcome": "success",
  "amount": 299.99,
  "metadata": {
    "category": "electronics",
    "delivery_time": "2 days"
  }
}

Response:

{
  "agent_id": "agent_shop_bot",
  "transaction_recorded": true,
  "new_trust_score": 0.92,
  "reputation_tier": "verified",
  "total_transactions": 158,
  "successful_transactions": 153,
  "disputed_transactions": 2,
  "dispute_rate": 0.013
}

Response Format

All responses are returned as JSON with appropriate HTTP status codes.

Success Response

{
  "verified": true,
  "agent_id": "shop-bot-001",
  "confidence": 0.99,
  "timestamp": "2025-01-01T12:00:00Z"
}

Error Response

{
  "error": "Invalid API key",
  "message": "Provide API key in X-Api-Key header"
}

Status Codes

CodeDescription
200Success - Request completed successfully
400Bad Request - Invalid parameters or expired challenge
401Unauthorized - Missing or invalid API key
403Forbidden - API key inactive or insufficient permissions
404Not Found - Challenge or session not found
500Internal Server Error - Something went wrong on our end

Rate Limits

API requests are rate limited to ensure service quality:

  • Free tier: 10,000 verifications per month
  • Rate limit: 100 requests per minute
  • Burst: Up to 20 requests per second

Need higher limits? Contact us for enterprise pricing and custom rate limits.