EmailGuard
  • Pricing
Log inRegister
DocumentationAPI ReferenceKnowledge Base

API reference

Download spec

API reference

Guides and endpoint docs

  • SDK clients
  • TypeScript SDK
  • Go SDK
  • Python SDK
  • PHP SDK
  • Ruby SDK
  • MCP client
  • getGet team
  • patchUpdate team
  • getList team members
  • deleteRemove a team member
  • patchUpdate a team member role
  • deleteCancel a pending invite
  • postInvite a team member
  • getList pending team invites
  • getGet billing usage
  • postCreate notification channel
  • deleteDelete notification channel
  • getList notification channels
  • postTest notification channel
  • putUpdate notification channel
  • getList notification events
  • postCreate notification rule
  • deleteDelete notification rule
  • getList notification rules
  • putUpdate notification rule
  • getDetect email characteristics

Ruby SDK

RubyGem generated from the public OpenAPI spec.

Loading article…

On this page

  • Install
  • Configure
  • Quickstart
  • Response envelope
  • API classes
    • Billing
    • Channels
    • email
    • Events
    • Invites
    • Members
    • Rules
    • Teams
  • Authentication pattern
  • Errors and limits
  • Related
PHP SDKMCP client

The Ruby gem emailguard_sdk exposes 20 REST operations as Emailguard::*Api classes (version 1.0.0).

Install

gem install emailguard_sdk -v 1.0.0

Add gem 'emailguard_sdk', '1.0.0' to your Gemfile for Bundler projects.

Configure

VariableRequiredDescription
EMAILGUARD_API_KEYYesTeam-scoped live key (egsk_live_...)

API_KEY is accepted as an alias in most clients.

Set the host when not using the default API origin:

Emailguard.configure do |config|
  config.host = 'https://api.emailguard.co'
  config.api_key['Authorization'] = ENV['EMAILGUARD_API_KEY']
  config.api_key_prefix['Authorization'] = 'Bearer'
end

Quickstart

require 'emailguard_sdk'
 
Emailguard.configure do |config|
  config.host = 'https://api.emailguard.co'
  config.api_key['Authorization'] = ENV['EMAILGUARD_API_KEY']
  config.api_key_prefix['Authorization'] = 'Bearer'
end
 
api = Emailguard::TeamsApi.new
result = api.api_v1_team_get()

Generated methods return typed objects. Parse the JSON envelope and use data when code is SUCCESS.

Response envelope

{
  "code": "SUCCESS",
  "data": { "..." : "..." },
  "message": "OK"
}

Parse the JSON body and use data when code is SUCCESS.

API classes

Operations are grouped by resource — for example Emailguard::TeamsApi, Emailguard::MembersApi:

Billing

  • Get billing usage

Channels

  • Create notification channel
  • Delete notification channel
  • List notification channels
  • Test notification channel
  • Update notification channel

email

  • Detect email characteristics

Events

  • List notification events

Invites

  • Cancel a pending invite
  • Invite a team member
  • List pending team invites

Members

  • List team members
  • Remove a team member
  • Update a team member role

Rules

  • Create notification rule
  • Delete notification rule
  • List notification rules
  • Update notification rule

Teams

  • Get team
  • Update team

Each endpoint in the API reference includes a Ruby SDK tab under Other with a ready-to-run sample.

Authentication pattern

require 'emailguard_sdk'
 
Emailguard.configure do |config|
  config.api_key['Authorization'] = ENV['EMAILGUARD_API_KEY']
  config.api_key_prefix['Authorization'] = 'Bearer'
end
 
api = Emailguard::TeamsApi.new
# api.api_v1_team_get

Errors and limits

The gem raises Emailguard::ApiError on non-success HTTP responses. Rescue and inspect code/response_body for scope and rate-limit issues — see API rate limiting.

Related

  • SDK clients — overview and credentials
  • PHP SDK — same OpenAPI generator family