Developer reference for REST staking API resources, idempotent actions, errors, versions, webhooks, and an educational OpenAPI example.

Developer reference for a REST staking API

Illustrative resource patterns, response envelopes, error semantics, idempotency, versioning, webhooks, and OpenAPI documentation for staking workflows. No live endpoint is offered.

Illustrative documentation: StakeAPI.com does not operate the example host or provide API keys. The contract below is a reusable architecture pattern for teams designing their own staking interfaces.
Resource style

Prefer durable nouns over one-call verbs

Create intents and actions, then read their state. This structure supports asynchronous signing, protocol waiting periods, retries, webhooks, and reconciliation.

POST /v1/intents
POST /v1/actions
GET  /v1/actions/{action_id}
GET  /v1/positions/{position_id}
GET  /v1/networks/{network_id}/capabilities
GET  /v1/validators/{validator_id}
GET  /v1/reward-statements/{statement_id}
GET  /v1/events?position_id={position_id}

Response envelope

Use predictable identifiers, timestamps, state, evidence, and error objects across resources. Amounts should include raw integer values and decimal metadata; never rely on floating-point display strings for signed or reconciled values.

{
  "data": {
    "id": "act_01J...",
    "type": "staking_action",
    "status": "awaiting_signature",
    "created_at": "2026-10-23T20:00:00Z",
    "expires_at": "2026-10-23T20:10:00Z"
  },
  "meta": {
    "request_id": "req_01J...",
    "api_version": "2026-10-01"
  }
}

Machine-readable errors

Return a stable code, plain-language message, retry safety, related resource IDs, and structured details. HTTP status communicates transport semantics; the error code communicates the domain condition.

StatusUseDomain example
200Current resource returnedPosition or capability read
201Resource created synchronouslyIntent record created
202Workflow accepted, still processingAction waiting for signing or chain state
400Malformed requestInvalid amount encoding
401 / 403Identity or permission failureWrong tenant or missing action scope
409State conflictIntent changed, duplicate key mismatch, or ineligible transition
422Well-formed but unsupported intentCapability or policy does not allow action
429Rate or resource limitBounded with retry guidance
503Required safety dependency unavailableSigner or evidence source unavailable; fail closed

Version schemas

Use explicit API and adapter versions. Additive fields are easier than changing existing meaning; unknown enum values must remain parseable.

Verify webhooks

Sign delivery, include event ID and timestamp, retry with backoff, and let consumers fetch the current resource after receiving an event.

Publish freshness

Every chain-derived response needs observation time, source, native reference, and a clear stale or partial state.

Start with the field guide

Read the long-form architecture article before adapting the illustrative OpenAPI document.

Read field guide