seven logo

Official Elixir API Client

Send SMS, make voice calls, look up phone numbers, and more — via the seven API.

Hex VersionMIT LicenseElixir ~> 1.14


Prerequisites

Installation

Add the package to your mix.exs dependencies:

def deps do
  [{:seven_io, "~> 0.1"}]
end

Then fetch dependencies:

mix deps.get

Quick Start

# Set your API key (or use the SEVEN_API_KEY environment variable)
Application.put_env(:seven_io, :api_key, "YOUR_API_KEY")

# Check your balance
Seven.Balance.get!()

# Send an SMS
Seven.Sms.post!(%{
  text: "Hello from seven!",
  to: "+491234567890"
})

Usage Examples

Send SMS

Seven.Sms.post!(%{
  text: "Hello from seven!",
  to: "+491234567890"
})

Text-to-Speech Voice Call

Seven.Voice.post!(%{
  text: "Hello, this is a test call from seven.",
  to: "+491234567890"
})

Phone Number Lookup

Seven.Lookup.post!(%{
  number: "+491234567890",
  type: "mnp"
})

Check Balance

Seven.Balance.get!()

All Features

Feature Module Description
SMSSeven.Sms Send and manage SMS messages
VoiceSeven.Voice Text-to-speech voice calls
LookupSeven.Lookup Phone number lookups (HLR, CNAM, MNP, Format)
ContactsSeven.Contacts Manage address book contacts
HooksSeven.Hooks Manage webhooks
BalanceSeven.Balance Retrieve account balance
AnalyticsSeven.Analytics Retrieve account analytics
JournalSeven.Journal Retrieve message journal
PricingSeven.Pricing Retrieve pricing information
StatusSeven.Status Retrieve message delivery status
ValidateForVoiceSeven.ValidateForVoice Validate phone numbers for voice calls
SubaccountsSeven.Subaccounts Manage subaccounts

API Pattern

All modules follow a consistent pattern with two variants:

# Returns {:ok, result} or {:error, reason}
Seven.Sms.post(%{text: "Hi", to: "+49..."})

# Returns the result directly or raises on error
Seven.Sms.post!(%{text: "Hi", to: "+49..."})

Support

Need help? Feel free to contact us or open an issue.

License

MIT