# Your First Verification

This guide walks through the complete batch verification lifecycle — from uploading a file to downloading your results — in five steps.

<Note>
  Prerequisites: an [API key](/quickstart/first-api-key) and a `.txt` file ready to upload. For a deeper dive into every step, see the [API Verification Workflow](/tutorials/api-workflow) guide.
</Note>

***

## Steps

<Steps>
  <Step title="Upload your file">
    Create a batch by uploading your `.txt` file. Save the `batch_uuid` from the response — you'll need it for every subsequent call.

    ```bash
    curl -X POST https://api.apexverify.com/v1/batch \
      -H "X-Api-Key: YOUR_API_KEY" \
      -F "file=@emails.txt" \
      -F "name=My First Batch" \
      -F "type=email" \
      -F "target_country=US"
    ```

    ```json
    {
      "status": "ok",
      "batch_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "created_at": "2026-04-06T10:00:00Z"
    }
    ```
  </Step>

  <Step title="Configure parameters">
    Set or confirm the verification parameters. `type` and `target_country` are required; all other fields are optional.

    ```bash
    curl -X PUT https://api.apexverify.com/v1/batch/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
      -H "X-Api-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "type": "email",
        "target_country": "US",
        "use_account_cache": true,
        "use_global_cache": true
      }'
    ```

    ```json
    { "message": "Success" }
    ```
  </Step>

  <Step title="Trigger parsing">
    Tell ApexVerify to parse and prepare the batch. The server validates rows, removes duplicates (if enabled), and calculates verification cost.

    ```bash
    curl -X PATCH https://api.apexverify.com/v1/batch/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
      -H "X-Api-Key: YOUR_API_KEY"
    ```

    ```json
    { "status": "ok" }
    ```

    Poll `GET /v1/batch/{uuid}` until the status reaches `ready_for_verification` before proceeding.
  </Step>

  <Step title="Launch verification">
    Once the batch is `ready_for_verification`, start the verification job:

    ```bash
    curl -X POST https://api.apexverify.com/v1/batch/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
      -H "X-Api-Key: YOUR_API_KEY"
    ```

    ```json
    { "status": "ok" }
    ```

    Poll `GET /v1/batch/{uuid}` periodically until the status changes to `verification_done`.
  </Step>

  <Step title="Export your results">
    Download results once verification is complete. Choose XLSX for a spreadsheet or JSON for programmatic access:

    ```bash
    # JSON export (full result data)
    curl -X GET "https://api.apexverify.com/v1/batch/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=json" \
      -H "X-Api-Key: YOUR_API_KEY"

    # XLSX export (Excel file)
    curl -X GET "https://api.apexverify.com/v1/batch/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=xlsx" \
      -H "X-Api-Key: YOUR_API_KEY" \
      -o results.xlsx
    ```
  </Step>
</Steps>

<Check>
  **You're done!** When the export returns your results, your first batch verification is complete. Each email or phone in the response includes quality signals, validity flags, and detailed metadata.
</Check>

***

## What's Next?

<CardGroup cols={2}>
  <Card title="API Verification Workflow" icon="fa-regular fa-arrows-spin" href="/tutorials/api-workflow">
    The complete reference — every endpoint, every parameter, every response shape explained in full.
  </Card>

  <Card title="List Verification" icon="fa-regular fa-list-check" href="/tutorials/list-verification">
    Best practices for preparing and verifying large contact lists efficiently.
  </Card>
</CardGroup>
