Skip to content

fix: match what the live API accepts (every endpoint called live) - #30

Merged
franciscbalint merged 1 commit into
masterfrom
fix/live-api-findings
Oct 23, 2026
Merged

franciscbalint merged 1 commit into
masterfrom
fix/live-api-findings

Conversation

@franciscbalint

Copy link
Copy Markdown
Collaborator

Summary

Every SDK method was called against the live API: the validation-API client and ZeroBounceWarmup, every endpoint, successful or not, to check field names, types and response shapes. Where the live API and the docs disagree, the SDK now follows the API.

Fixed

Method Live API behaviour Change
validate_batch(timeout=…) A JSON number makes the API reject the whole batch with "Invalid API Key or your account ran out of credits"; a string works timeout is sent as a string
send_evaluated_file Rejects an upload ("file_id: This field is required"); the evaluator's file_id starts a validation job send_evaluated_file(file_id)
S3 / SFTP jobs Without return_url: "Provided return URL is not permitted: None"; validateSFTPfile without file_name: "This field is required" Both required, checked before sending
check_domain_dmarc A bare domain: "Please provide a valid email address" Takes an email address
Inbox Placement Tester errors Body is a JSON list (["In-progress tests cannot be deleted."]) Read as its first message
Main client errors — ZBApiException.status_code set (403 Cloudflare, 400/404 API)

Verified live (no change needed)

  • Validation, every validate option (GET and POST), batch, credits, usage, activity, scoring, email finder, domain search, guess_format, filters (add → visible after propagation → delete → "does not exist").
  • Bulk round trips (send, buffered and streamed upload, status, buffered and streamed download, delete) for validation, scoring, email finder and domain search; list evaluator (file and stream).
  • Inbox Placement Tester with the Bearer header: providers, test types, create (Auto Alias and Email), get, list with filters, delete (running test refused), webhook get/set.
  • All 26 Warmup endpoints with a Warmup key, including the 7-day custom-rule cooldown (429), 204 / empty successes, CSV downloads; the test sending account was deleted afterwards.
  • S3 / SFTP: with the required fields every job passes payload validation and stops at the account's missing AWS / SFTP setup, so the jobs themselves are untested.

API issues to report (not SDK bugs)

  • Warmup test-smtp-configuration returns HTTP 500 for any failed SMTP login (documented as a failure message).
  • The docs for send-evaluated-file, S3/SFTP return_url, validateSFTPfile file_name, check-domain-dmarc and validatebatch timeout describe what the API rejects.
  • Cloudflare returns 403 "Access denied" for some malformed file_id values on bulkapi instead of an API error.

Test plan

  • ruff check, compileall, pytest — 130 passed on Python 3.12 and 3.9
  • Every example in README.md (32) and documentation.md (31) runs against the offline fakes
  • Each fix re-verified against the live API

🤖 Generated with Claude Code

Every SDK method was called against the live API (both clients, every
endpoint, success or failure). Where the API and the docs disagree, the SDK
now follows the API:

- validate_batch: timeout is sent as a string. As a JSON number the API
  rejected the whole batch with "Invalid API Key or your account ran out of
  credits".
- send_evaluated_file(file_id): takes the list evaluator's file_id. The docs
  describe a file upload, which the API rejects ("file_id: This field is
  required"). Verified: the evaluator's id starts a validation job.
- S3 / SFTP jobs require return_url (the API answers "Provided return URL is
  not permitted: None" without one) and validate_sftpfile requires file_name.
  With them, every job passes payload validation and stops only at the
  account's missing AWS / SFTP setup.
- ZeroBounceWarmup.check_domain_dmarc takes an email address; the API rejects
  a bare domain ("Please provide a valid email address").
- A JSON-list error body (["In-progress tests cannot be deleted."]) reads as
  its first message.
- ZBApiException.status_code is set by the main client too (403 from
  Cloudflare, 400/404 from the API).

Docs, AGENTS.md (new "live API wins over the docs" rule with the known cases)
and CHANGELOG updated. 130 offline tests on Python 3.12 and 3.9; all 63 doc
examples run offline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@franciscbalint
franciscbalint merged commit 911a71f into master Oct 23, 2026
6 checks passed
@franciscbalint
franciscbalint deleted the fix/live-api-findings branch October 23, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant