# Ruby SDK

Official Ruby client for the Instasent A2P Messaging API. Install the instasent gem, instantiate Instasent::Client with your api_sms token, and call send_sms.

**Language:** en
**Audience:** developer
**Docs index (every page):** https://docs.instasent.com/llms.txt
**This zone's index:** https://docs.instasent.com/developers/transactional-api/llms-full.txt
**This page:** https://docs.instasent.com/developers/transactional-api/sdks/ruby/ (HTML) · https://docs.instasent.com/developers/transactional-api/sdks/ruby.md (Markdown)

Minimal client over the A2P Messaging HTTP endpoints. For anything outside the methods below, drop back to a plain HTTP call — the [Reference](/developers/transactional-api/http/reference) documents every endpoint.

## Installation

### Via RubyGems

```bash
gem install instasent
```

### Via Bundler

Add the gem to your `Gemfile`:

```ruby
gem "instasent"
```

Then run `bundle install`.

## Send an SMS

```ruby
require "instasent"

client = Instasent::Client.new(ENV["INSTASENT_TOKEN"])
response = client.send_sms("My company", "+34666666666", "test message")

puts response["response_code"]
puts response["response_body"]
```

## Available methods

```ruby
client.send_sms(sender, to, text)
client.get_sms(page, per_page)
client.get_sms_by_id(message_id)
```

## Getting help

For help installing or using the library, contact [support@instasent.com](mailto:support@instasent.com). Bugs and feature requests belong on the [GitHub repository](https://github.com/instasent).

---

This is one page of the Instasent documentation. For the complete machine-readable index of every guide and API reference, fetch https://docs.instasent.com/llms.txt — start there for full context.
