PHPackages                             elvesora/soryxa-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. elvesora/soryxa-php

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

elvesora/soryxa-php
===================

Pure PHP SDK for the Soryxa email validation API

v1.0.1(1mo ago)00MITPHPPHP ^8.1

Since Apr 3Pushed 1w agoCompare

[ Source](https://github.com/Elvesora/soryxa-php)[ Packagist](https://packagist.org/packages/elvesora/soryxa-php)[ RSS](/packages/elvesora-soryxa-php/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Elvesora Soryxa PHP SDK
=======================

[](#elvesora-soryxa-php-sdk)

Pure PHP SDK for the [Soryxa](https://www.elvesora.com/soryxa) email validation API. It has no third-party runtime dependencies and returns the current Soryxa `/api/v1/validate` contract, including policy, rollout, score-adjustment, usage, and response-header metadata.

Requirements
------------

[](#requirements)

- PHP 8.1+
- ext-curl
- ext-json

Installation
------------

[](#installation)

```
composer require elvesora/soryxa-php
```

Quick Start
-----------

[](#quick-start)

```
use Elvesora\SoryxaPHP\SoryxaClient;

$soryxa = new SoryxaClient(token: 'your-api-token');

$result = $soryxa->validate('user@example.com');

if ($result->isAllowed()) {
    // Email is valid; proceed.
}

if ($result->isBlocked()) {
    // Email failed validation or matched a block rule.
}

if ($result->needsReview()) {
    // Email needs manual review or safe fallback handling.
}
```

Configuration
-------------

[](#configuration)

```
$soryxa = new SoryxaClient(
    token: 'your-api-token',
    baseUrl: 'https://soryxa.elvesora.com',
    timeout: 30,
    retries: 0,
    retryDelay: 100,
    silentOnLimit: false,
);
```

ParameterDefaultDescription`token`requiredBearer token from your Soryxa dashboard`baseUrl``https://soryxa.elvesora.com`API base URL`timeout``30`Request timeout in seconds`retries``0`Number of retries on 5xx errors`retryDelay``100`Delay between retries in milliseconds`silentOnLimit``false`Return a local `review` result instead of throwing on usage-limit errorsPolicy, Headers, And Correlation
--------------------------------

[](#policy-headers-and-correlation)

`validate()` remains backward-compatible with `validate($email)`. Current optional arguments are:

```
$result = $soryxa->validate(
    'user@example.com',
    'signup',
    [
        'X-Soryxa-Correlation-Id' => 'checkout-2026-06-21-001',
    ],
);
```

Method signature:

```
validate(
    string $email,
    ?string $policyKey = null,
    array $headers = [],
): ValidationResult
```

`policy_key` is optional and defaults server-side to `default`. The validation API accepts only `email`, optional `policy_key`, and optional headers.

Validation Result
-----------------

[](#validation-result)

```
$result->decision;          // allow, block, or review
$result->reasonCode;        // e.g. CLASSIFICATION_VALID
$result->decisionMessage;   // Internal/operator explanation
$result->customerMessage;   // Optional customer-safe message
$result->decisionReasons;   // Human-readable contributing reasons
$result->policyKey;         // Applied policy key, e.g. signup
$result->score;             // Final score, 0-100
$result->baseScore;         // Base score before adjustments, 0-100 or null
$result->scoreAdjustments;  // Policy score adjustments
$result->autoResolution;    // Auto-resolution metadata or null
$result->rollout;           // Rollout telemetry
$result->rawData;           // Raw upstream validation data or null
$result->upstream;          // Upstream health/degradation metadata or null
$result->data;              // Full response data, including future additive fields
$result->headers;           // Captured response headers
$result->usage;             // Usage summary
```

Helper methods mirror the properties:

```
$result->decision();
$result->reasonCode();
$result->decisionMessage();
$result->customerMessage();
$result->decisionReasons();
$result->policyKey();
$result->score();
$result->baseScore();
$result->scoreAdjustments();
$result->autoResolution();
$result->rollout();
$result->upstream();
$result->data();
$result->headers();
```

Response-header helpers:

```
$result->reasonCodeHeader(); // X-Soryxa-Reason-Code
$result->correlationId();    // X-Soryxa-Correlation-Id
$result->header('X-Soryxa-Correlation-Id');
```

Decision helpers:

```
$result->isAllowed();
$result->isBlocked();
$result->needsReview();
$result->isLimitExceeded();
```

Email And Checks
----------------

[](#email-and-checks)

```
$result->email();
$result->username();
$result->domain();
$result->firstName();
$result->lastName();
$result->classification();

$result->isSyntaxValid();
$result->hasMxRecords();
$result->isSmtpValid();
$result->isDisposable();
$result->isFreeProvider();
$result->isRoleAccount();
$result->isBogus();
$result->isCatchAll();
$result->isDomainRegistered();
$result->isNewlyRegisteredDomain();
```

Each check is a `Check` object:

```
foreach ($result->checks as $check) {
    $check->name;
    $check->status;  // passed, failed, warning, or error
    $check->message;

    $check->passed();
    $check->failed();
    $check->isWarning();
    $check->isError();
}

$result->getCheck('Domain MX');
$result->passedChecks();
$result->failedChecks();
$result->warningChecks();
```

Usage Tracking
--------------

[](#usage-tracking)

Every successful API response includes current usage:

```
$result->usage->remaining;
$result->usage->limit;
$result->usage->usagePercent();
```

Serialization
-------------

[](#serialization)

```
$array = $result->toArray();
```

`toArray()` includes all known fields, `usage`, `headers`, and any unknown future fields returned under `data`.

Silent Mode
-----------

[](#silent-mode)

By default, exceeding your API usage limit throws `UsageLimitException`. If `silentOnLimit` is `true`, `validate()` returns a local fallback result instead:

- `decision` is `review`
- `reasonCode` is `LIMIT_EXCEEDED`
- `decisionMessage` explains the quota state
- `score` and `baseScore` are `0`
- `isLimitExceeded()` returns `true`
- `isAllowed()` returns `false`

This keeps application code running without silently approving traffic when quota is exhausted.

```
$result = $soryxa->validate('user@example.com');

if ($result->isLimitExceeded()) {
    // Log, alert, queue for review, or ask the customer to retry later.
}
```

Error Handling
--------------

[](#error-handling)

```
use Elvesora\SoryxaPHP\SoryxaClient;
use Elvesora\SoryxaPHP\Exceptions\AuthenticationException;
use Elvesora\SoryxaPHP\Exceptions\SubscriptionException;
use Elvesora\SoryxaPHP\Exceptions\InsufficientScopeException;
use Elvesora\SoryxaPHP\Exceptions\ValidationException;
use Elvesora\SoryxaPHP\Exceptions\UsageLimitException;
use Elvesora\SoryxaPHP\Exceptions\ServerException;
use Elvesora\SoryxaPHP\Exceptions\ConnectionException;
use Elvesora\SoryxaPHP\Exceptions\SoryxaException;

try {
    $result = $soryxa->validate($email);
} catch (AuthenticationException $e) {
    // 401: invalid, expired, or missing token.
} catch (SubscriptionException $e) {
    // 402: no active subscription.
} catch (InsufficientScopeException $e) {
    // 403: token lacks required scope.
} catch (ValidationException $e) {
    // 422: invalid input.
} catch (UsageLimitException $e) {
    // 429: usage limit exceeded.
} catch (ServerException $e) {
    // 5xx: server-side error.
} catch (ConnectionException $e) {
    // Network failure, timeout, or invalid response.
} catch (SoryxaException $e) {
    // Other API error.
}
```

Every exception exposes:

```
$e->getMessage();
$e->getErrorCode();
$e->getStatusCode();
$e->getResponseBody();
```

Decision Reference
------------------

[](#decision-reference)

The `decision` field is always one of:

DecisionMeaning`allow`Email passed validation`block`Email failed validation or matched a block rule`review`Email is risky, degraded, quota-limited, or requires manual reviewCommon reason codes include:

DecisionReason CodeDescription`allow``ALLOW_LIST_MATCH`Email matched your allow list`allow``CLASSIFICATION_VALID`Email classified as valid`allow``DEFAULT_ALLOW`No blocking rules triggered`block``BLOCK_LIST_MATCH`Email matched your block list`block``BLOCK_DISPOSABLE`Disposable email address blocked`block``BLOCK_FREE_PROVIDER`Free provider blocked by rules`block``BLOCK_ROLE_ACCOUNT`Role-based address blocked`block``BLOCK_BOGUS_DOMAIN`Domain is bogus or non-existent`block``SCORE_BELOW_BLOCK_THRESHOLD`Score below configured block threshold`block``CLASSIFICATION_INVALID`Email classified as invalid`review``SCORE_BELOW_THRESHOLD`Score below review threshold`review``CLASSIFICATION_RISKY`Email classified as risky`review``DISPOSABLE_REVIEW`Disposable address flagged for review`review``SERVICE_UNAVAILABLE`Upstream check unavailable`review``LIMIT_EXCEEDED`Local silent-mode fallback onlyFramework Integration
---------------------

[](#framework-integration)

This package is framework-agnostic. For Laravel projects, use [elvesora/soryxa-laravel](https://github.com/elvesora/soryxa-laravel), which provides a service provider, facade, and config file.

Development
-----------

[](#development)

Run the package contract checks:

```
composer test
```

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance96

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~100 days

Total

2

Last Release

34d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/541009b7a92054d76583bac137139b098c30f23a4b6c9cce01a6c0f600c16ddc?d=identicon)[WebRegulus](/maintainers/WebRegulus)

---

Top Contributors

[![WebRegulus](https://avatars.githubusercontent.com/u/46540140?v=4)](https://github.com/WebRegulus "WebRegulus (3 commits)")

---

Tags

phpvalidationemailsoryxa

### Embed Badge

![Health badge](/badges/elvesora-soryxa-php/health.svg)

```
[![Health](https://phpackages.com/badges/elvesora-soryxa-php/health.svg)](https://phpackages.com/packages/elvesora-soryxa-php)
```

###  Alternatives

[stymiee/email-validator

A robust PHP 7.4+ email validation library that extends beyond basic validation with MX record checks, disposable email detection, and free email provider validation. Features include strict typing, custom validator support, internationalization (i18n), and an extensible architecture. Perfect for applications requiring thorough email verification with customizable validation rules.

33509.1k1](/packages/stymiee-email-validator)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

265192.2k1](/packages/erag-laravel-disposable-email)[martian/spammailchecker

A laravel package that protect users from entering non-existing/spam email addresses.

432.3k](/packages/martian-spammailchecker)[henrique-borba/php-sieve-manager

A modern (started in 2022) PHP library for the ManageSieve protocol (RFC5804) to create/edit Sieve scripts (RFC5228). Used by Cypht Webmail.

27146.8k5](/packages/henrique-borba-php-sieve-manager)[ashallendesign/laravel-mailboxlayer

A lightweight Laravel package for validating emails using the Mailbox Layer API.

772.3k](/packages/ashallendesign-laravel-mailboxlayer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
