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

TypeScript SDK

Install the publishable npm SDK for team-scoped REST calls with envelope handling built in.

Loading article…

On this page

  • Install
  • Configure
  • Quickstart
  • Response envelope
  • Client methods
    • Billing
    • Channels
    • email
    • Events
    • Invites
    • Members
    • Rules
    • Teams
  • Errors and limits
  • Related
SDK clientsGo SDK

Use the TypeScript SDK when you want typed methods against /api/v1 without hand-rolling fetch, auth headers, or envelope parsing. The package is generated from the same OpenAPI spec as this API reference and ships at version 1.0.0.

Install

npm install [email protected]

The package name is emailguard-sdk. Pin the semver above in production; all published clients share 1.0.0.

Configure

Set credentials in your environment (or pass them explicitly to loadConfig):

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

API_KEY is accepted as an alias in most clients.

The SDK reads EMAILGUARD_API_BASE_URL when set; otherwise it uses the API origin baked in at build time (https://api.emailguard.co).

Quickstart

This example calls the same operation shown in the API reference quickstart:

import { createPublicClient, loadConfig } from "emailguard-sdk";
 
const client = createPublicClient(loadConfig());
const result = await client.getTeam();

Successful JSON responses use { "code", "data", "message" }. The TypeScript SDK unwraps data automatically — you work with the typed payload directly.

Response envelope

All JSON responses follow a consistent shape:

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

Error responses use the same envelope with a non-SUCCESS code and a human-readable message. The TypeScript client surfaces these as thrown errors with the API message when possible.

Client methods

The generated client exposes 20 operations. Each method maps to an endpoint in the sidebar:

  • cancelPendingInvite() — Cancel a pending invite
  • createNotificationChannel() — Create notification channel
  • createNotificationRule() — Create notification rule
  • deleteNotificationChannel() — Delete notification channel
  • deleteNotificationRule() — Delete notification rule
  • detectEmailCharacteristics() — Detect email characteristics
  • getBillingUsage() — Get billing usage
  • getTeam() — Get team
  • inviteTeamMember() — Invite a team member
  • listNotificationChannels() — List notification channels
  • listNotificationEvents() — List notification events
  • listNotificationRules() — List notification rules
  • listPendingTeamInvites() — List pending team invites
  • listTeamMembers() — List team members
  • removeTeamMember() — Remove a team member
  • testNotificationChannel() — Test notification channel
  • updateNotificationChannel() — Update notification channel
  • updateNotificationRule() — Update notification rule
  • updateTeam() — Update team
  • updateTeamMemberRole() — Update a team member role

Browse by resource group:

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

Every API reference page includes a TypeScript SDK tab with a copy-paste sample for that route.

Errors and limits

HTTPMeaningWhat to do
401Missing or invalid API keyVerify EMAILGUARD_API_KEY and Bearer prefix
403Key lacks scopeAdd the scope listed on the endpoint in API reference
429Rate limit or quotaHonor Retry-After; see API rate limiting

Related

  • SDK clients — overview and credentials
  • MCP integration — same API via Model Context Protocol tools