Java API guide

Verify email addresses with Java.

Send a secure JSON request with java.net.http.HttpClient, authenticate with your account email and API key, and use the returned status directly in your application.

Before you begin

A complete Java request has four parts.

The example uses Java 11 or newer. Store credentials in server-side environment variables and substitute the address you need to verify.

01 · URL and method

POST to the verification endpoint

Send the request to https://api.listcleaner.net/verify_email. Use HTTPS and a JSON request body.

02 · Authentication

Send both credential headers

Add X-User-Email and X-Api-Key on the server. Never expose a private API key in public browser JavaScript.

03 · Request body

Provide one email address

Encode the address as JSON using the email property. Let the language’s JSON library escape the value correctly.

04 · Response handling

Read the HTTP code and JSON status

A successful response includes success, request_id, email and status. Handle errors before trusting those fields.

Complete request

Copy the Java example.

The copied request includes the username and API-key headers. Replace the example values with server-side configuration in production.

Use the response

Treat transport, API and verification outcomes separately.

An HTTP success means the API processed the request. The status describes the address result. Network failures, timeouts, authentication errors and insufficient credits need different handling from an undeliverable address.

  1. Check the HTTP status. Parse JSON only when a response body is available.
  2. Check success. On an API error, record the request ID and use the documented error behavior.
  3. Use the verification status. Map ListCleaner statuses to an explicit product policy instead of assuming every non-OK result is identical.
  4. Preserve the request ID. It provides a safe reference for logs and support without exposing credentials.
Example success response
{
  "success": true,
  "request_id": "7ad81f...",
  "email": "customer@example.com",
  "status": "OK"
}

The public response stays concise. Your application decides whether a particular status should be accepted, reviewed or rejected.

Production checklist

Make the integration safe and predictable.

Protect credentials

Load the user email and API key from environment or secret configuration. Do not commit them to source control, log them or return them to a browser.

Set sensible timeouts

Use connection and total-request timeouts. Treat a transport timeout as an unavailable result, not as proof that the submitted address is invalid.

Log safely

Record the request ID, HTTP code, duration and final status. Avoid unnecessary storage of raw credentials or complete personal datasets.

Java FAQ

Common integration questions.

Use the interactive documentation for the authoritative request fields and live testing console.

Where should I store the ListCleaner API key?

Store it in server-side environment or secret configuration. Never embed it in public JavaScript, a mobile application bundle or a committed source file.

Does single verification send an email to the address?

No. The endpoint returns its technical status without sending a verification message to the recipient.

Should I block every result that is not OK?

No. Catch-all, temporary and uncertain outcomes need a documented policy. Reserve hard rejection for statuses that provide sufficiently strong evidence for your use case.

Can I clean complete files from Java?

Yes. The API also supports asynchronous list workflows: upload a supported file, retain the job identifier, poll its status and download the finished result.

News & insights

The latest from ListCleaner.

New analysis and practical guidance, published automatically as soon as it is ready.

View all news →