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

# Data Quality & Export

> Run deduplication workflows and export duplicate, unified, or catalogue data.

<Note>
  Authenticate every request with `Authorization: Bearer clr_live_YOUR_API_KEY`.
</Note>

## Run deduplication

<Badge color="blue">POST</Badge> `/generate/dedupe`

Run deduplication through the Claro Public API.

**Required scope:** `generate`

### Request body

Content type: `application/json` (required)

```json Request example theme={null}
{
  "file1_data": {
    "headers": [
      "name"
    ],
    "rows": [
      {
        "name": "Acme"
      }
    ]
  },
  "file2_data": {
    "headers": [
      "supplier"
    ],
    "rows": [
      {
        "supplier": "ACME Ltd"
      }
    ]
  },
  "column1": "name",
  "column2": "supplier",
  "channelId": "dedupe-progress"
}
```

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://platform.getclaro.ai/api/public/v1/generate/dedupe" \
    -H "Authorization: Bearer clr_live_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    --data '{
    "file1_data": {
      "headers": [
        "name"
      ],
      "rows": [
        {
          "name": "Acme"
        }
      ]
    },
    "file2_data": {
      "headers": [
        "supplier"
      ],
      "rows": [
        {
          "supplier": "ACME Ltd"
        }
      ]
    },
    "column1": "name",
    "column2": "supplier",
    "channelId": "dedupe-progress"
  }'
  ```

  ```python Python theme={null}
  import json
  import requests
  url = f"https://platform.getclaro.ai/api/public/v1/generate/dedupe"
  headers = {"Authorization": "Bearer clr_live_YOUR_API_KEY"}
  payload = json.loads(r'''{
    "file1_data": {
      "headers": [
        "name"
      ],
      "rows": [
        {
          "name": "Acme"
        }
      ]
    },
    "file2_data": {
      "headers": [
        "supplier"
      ],
      "rows": [
        {
          "supplier": "ACME Ltd"
        }
      ]
    },
    "column1": "name",
    "column2": "supplier",
    "channelId": "dedupe-progress"
  }''')
  response = requests.post(url, headers=headers, json=payload)
  response.raise_for_status()
  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(`https://platform.getclaro.ai/api/public/v1/generate/dedupe`, {
    method: "POST",
    headers: {
      Authorization: "Bearer clr_live_YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "file1_data": {
        "headers": [
          "name"
        ],
        "rows": [
          {
            "name": "Acme"
          }
        ]
      },
      "file2_data": {
        "headers": [
          "supplier"
        ],
        "rows": [
          {
            "supplier": "ACME Ltd"
          }
        ]
      },
      "column1": "name",
      "column2": "supplier",
      "channelId": "dedupe-progress"
    }),
  });

  if (!response.ok) throw new Error(await response.text());
  const data = await response.json();
  ```
</CodeGroup>

### Responses

* `200` - Successful response
* `Default` - Error response. Rate-limited responses use HTTP 429.

***

## Export duplicate records

<Badge color="blue">POST</Badge> `/generate/dedupe/export/duplicates`

Export duplicate records through the Claro Public API.

**Required scope:** `generate`

### Request body

Content type: `application/json` (required)

```json Request example theme={null}
{
  "matches": [
    {
      "match_type": "exact"
    }
  ],
  "file1_headers": [
    "name"
  ],
  "file2_headers": [
    "supplier"
  ]
}
```

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://platform.getclaro.ai/api/public/v1/generate/dedupe/export/duplicates" \
    -H "Authorization: Bearer clr_live_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    --data '{
    "matches": [
      {
        "match_type": "exact"
      }
    ],
    "file1_headers": [
      "name"
    ],
    "file2_headers": [
      "supplier"
    ]
  }'
  ```

  ```python Python theme={null}
  import json
  import requests
  url = f"https://platform.getclaro.ai/api/public/v1/generate/dedupe/export/duplicates"
  headers = {"Authorization": "Bearer clr_live_YOUR_API_KEY"}
  payload = json.loads(r'''{
    "matches": [
      {
        "match_type": "exact"
      }
    ],
    "file1_headers": [
      "name"
    ],
    "file2_headers": [
      "supplier"
    ]
  }''')
  response = requests.post(url, headers=headers, json=payload)
  response.raise_for_status()
  content = response.content
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(`https://platform.getclaro.ai/api/public/v1/generate/dedupe/export/duplicates`, {
    method: "POST",
    headers: {
      Authorization: "Bearer clr_live_YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "matches": [
        {
          "match_type": "exact"
        }
      ],
      "file1_headers": [
        "name"
      ],
      "file2_headers": [
        "supplier"
      ]
    }),
  });

  if (!response.ok) throw new Error(await response.text());
  const data = await response.arrayBuffer();
  ```
</CodeGroup>

### Responses

* `200` - Generated export
* `Default` - Error response. Rate-limited responses use HTTP 429.

***

## Export unified records

<Badge color="blue">POST</Badge> `/generate/dedupe/export/unified`

Export unified records through the Claro Public API.

**Required scope:** `generate`

### Request body

Content type: `application/json` (required)

```json Request example theme={null}
{
  "mergeStrategy": "keep_file1",
  "matches": [],
  "file1_data": {
    "headers": [
      "name"
    ],
    "rows": [
      {
        "name": "Acme"
      }
    ]
  },
  "file2_data": {
    "headers": [
      "supplier"
    ],
    "rows": [
      {
        "supplier": "ACME Ltd"
      }
    ]
  }
}
```

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://platform.getclaro.ai/api/public/v1/generate/dedupe/export/unified" \
    -H "Authorization: Bearer clr_live_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    --data '{
    "mergeStrategy": "keep_file1",
    "matches": [],
    "file1_data": {
      "headers": [
        "name"
      ],
      "rows": [
        {
          "name": "Acme"
        }
      ]
    },
    "file2_data": {
      "headers": [
        "supplier"
      ],
      "rows": [
        {
          "supplier": "ACME Ltd"
        }
      ]
    }
  }'
  ```

  ```python Python theme={null}
  import json
  import requests
  url = f"https://platform.getclaro.ai/api/public/v1/generate/dedupe/export/unified"
  headers = {"Authorization": "Bearer clr_live_YOUR_API_KEY"}
  payload = json.loads(r'''{
    "mergeStrategy": "keep_file1",
    "matches": [],
    "file1_data": {
      "headers": [
        "name"
      ],
      "rows": [
        {
          "name": "Acme"
        }
      ]
    },
    "file2_data": {
      "headers": [
        "supplier"
      ],
      "rows": [
        {
          "supplier": "ACME Ltd"
        }
      ]
    }
  }''')
  response = requests.post(url, headers=headers, json=payload)
  response.raise_for_status()
  content = response.content
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(`https://platform.getclaro.ai/api/public/v1/generate/dedupe/export/unified`, {
    method: "POST",
    headers: {
      Authorization: "Bearer clr_live_YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "mergeStrategy": "keep_file1",
      "matches": [],
      "file1_data": {
        "headers": [
          "name"
        ],
        "rows": [
          {
            "name": "Acme"
          }
        ]
      },
      "file2_data": {
        "headers": [
          "supplier"
        ],
        "rows": [
          {
            "supplier": "ACME Ltd"
          }
        ]
      }
    }),
  });

  if (!response.ok) throw new Error(await response.text());
  const data = await response.arrayBuffer();
  ```
</CodeGroup>

### Responses

* `200` - Generated export
* `Default` - Error response. Rate-limited responses use HTTP 429.

***

## Run catalogue export

<Badge color="blue">POST</Badge> `/catalogue-export/templates/{templateId}/export`

Run catalogue export through the Claro Public API.

**Required scopes:** `objects`, `team`

### Parameters

| Name         | Location | Type   | Required |
| ------------ | -------- | ------ | -------- |
| `templateId` | path     | string | Yes      |

### Request body

Content type: `application/json` (required)

```json Request example theme={null}
{
  "gatingMode": "export_passing_rows"
}
```

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://platform.getclaro.ai/api/public/v1/catalogue-export/templates/$TEMPLATE_ID/export" \
    -H "Authorization: Bearer clr_live_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    --data '{
    "gatingMode": "export_passing_rows"
  }'
  ```

  ```python Python theme={null}
  import json
  import requests
  template_id = "YOUR_TEMPLATE_ID"
  url = f"https://platform.getclaro.ai/api/public/v1/catalogue-export/templates/{template_id}/export"
  headers = {"Authorization": "Bearer clr_live_YOUR_API_KEY"}
  payload = json.loads(r'''{
    "gatingMode": "export_passing_rows"
  }''')
  response = requests.post(url, headers=headers, json=payload)
  response.raise_for_status()
  content = response.content
  ```

  ```javascript JavaScript theme={null}
  const templateId = "YOUR_TEMPLATE_ID";

  const response = await fetch(`https://platform.getclaro.ai/api/public/v1/catalogue-export/templates/${templateId}/export`, {
    method: "POST",
    headers: {
      Authorization: "Bearer clr_live_YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "gatingMode": "export_passing_rows"
    }),
  });

  if (!response.ok) throw new Error(await response.text());
  const data = await response.arrayBuffer();
  ```
</CodeGroup>

### Responses

* `200` - Generated export
* `Default` - Error response. Rate-limited responses use HTTP 429.
