> ## Documentation Index
> Fetch the complete documentation index at: https://docs.initia.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Get OP hook

> Generates OP hook data required for certain cross-chain routes that involve Optimistic bridge withdrawals with ERC-20 token conversion. When the Compute Route response includes `required_op_hook: true`, you must call this endpoint to obtain the hook payload before generating transaction messages.

Pass the returned hook data to the Generate Transaction endpoint (`POST /v2/fungible/msgs`) in the `signed_op_hook` field after signing it.



## OpenAPI

````yaml /api-reference/router-api/openapi.yaml post /op-hook
openapi: 3.1.0
info:
  title: Router API
  description: Cross-chain transfer routing API for the Initia ecosystem.
  version: 1.0.0
servers:
  - url: https://router-api.initia.xyz
    description: Mainnet
  - url: https://router-api.initiation-2.initia.xyz
    description: Testnet
security: []
paths:
  /op-hook:
    post:
      tags:
        - Routing
      summary: Get OP hook
      description: >-
        Generates OP hook data required for certain cross-chain routes that
        involve Optimistic bridge withdrawals with ERC-20 token conversion. When
        the Compute Route response includes `required_op_hook: true`, you must
        call this endpoint to obtain the hook payload before generating
        transaction messages.


        Pass the returned hook data to the Generate Transaction endpoint (`POST
        /v2/fungible/msgs`) in the `signed_op_hook` field after signing it.
      operationId: getOpHook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - source_address
                - source_asset_chain_id
                - source_asset_denom
                - dest_address
                - dest_asset_chain_id
                - dest_asset_denom
              properties:
                source_address:
                  type: string
                  description: Sender address on the source chain.
                source_asset_chain_id:
                  type: string
                  description: Source chain ID.
                source_asset_denom:
                  type: string
                  description: Source asset denomination.
                dest_address:
                  type: string
                  description: Recipient address on the destination chain.
                dest_asset_chain_id:
                  type: string
                  description: Destination chain ID.
                dest_asset_denom:
                  type: string
                  description: Destination asset denomination.
            example:
              source_address: init1abc...
              source_asset_chain_id: echelon-1
              source_asset_denom: uinit
              dest_address: 0xdef...
              dest_asset_chain_id: '8453'
              dest_asset_denom: 0x...
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  chain_id:
                    type: string
                    description: Chain ID where the hook messages should be executed.
                  hook:
                    type: array
                    description: Array of EVM messages that form the OP hook payload.
                    items:
                      type: object
              example:
                chain_id: '8453'
                hook: []
        '400':
          description: Bad request — the route does not support OP withdraw.

````