# POST /v4/config/decode/{distributionChainId}

_Merkl API_

Decodes campaign data from the Distribution contract. Use distributionChainId path parameter and provide on-chain campaign data in body.

### Path parameters

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

## Request body

**`application/json`**
```json
{
  "type": "object",
  "properties": {
    "campaignId": {
      "type": "string"
    },
    "creator": {
      "$id": "address",
      "title": "Address",
      "description": "Address",
      "pattern": "^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44}|[CG][A-Z0-9]{55})$",
      "type": "string"
    },
    "rewardToken": {
      "$id": "address",
      "title": "Address",
      "description": "Address",
      "pattern": "^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44}|[CG][A-Z0-9]{55})$",
      "type": "string"
    },
    "amount": {
      "type": "string"
    },
    "campaignType": {
      "type": "integer"
    },
    "startTimestamp": {
      "$id": "timestamp",
      "title": "Timestamp",
      "description": "Unix timestamp in seconds (not milliseconds).",
      "type": "number"
    },
    "duration": {
      "type": "integer"
    },
    "campaignData": {
      "type": "string"
    }
  },
  "required": [
    "campaignId",
    "creator",
    "rewardToken",
    "amount",
    "campaignType",
    "startTimestamp",
    "duration",
    "campaignData"
  ],
  "description": "On-chain campaign data fetched from the Distribution contract"
}
```
**`application/x-www-form-urlencoded`**
```json
{
  "type": "object",
  "properties": {
    "campaignId": {
      "type": "string"
    },
    "creator": {
      "$id": "address",
      "title": "Address",
      "description": "Address",
      "pattern": "^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44}|[CG][A-Z0-9]{55})$",
      "type": "string"
    },
    "rewardToken": {
      "$id": "address",
      "title": "Address",
      "description": "Address",
      "pattern": "^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44}|[CG][A-Z0-9]{55})$",
      "type": "string"
    },
    "amount": {
      "type": "string"
    },
    "campaignType": {
      "type": "integer"
    },
    "startTimestamp": {
      "$id": "timestamp",
      "title": "Timestamp",
      "description": "Unix timestamp in seconds (not milliseconds).",
      "type": "number"
    },
    "duration": {
      "type": "integer"
    },
    "campaignData": {
      "type": "string"
    }
  },
  "required": [
    "campaignId",
    "creator",
    "rewardToken",
    "amount",
    "campaignType",
    "startTimestamp",
    "duration",
    "campaignData"
  ],
  "description": "On-chain campaign data fetched from the Distribution contract"
}
```
**`multipart/form-data`**
```json
{
  "type": "object",
  "properties": {
    "campaignId": {
      "type": "string"
    },
    "creator": {
      "$id": "address",
      "title": "Address",
      "description": "Address",
      "pattern": "^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44}|[CG][A-Z0-9]{55})$",
      "type": "string"
    },
    "rewardToken": {
      "$id": "address",
      "title": "Address",
      "description": "Address",
      "pattern": "^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44}|[CG][A-Z0-9]{55})$",
      "type": "string"
    },
    "amount": {
      "type": "string"
    },
    "campaignType": {
      "type": "integer"
    },
    "startTimestamp": {
      "$id": "timestamp",
      "title": "Timestamp",
      "description": "Unix timestamp in seconds (not milliseconds).",
      "type": "number"
    },
    "duration": {
      "type": "integer"
    },
    "campaignData": {
      "type": "string"
    }
  },
  "required": [
    "campaignId",
    "creator",
    "rewardToken",
    "amount",
    "campaignType",
    "startTimestamp",
    "duration",
    "campaignData"
  ],
  "description": "On-chain campaign data fetched from the Distribution contract"
}
```

## Responses

- **200** Response for status 200

## Example request

```bash
curl -X POST "https://api.merkl.xyz//v4/config/decode/{distributionChainId}" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```