Secure Email Gateway Administration API

The Retarus Secure Email Gateway Administration API lets you manage directory data and the allowlists and blocklists of the protection engines programmatically through REST endpoints. It complements administration in the myEAS portal. You can use it to integrate Secure Email Gateway settings into existing automation, for example, to maintain lists from SIEM/SOAR, ticketing, or CI/CD pipelines, or to synchronize central security policies across multiple customers, domains, profiles, or users.

API capabilities

The API lets you create, update, and delete directory objects and allowlist and blocklist entries that influence multiple protection layers. You can centrally manage the following areas.

API-based user provisioning

API-based provisioning covers domains, users, aliases, relays, and address rewriting in Retarus Secure Email Gateway. You configure it through the Administration API, which is intended for repeatable and automatable configuration and administration tasks.

Purpose

Use API-based provisioning when you want to manage directory data and routing-related assignments without the classic DirSync process.

Typical cases:

  • Automated user lifecycle management.

  • Alias-based recipient mapping.

  • User-level relay exceptions and domain-level or user-level rewrite exceptions.

  • Migration from file-based synchronization to API-based provisioning.

Before you start

Use API-based provisioning only after you complete the basic Secure Email Gateway service setup. Define domain onboarding, mail flow design, and service activation before you maintain directory objects and routing settings through the API.

Before implementation, define the following:

  • The authoritative source for domains and users.

  • The synchronization model, for example, initial full sync and later delta updates.

  • The ownership of aliases, relays, and rewrite rules.

  • The retry and rollback handling for failed updates.

Use the following order for implementation:

  1. Create or maintain domains.

  2. Create or maintain users.

  3. Add aliases where required.

  4. Create relay objects where required.

  5. Assign rewrite rules per domain or per user, and relays per user.

Always create domains before users. This avoids dependency issues during provisioning and matches the expected object order for administration.

Use case 1: Provision and manage users

Use this workflow when you want Secure Email Gateway to reflect the valid recipient population of one or more managed domains. The goal is to create, update, and remove users consistently through automation instead of maintaining them manually.

Recommended process:

  1. Ensure that the required domain exists.

  2. Create the user entry.

  3. Update the user entry when the source system changes.

  4. Remove obsolete users according to your retention policy.

Administrative guidance:

  • Use one source of truth for user lifecycle data.

  • Keep identifiers stable.

  • Log failed updates for retry handling.

Use case 2: Primary user and alias mapping

Use this workflow when additional recipient addresses must resolve to one primary user. Typical cases are role addresses, legacy addresses, and migration scenarios.

Recommended process:

  1. Provision the primary user.

  2. Create the alias assignment.

  3. Validate that the alias does not conflict with an existing user.

  4. Remove obsolete aliases before you delete the primary user, unless a replacement mapping exists.

Administrative guidance:

  • Use aliases only for additional accepted recipient addresses.

  • Do not replace real user lifecycle management with alias objects.

  • Review long-lived aliases regularly.

Use case 3: Rewriting and relaying

Use this workflow when mail for a user must be relayed, or when mail for a user or a complete domain must be rewritten, according to a defined delivery design. Advanced routing and rewriting is intended for hybrid email environments and migration scenarios. For details, see Advanced Routing & Rewriting.

Recommended process:

  1. Create the required relay object.

  2. Decide whether a rewrite belongs on domain level or user level. You always assign relays to a user.

  3. Configure the relay or rewrite assignment.

  4. Test the behavior with representative recipient addresses before you apply bulk changes.

Administrative guidance:

  • Prefer domain-level rewrites when the rule applies to most recipients in a domain.

  • Use user-level rewrites and relay assignments only for justified exceptions.

  • Keep exception rules easy to trace and document their ownership.

Authentication and access

The API uses the OAuth 2.0 Client Credentials grant. Request API credentials from Retarus before you call the API. Send the access token as an HTTP Bearer token. Access tokens are short-lived, so request a new token with the same client credentials before expires_in elapses. For the token request, see https://developers.retarus.com/seg/seg-config-openapi/token.

Keep the client secret and every access token confidential. Do not commit them to source control or write them to application logs.

For automation scenarios, use dedicated accounts with granular permissions. Depending on your gateway configuration, you may need to allowlist your source IP addresses.

Migration from DirSync

DirSync is the legacy synchronization model, a separate service that transfers directory data into Retarus systems. Treat API-based provisioning as a separate provisioning path.

Recommended migration approach:

  1. Align the migration plan with account management to avoid implications for billing.

  2. Provide the complete directory via the API.

  3. Validate the API-based data set.

  4. Stop using the legacy synchronization model for the same object scope.

  5. Remove obsolete operational dependencies after you confirm the migration.

Do not use multiple provisioning methods for the same object scope unless you have explicitly validated the setup for your environment. A single authoritative provisioning path avoids conflicts and unexpected overwrites.

Operations

Integrate API-based provisioning into your existing administrative change process instead of using isolated scripts. A staged approach reduces risk. Follow the recommended implementation order.

Recommended operating model:

  • Start with a full synchronization.

  • Use delta updates afterwards.

  • Validate object dependencies before you create assignments.

  • Test bulk changes in a controlled rollout window.

  • Monitor failed or partial updates and define a retry strategy.

More information

The Retarus developer portal provides the Secure Email Gateway Administration API documentation. It includes the full OpenAPI specification with descriptions of all operations, parameters, request and response schemas, and examples.