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

# View Clean List Results

> This endpoint retrieves the results of a cleaned email list, showing all valid emails that passed the validation process. Use this to access the clean emails after the cleaning job is completed.

This endpoint retrieves the results of a cleaned email list, showing all valid emails that passed the validation process. Use this to access the clean emails after the cleaning job is completed.

## How it Works

<Steps>
  <Step title="Complete Email Cleaning">
    First use the [Clean Email List](/api-reference/endpoint/clean_list)
    endpoint to process your file
  </Step>

  <Step title="Check Processing Status">
    Monitor the cleaning progress using the [View
    File](/api-reference/endpoint/view_file) endpoint
  </Step>

  <Step title="Retrieve Clean Results">
    Once status is "cleaned", use this endpoint to get the valid emails
  </Step>

  <Step title="Handle Pagination">
    Navigate through results using the pagination parameters
  </Step>
</Steps>

## When to Use This Endpoint

<CardGroup cols={2}>
  <Card title="After Cleaning Complete" icon="circle-check">
    Retrieve results only after the file status shows "cleaned"
  </Card>

  <Card title="Access Valid Emails" icon="envelope-circle-check">
    Get the list of emails that passed all validation checks
  </Card>

  <Card title="Download Clean Data" icon="download">
    Access validated emails for your marketing campaigns
  </Card>

  <Card title="Review Cleaning Results" icon="magnifying-glass">
    Examine the quality and quantity of your clean email list
  </Card>
</CardGroup>

## Example Usage

```bash theme={null}
curl -X GET "https://base.sanitizeemail.com/v1/api/cleanedemail/?file_id=757&size=20&page=1" \
  -H "X-API-KEY: YOUR_API_KEY"
```

## Response Format

### Successful Response (With Results)

```json theme={null}
{
  "count": 168,
  "next": "https://base.sanitizeemail.com/v1/api/cleanedemail/?file_id=757&page=2&size=20",
  "previous": null,
  "results": [
    {
      "id": 3796123,
      "workspace": {
        "id": 100,
        "name": "asim's Team",
        "owner": 100
      },
      "clean_email": {
        "id": 188,
        "file_id": {
          "id": 757,
          "name": "Structured cleaned",
          "file_name": "Marketing Agency Australia.xlsx",
          "status": "cleaned",
          "clean_email_count": 173,
          "bounce_rate": 0
        }
      },
      "valid_email": "info@agent6.com.au",
      "created_date": "2025-07-14T15:41:41.921862+05:45"
    }
  ]
}
```

### Empty Response (No Clean Results)

```json theme={null}
{
  "count": 0,
  "next": null,
  "previous": null,
  "results": []
}
```

## Understanding Empty Results

<Warning>
  **Empty Results**: If the response contains no results, check the file
  processing status using the [View File](/api-reference/endpoint/view_file)
  endpoint to determine the cause:
</Warning>

| File Status  | Meaning                            | Action Required           |
| ------------ | ---------------------------------- | ------------------------- |
| `processing` | Cleaning in progress               | Wait for completion       |
| `cleaned`    | Cleaning complete, no valid emails | All emails were invalid   |
| `failed`     | Processing failed                  | Check error logs or retry |

## Important Notes

<Note>
  **File ID Required**: The `file_id` parameter is mandatory. You can only
  retrieve results for files you have uploaded and processed.
</Note>

<Tip>
  **Check Status First**: Always verify the file status is "cleaned" using the
  [View File](/api-reference/endpoint/view_file) endpoint before expecting
  results.
</Tip>

<Card title="Pagination" icon="list">
  **Large Result Sets**: Use `size` and `page` parameters to navigate through
  large numbers of clean emails efficiently.
</Card>

## Common Scenarios

### Scenario 1: Processing Still in Progress

```json theme={null}
// File status check shows:
{
  "status": "processing",
  "progress_percentage": 75
}
// Clean results will be empty until processing completes
```

### Scenario 2: All Emails Invalid

```json theme={null}
// File status shows:
{
  "status": "cleaned",
  "clean_email_count": 0,
  "invalid_emails_count": 150
}
// Clean results will be empty because no emails passed validation
```

### Scenario 3: Successful Cleaning

```json theme={null}
// File status shows:
{
  "status": "cleaned",
  "clean_email_count": 173,
  "bounce_rate": 0
}
// Clean results will contain the valid emails
```

## Error Responses

| Status Code | Description                           | Action                                |
| ----------- | ------------------------------------- | ------------------------------------- |
| `400`       | Invalid file\_id or missing parameter | Check the file\_id value              |
| `401`       | Unauthorized access                   | Verify your API key                   |
| `404`       | File not found                        | Ensure file exists and belongs to you |

## Prerequisites

<Note>
  **Required Steps**: 1. Upload file using [File
  Upload](/api-reference/endpoint/file_upload) 2. Clean file using [Clean Email
  List](/api-reference/endpoint/clean_list) 3. Wait for processing to complete
  4\. Retrieve results with this endpoint
</Note>


## OpenAPI

````yaml GET /v1/api/cleanedemail/
openapi: 3.1.0
info:
  title: Sanitize-Email API (v1)
  description: Welcome to the Sanitize-Email API Documentation
  license:
    name: Proprietary License
  version: 1.0.0
servers:
  - url: https://base.sanitizeemail.com
security:
  - apiKeyAuth: []
paths:
  /v1/api/cleanedemail/:
    get:
      tags:
        - Email Cleaning
      summary: View Clean List Results
      description: >-
        This endpoint retrieves the results of a cleaned email list, showing all
        valid emails that passed the validation process. Use this to access the
        clean emails after the cleaning job is completed.
      parameters:
        - $ref: '#/components/parameters/FileIdQuery'
        - $ref: '#/components/parameters/Size'
        - $ref: '#/components/parameters/Page'
      responses:
        '200':
          description: Successful retrieval of cleaned email list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CleanedEmailListResponse'
        '400':
          description: Invalid file_id or missing parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    FileIdQuery:
      name: file_id
      in: query
      required: false
      schema:
        type: integer
      description: The ID of the file for which to retrieve results.
      example: 757
    Size:
      name: size
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 10
      description: Number of results to return per page.
      example: 20
    Page:
      name: page
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        default: 1
      description: Page number for pagination.
      example: 1
  schemas:
    CleanedEmailListResponse:
      type: object
      properties:
        count:
          type: integer
          description: Total number of cleaned emails
        next:
          type: string
          format: uri
          nullable: true
          description: URL for the next page of results
        previous:
          type: string
          format: uri
          nullable: true
          description: URL for the previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/CleanedEmailResult'
          description: Array of cleaned email objects
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    CleanedEmailResult:
      type: object
      properties:
        id:
          type: integer
        workspace:
          $ref: '#/components/schemas/Workspace'
        clean_email:
          $ref: '#/components/schemas/CleanEmailFileLink'
        valid_email:
          type: string
          format: email
        created_date:
          type: string
          format: date-time
    Workspace:
      type: object
      properties:
        id:
          type: integer
          description: Workspace ID
        name:
          type: string
          description: Name of the workspace
        owner:
          type: integer
          description: ID of the workspace owner
    CleanEmailFileLink:
      type: object
      properties:
        id:
          type: integer
        file_id:
          $ref: '#/components/schemas/CleanedFileSummary'
    CleanedFileSummary:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        file_name:
          type: string
        status:
          type: string
        clean_email_count:
          type: integer
        bounce_rate:
          type: number
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: File not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API key for authentication

````