Need help with nexmo-ruby?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

1 Stars 3 Forks MIT License 592 Commits 0 Opened issues


Nexmo REST API client for Ruby. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.

Services available


Need anything else?

Contributors list

Nexmo Client Library for Ruby

Gem Version [Coverage Status Coverage Status

Nexmo is now known as Vonage


:exclamation: This SDK and Ruby gem have moved! It is now

, located at vonage/vonage-ruby-sdk.

We will support this repository for 12 months, ending October 2021, with any needed bug or security fixes for the last release of v7.2.1. New features will be released under

, so to take advantage of those please make sure to switch to
as soon as possible so you don't miss out! | |-----------------------------------------|

This is the Ruby client library for Nexmo's API. To use it you'll need a Nexmo account. Sign up for free at


Nexmo Ruby supports MRI/CRuby (2.5 or newer), JRuby (9.2.x), and Truffleruby.


To install the Ruby client library using Rubygems:

gem install nexmo

Alternatively you can clone the repository:

git clone [email protected]:Nexmo/nexmo-ruby.git


Begin by requiring the nexmo library:

require 'nexmo'

Then construct a client object with your key and secret:

client = 'YOUR-API-KEY', api_secret: 'YOUR-API-SECRET')

You can now use the client object to call Nexmo APIs. For example, to send an SMS:

client.sms.send(from: 'Ruby', to: '447700900000', text: 'Hello world')

For production you can specify the

environment variables instead of specifying the key and secret explicitly, keeping your credentials out of source control.


Use the logger option to specify a logger. For example:

require 'logger'

logger =

client = logger)

By default the library sets the logger to

if it is defined.

To disable logging set the logger to


Overriding the default hosts

To override the default hosts that the SDK uses for HTTP requests, you need to specify the

or both in the client configuration. For example:
client =
  api_host: '',
  rest_host: ''

By default the hosts are set to
, respectively.

JWT authentication

To call newer endpoints that support JWT authentication such as the Voice API you'll also need to specify the

options. For example:
client = application_id, private_key: private_key)

Both arguments should have string values corresponding to the

values returned in a "create an application" response. These credentials can be stored in a datastore, in environment variables, on disk outside of source control, or in some kind of key management infrastructure.

By default the library generates a short lived JWT per request. To generate a long lived JWT for multiple requests or to specify JWT claims directly use

and the token option. For example:
claims = {
  application_id: application_id,
  private_key: 'path/to/private.key',
  nbf: 1483315200,
  ttl: 800

token = Nexmo::JWT.generate(claims)

client = token)

Documentation for the Nexmo Ruby JWT generator gem can be found at The documentation outlines all the possible parameters you can use to customize and build a token with.

Webhook signatures

To check webhook signatures you'll also need to specify the

option. For example:
client =
client.config.signature_secret = 'secret'
client.config.signature_method = 'sha512'

if client.signature.check(request.GET)

valid signature


invalid signature


Alternatively you can set the

environment variable.

Note: you'll need to contact [email protected] to enable message signing on your account.


Nexmo Ruby documentation:

Nexmo Ruby code examples:

Nexmo API reference:

Frequently Asked Questions

Supported APIs

The following is a list of Vonage APIs and whether the Ruby SDK provides support for them:

| API | API Release Status | Supported? |----------|:---------:|:-------------:| | Account API | General Availability |✅| | Alerts API | General Availability |✅| | Application API | General Availability |✅| | Audit API | Beta |❌| | Conversation API | Beta |❌| | Dispatch API | Beta |❌| | External Accounts API | Beta |❌| | Media API | Beta | ❌| | Messages API | Beta |❌| | Number Insight API | General Availability |✅| | Number Management API | General Availability |✅| | Pricing API | General Availability |✅| | Redact API | Developer Preview |✅| | Reports API | Beta |❌| | SMS API | General Availability |✅| | Verify API | General Availability |✅| | Voice API | General Availability |✅|


This library is released under the MIT License

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.