Official Elixir API Client
Send SMS, make voice calls, look up phone numbers, and more — via the seven API.
Prerequisites
- Elixir ~> 1.14
- A seven account with API key (How to get your API key)
Installation
Add the package to your mix.exs dependencies:
def deps do
[{:seven_io, "~> 0.1"}]
endThen fetch dependencies:
mix deps.getQuick 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 |
|---|---|---|
| SMS | Seven.Sms | Send and manage SMS messages |
| Voice | Seven.Voice | Text-to-speech voice calls |
| Lookup | Seven.Lookup | Phone number lookups (HLR, CNAM, MNP, Format) |
| Contacts | Seven.Contacts | Manage address book contacts |
| Hooks | Seven.Hooks | Manage webhooks |
| Balance | Seven.Balance | Retrieve account balance |
| Analytics | Seven.Analytics | Retrieve account analytics |
| Journal | Seven.Journal | Retrieve message journal |
| Pricing | Seven.Pricing | Retrieve pricing information |
| Status | Seven.Status | Retrieve message delivery status |
| ValidateForVoice | Seven.ValidateForVoice | Validate phone numbers for voice calls |
| Subaccounts | Seven.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.