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

# SKILL

> Manage an existing Yield.xyz position by running the pending actions on its balances, such as claiming rewards, restaking, claiming unstaked funds, rebonding, or voting. Use when the user wants to claim, restake, or maintain a position.

# Manage position

Manage actions come from the balance itself. Read the position, pick one of its `pendingActions[]`, and send its `type` and `passthrough` to `POST /v1/actions/manage`.

## When to use

* Claim rewards (for example, "Claim my ATOM rewards")
* Restake or compound rewards
* Claim funds after an unstake cooldown
* Rebond an unbonding amount, vote, delegate, or migrate

## Authentication and host

Send the project API key in the `x-api-key` header.

```
https://api.yield.xyz/v1
```

## Step 1: Read the balances and pending actions

```bash theme={null}
curl -X POST "https://api.yield.xyz/v1/yields/{yieldId}/balances" \
  -H "x-api-key: $YIELD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "address": "0xYOUR_WALLET_ADDRESS" }'
```

Each entry in `balances[]` has a `type` (`active`, `entering`, `exiting`, `withdrawable`, `claimable`, `locked`) and `pendingActions[]`. A pending action looks like:

```json theme={null}
{
  "intent": "manage",
  "type": "CLAIM_REWARDS",
  "passthrough": "eyJhZGRyZXNzZXMi...",
  "amount": "0.1",
  "arguments": { "fields": [] }
}
```

`passthrough` is an opaque server-generated string. Send it back unchanged. `arguments`, when present, is the schema of extra input the action needs. For a multi-balance flow across addresses, use `POST /v1/yields/balances` (see `check-portfolio`).

## Step 2: Create the manage action

`POST /v1/actions/manage`. `yieldId`, `address`, `action`, and `passthrough` are required. `arguments` is optional.

```bash theme={null}
curl -X POST "https://api.yield.xyz/v1/actions/manage" \
  -H "x-api-key: $YIELD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "yieldId": "cosmos-atom-native-staking",
    "address": "cosmos1YOUR_ADDRESS",
    "action": "CLAIM_REWARDS",
    "passthrough": "eyJhZGRyZXNzZXMi...",
    "arguments": {}
  }'
```

`action` is the pending action's `type`. Which actions a yield supports is yield-specific; the manage schemas are in `mechanics.arguments.manage`, keyed by action type. Common values:

| Action | Use |
| - | - |
| `CLAIM_REWARDS` | Claim accrued rewards. |
| `RESTAKE_REWARDS` | Compound rewards back into the position. |
| `CLAIM_UNSTAKED` | Claim funds after a cooldown. |
| `WITHDRAW`, `WITHDRAW_ALL` | Withdraw funds that finished unbonding. |
| `WITHDRAW_REQUEST`, `INSTANT_WITHDRAW` | Request a withdrawal that settles later, or withdraw immediately. |
| `REBOND`, `RESTAKE` | Return an unbonding or exited amount to staking. |
| `UNLOCK_LOCKED`, `STAKE_LOCKED` | Unlock, or stake, locked funds. |
| `VOTE`, `REVOTE`, `REVOKE`, `VOTE_LOCKED` | Governance actions. |
| `DELEGATE` | Delegate to a validator. |
| `MIGRATE` | Move to another validator or contract. |
| `VERIFY_WITHDRAW_CREDENTIALS` | Native ETH staking credential check. |

The full list is in the [action types reference](https://docs.yield.xyz/api-reference/earn-objects.md#action-types).

The response is `201` with an `ActionDto` (`intent: "manage"`) and `transactions[]`.

## Step 3: Sign and submit

Same as `enter-position`: process `transactions[]` in `stepIndex` order, sign each `unsignedTransaction`, then use one path per transaction.

* `POST /v1/transactions/{transactionId}/submit` with `{ "signedTransaction": "..." }` for Yield.xyz to broadcast.
* `PUT /v1/transactions/{transactionId}/submit-hash` with `{ "hash": "0x..." }` if you broadcast.

Track with `GET /v1/actions/{actionId}` until `SUCCESS`, `FAILED`, or `CANCELED`.

## Workflows

**Compound rewards:** read balances, find the `RESTAKE_REWARDS` pending action, create the manage action, sign and submit.

**Claim after cooldown:** wait until the balance is `withdrawable`, then run its pending action (for example `CLAIM_UNSTAKED`).

**Switch validators:** list `GET /v1/yields/{yieldId}/validators`, then run the pending action that the balance offers with the new `validatorAddress` in `arguments`, if the schema lists it.

## Errors

| Status | Meaning | Action |
| - | - | - |
| 400 | Invalid action, missing or altered `passthrough`, or yield not enabled for the project | Re-read the balances and use a current pending action. |
| 401 | Missing or invalid API key | Check the `x-api-key` header. |
| 403 | Geo-blocked region | Stop. |
| 404 | Yield not found | Verify the yield ID. |
| 429 | Rate limited | Wait for `retry-after` seconds. |

## Edge cases

* **Only offered actions:** If a balance has no matching pending action, the action is not available now. Do not construct one.
* **Stale passthrough:** Re-read balances if time has passed; do not reuse an old `passthrough`.
* **Multiple validators:** A balance can span several validators. Run actions per balance entry.
* **Minimums:** Some protocols require a minimum claimable amount before a claim is allowed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.