# POST /v4/config/encode/reallocate

_Merkl API_

Beta feature (not production ready yet) - Builds the transaction payload used to reallocate an existing campaign's unclaimed rewards on-chain (EVM calldata / Stellar XDR). Requires campaignId and distributionChainId query parameters.

### Query parameters

- `campaignId` (string) _(required)_
- `distributionChainId` (string | number) _(required)_

## Request body

**`application/json`**
```json
{
  "type": "object",
  "properties": {
    "froms": {
      "description": "Source addresses to reallocate from (the zero address alone reallocates every wallet).",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "to": {
      "description": "Destination address that receives the reallocated rewards.",
      "type": "string"
    },
    "caller": {
      "description": "Address signing the reallocation (creator or authorized operator). Required on Stellar (transaction source), ignored on EVM.",
      "type": "string"
    }
  },
  "required": [
    "froms",
    "to"
  ]
}
```
**`application/x-www-form-urlencoded`**
```json
{
  "type": "object",
  "properties": {
    "froms": {
      "description": "Source addresses to reallocate from (the zero address alone reallocates every wallet).",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "to": {
      "description": "Destination address that receives the reallocated rewards.",
      "type": "string"
    },
    "caller": {
      "description": "Address signing the reallocation (creator or authorized operator). Required on Stellar (transaction source), ignored on EVM.",
      "type": "string"
    }
  },
  "required": [
    "froms",
    "to"
  ]
}
```
**`multipart/form-data`**
```json
{
  "type": "object",
  "properties": {
    "froms": {
      "description": "Source addresses to reallocate from (the zero address alone reallocates every wallet).",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "to": {
      "description": "Destination address that receives the reallocated rewards.",
      "type": "string"
    },
    "caller": {
      "description": "Address signing the reallocation (creator or authorized operator). Required on Stellar (transaction source), ignored on EVM.",
      "type": "string"
    }
  },
  "required": [
    "froms",
    "to"
  ]
}
```

## Example request

```bash
curl -X POST "https://api.merkl.xyz//v4/config/encode/reallocate?campaignId=<campaignId>&distributionChainId=<distributionChainId>" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```