Documentation Index
Fetch the complete documentation index at: https://docs.keystoneos.xyz/llms.txt
Use this file to discover all available pages before exploring further.
HTTP status codes
| Code | Meaning | When |
|---|---|---|
200 | Success | GET requests, idempotent retries |
201 | Created | POST that creates a resource |
400 | Bad request | Malformed JSON, missing required fields |
401 | Unauthorized | Invalid or expired JWT |
403 | Forbidden | Insufficient scopes/permissions |
404 | Not found | Resource does not exist or not in your environment |
409 | Conflict | Duplicate idempotency key, invalid state transition |
422 | Validation error | Valid JSON but business rule violated |
Error response format
All errors return a consistent structure:Idempotency
Instruction submission is idempotent viaidempotency_key. If you send the same key:
- First call: creates the instruction (201)
- Subsequent calls: returns the existing instruction (200)
Retrying failed requests
| Scenario | Retry? | Strategy |
|---|---|---|
| Network timeout | Yes | Retry with same idempotency key |
| 5xx server error | Yes | Exponential backoff |
| 401 Unauthorized | Yes | Refresh token first, then retry |
| 400/422 Validation | No | Fix the request |
| 409 Conflict | No | Check current state, decide next action |
| 404 Not Found | No | Verify the resource ID |
Settlement-specific errors
Compliance decision on wrong state
Instruction not cancellable
status: pending_match can be cancelled. Instructions that have already been matched, expired, or cancelled cannot be changed.
Template validation failures
required_roles or required_leg_types.
On-chain error handling
When the SettlementCoordinator rejects a transition (e.g. gate check fails), the contract reverts. The settlement remains in its current state. The engine logs the rejection and can retry when conditions change. If the settlement reaches itstimeout_at deadline, anyone can call timeout() on the SettlementCoordinator to trigger rollback. This is permissionless and does not depend on KeyStone.
Webhook error handling
If your webhook endpoint returns a non-2xx response:- KeyStone retries with exponential backoff
- Failed deliveries are logged in the delivery log
- The settlement continues regardless (webhooks are notifications, not blocking)