---
title: "Ruby gem"
description: "The official Ruby client for the OpenEmail API. No runtime dependencies, and one method for every endpoint."
url: "https://openemail.uk/docs/ruby"
area: "Ruby"
category: "Getting started"
---

# Ruby gem

The official Ruby client for the OpenEmail API. No runtime dependencies, and one method for every endpoint.

## What it is

One gem over the whole API (sending, templates, tracking, threads, drafts, labels, contacts, audiences, sign-up forms, broadcasts, domains, rules, webhooks, calendar, settings, roles, members, suppressions, files and disposable inboxes) with a method for every method of the TypeScript SDK under the same name in snake_case, an error class for every kind of refusal, retries that cannot duplicate a send, and a webhook signature verifier. It needs Ruby 3.2 or later and nothing else, and one client is safe to share across threads and survives a fork.

**Install**

_Bundler_

```bash
bundle add openemail
```

_gem_

```bash
gem install openemail
```

**send_email.rb**

```
require "openemail"

OpenEmail.init(api_key: ENV.fetch("OPENEMAIL_API_KEY"))

OpenEmail.emails.send(
  from: "Acme Billing <billing@acme.com>",
  to: "ada@example.com",
  subject: "Your September invoice",
  html: "<p>Invoice attached.</p>"
)
```

## Where to go

- [Install](https://openemail.uk/docs/ruby/install.md): Add the gem and send your first message.
- [Configuration](https://openemail.uk/docs/ruby/configuration.md): Every option, and what it refuses.
- [Send an email](https://openemail.uk/docs/ruby/emails/send.md): Every field on a message.
- [Threads](https://openemail.uk/docs/ruby/threads.md): Read, organise, snooze, attachments.
- [Webhooks](https://openemail.uk/docs/ruby/webhooks/endpoints.md): Register an endpoint and verify it.
- [Errors](https://openemail.uk/docs/ruby/errors.md): What raises, and how to rescue it.
- [Retries](https://openemail.uk/docs/ruby/retries.md): Why a retried send cannot duplicate.
- [Pagination](https://openemail.uk/docs/ruby/pagination.md): One page, every page, or one item at a time.
- [Rails](https://openemail.uk/docs/ruby/rails.md): Credentials, jobs, webhooks and tests.
- [Every method](https://openemail.uk/docs/ruby/reference/methods.md): The complete list, one row each.

## It wraps the same API as every other client

Everything here is the surface the API reference documents and the TypeScript SDK wraps, so read the API reference for what an endpoint does and this for how to call it from Ruby. Every TypeScript method has a Ruby twin, and the gem’s parity check runs both with the same arguments and fails unless they send byte for byte the same request.

- [API reference](https://openemail.uk/docs/api/overview.md): What each endpoint does, and how it fails.
