---
title: "Create and execute a lending action (deposit or withdraw)"
method: POST
path: "/earn/actions"
tags: ["Earn"]
---

# Create and execute a lending action (deposit or withdraw)

`POST /earn/actions`

## Request

- Base URL: `https://api.fireblocks.io/v1`
- URL: `https://api.fireblocks.io/v1/earn/actions`
- Auth: none declared
- TypeScript: <https://skmtc.dev/fireblocks/apis/fireblocks-api/docs/earn/actions/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates and runs a sequence of on-chain steps for either a deposit into or a withdrawal from an earn
vault/market. Specify the operation with `action` in the request body (`DEPOSIT` or `WITHDRAW`).

## Headers

- `Idempotency-Key` string

## Request body

- CreateEarnActionRequest
  - `action` 'DEPOSIT' | 'WITHDRAW', required: Whether to deposit into or withdraw from the lending opportunity.
  - `opportunityId` string, required: Identifier of the vault or market (lending opportunity).
  - `vaultAccountId` string, required: Fireblocks vault account that will execute the action.
  - `amount` string, required: Human-readable token amount (e.g. "1.6") or the keyword "max" for the full position or available balance.

## Response `200`

OK

- CreateEarnActionResponse
  - `id` string, required: ActionIntent UUID for tracking the lending action workflow.
  - `status` 'CREATED' | 'IN_PROGRESS' | 'COMPLETED' | 'CANCELED' | 'FAILED', required: Lifecycle status (e.g. CREATED, IN_PROGRESS, COMPLETED).

## Other responses

- `400`: Bad request: missing/invalid fields, unsupported amount, or malformed payload.
- `403`: Forbidden: insufficient permissions, disabled feature, or restricted provider.
- `404`: Not found: requested resource does not exist (e.g., opportunity, provider, or wallet).
- `429`: Rate limit exceeded: slow down and retry later.
- `500`: Internal error while processing the request.
- `default`: Error Response

---

[API](https://skmtc.dev/fireblocks/apis/fireblocks-api.md) - [All operations](https://skmtc.dev/fireblocks/apis/fireblocks-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fireblocks/apis/fireblocks-api/revisions/4eba9965659a?raw)
