---
title: "public/get_onchain_action_history"
method: POST
path: "/public/get_onchain_action_history"
tags: ["Onchain Actions"]
---

# public/get_onchain_action_history

`POST /public/get_onchain_action_history`

## Request

- Base URL: `https://api.derive.xyz/v3`
- URL: `https://api.derive.xyz/v3/public/get_onchain_action_history`
- Auth: none declared

Returns the lifecycle of onchain actions submitted via `OnchainActionManager.sol`. Public endpoint.

Onchain actions are either applied directly or with a `fallback` flag. Each onchain action is affected by the `fallback` flag uniquely:

- Deposits: sequencer moved the deposit into the `fallback_subaccount`
- SetSessionKey: no-op
- Admin actions: no-op

The onchain action can have several states:

- `applied`: action was successfully applied by the sequencer
- `applied_with_fallback`: action was applied by the sequencer with fallback=true
- `instant_fallback`: action failed its initial attempt, will be re-submitted with fallback=true
- `retry_then_fallback`: action failed its initial attempt, will be re-submitted with fallback=false until the retry budget is exceeded, then re-submitted with fallback=true
- `never_escalate`: action failed its initial attempt but will retry until successful, never with fallback=true

A failed attempt is recorded in `error_code`, `error_message` and `error_data`, and kept once the action is applied. `error_code` is a catalogued error code; `error_data` carries the specifics, and is null for an internal error.

## Request body

- GetOnchainActionHistoryParams
  - `action_type` integer, nullable: On-chain `actionType` id.
  - `end_timestamp` integer, nullable
  - `page` integer, nullable
  - `page_size` integer, nullable
  - `start_timestamp` integer, nullable
  - `wallet` string, nullable: L1 sender of the action (any hex casing).

## Response `200`

Success

- GetOnchainActionHistoryResponse
  - `actions` OnchainActionHistoryEntry[], required
    - `acc` string, required: Rolling accumulator from the ActionQueued event, 0x-hex.
    - `action_id` integer, required
    - `action_type` integer, required
    - `action_type_label` string, required
    - `block_number` integer, required
    - `data` string, required: Raw action calldata, 0x-hex.
    - `error_code` integer, nullable: Most recent submit rejection; null if the action never failed. Kept on applied/fallback rows as the reason the action struggled.
    - `error_data` string, nullable: The rejection's specifics, e.g. the wallet and cap it hit. Null for an internal error, whose text stays internal as on every other endpoint.
    - `error_message` string, nullable
    - `fallback_at` integer, nullable: Unix ms the action was escalated with `fallback=true`; null if never escalated.
    - `first_failed_at` integer, nullable: Unix ms of the first failed submit; null if the action never failed.
    - `l1_sender` string, required
    - `last_failed_at` integer, nullable: Unix ms of the most recent failed submit; null if never failed.
    - `op_uuid` string, nullable: Operation uuid assigned by the sequencer; null until applied.
    - `queue` string, required: Onchain queue: 'public' or 'admin'.
    - `skip_reason` string, nullable: The rendered rejection behind `skip_reason_code`, e.g. the risk-gate error or the owning wallet on 'sender_not_owner'.
    - `skip_reason_code` string, nullable: Why the protocol consumed an L1 escape-hatch withdrawal without moving funds: 'undecodable_payload' | 'unknown_subaccount' | 'sender_not_owner' | 'rejected'. Null for every other action, and for a withdrawal that paid out. Distinct from `error_code`/`error_message`, which are the listener's *submit* rejections. A skip is a successful submit — `status` stays 'applied' — that the protocol then declined to execute; the action is spent and is never retried.
    - `status` string, required: Sequencer applied states: 'applied' | 'applied_with_fallback' Failed States: 'instant_fallback' | 'retry_then_fallback' | 'never_escalate'
    - `tx_hash` string, nullable
    - `updated_at` integer, required: Unix ms of the latest state change.
  - `pagination` Pagination, required: Response envelope for paginated RPCs.
    - `count` integer, required
    - `num_pages` integer, required

## Other responses

- `default`: JSON-RPC error (see Error Codes)

## Changes

- **2026-10-20** `0c500202be49`: 1 info
  - added the media type `application/json` for the response with the status `default`

[Operation history](https://skmtc.dev/lyra/apis/derive-v3-api/changes/public/get_onchain_action_history/post.md)

---

[API](https://skmtc.dev/lyra/apis/derive-v3-api.md) - [All operations](https://skmtc.dev/lyra/apis/derive-v3-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lyra/apis/derive-v3-api/revisions/415f8a73b10c?raw)
