Skip to content

API Reference

This section provides detailed documentation for all HEIR API endpoints.

Base URL

https://api.heir.es/api/v1/

Authentication

All requests require an API key via one of these methods:

bash
# Authorization header (recommended)
curl -H "Authorization: Bearer heir_pk_xxx..." https://api.heir.es/api/v1/...

# X-API-Key header
curl -H "X-API-Key: heir_pk_xxx..." https://api.heir.es/api/v1/...

See Authentication Guide for details.

Response Format

All responses follow this structure:

Success Response

json
{
  "success": true,
  "data": { ... },
  "meta": {
    "requestId": "req_abc123xyz",
    "timestamp": "2024-01-15T12:00:00.000Z",
    "pagination": {  // Optional, for list endpoints
      "page": 1,
      "limit": 20,
      "total": 150,
      "pages": 8
    }
  }
}

Error Response

json
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid beneficiary address",
    "details": [
      { "field": "beneficiaries[0].address", "reason": "Invalid checksum" }
    ]
  },
  "meta": {
    "requestId": "req_abc123xyz",
    "timestamp": "2024-01-15T12:00:00.000Z"
  }
}

Error Codes

CodeHTTP StatusDescription
API_KEY_MISSING401No API key provided
API_KEY_INVALID401Invalid or expired API key
UNAUTHORIZED401Authentication required
INSUFFICIENT_SCOPE403API key lacks required scope
TIER_NOT_ALLOWED403Feature requires higher tier
IP_NOT_ALLOWED403IP not in whitelist
NOT_FOUND404Resource not found
VALIDATION_ERROR400Invalid request parameters
RATE_LIMIT_EXCEEDED429Too many requests
INTERNAL_ERROR500Server error

Rate Limits

Requests are rate limited based on your API key tier:

TierRequests/15minContract GenAI Chat
Public100105
Partner1,00010050
Internal10,0001,000200

Rate limit headers are included in all responses:

http
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 2024-01-15T12:30:00.000Z

Endpoints

API Keys

Contracts

Webhooks

Embed

OpenAPI Specification

Download the complete OpenAPI 3.0 specification:

SDKs

Official SDKs are available for:

Or generate a client from the OpenAPI spec using OpenAPI Generator.

Released under the MIT License.