# Ruby SDK

> AI agents: search and read all Moov docs with the docs MCP server at https://docs.moov.io/mcp (no API key). Setup: https://docs.moov.io/guides/developer-tools/mcp-ai/docs-mcp/index.md

Repository: https://github.com/moovfinancial/moov-ruby
Current release for API v2026.07.00: v26.7.9

Pin the package version you install so your integration stays on the API version it was built against. API versions: https://docs.moov.io/api-versions.json

## SDK Installation

The SDK can be installed using [RubyGems](https://rubygems.org/):

```bash
gem install moov_ruby
```

## SDK Example Usage

### Example

```ruby
require 'moov_ruby'

Models = ::Moov::Models
s = ::Moov::Client.new(
  security: Models::Components::Security.new(
    username: '',
    password: ''
  )
)

req = Models::Components::CreateAccount.new(
  account_type: Models::Components::CreateAccountType::BUSINESS,
  profile: Models::Components::CreateProfile.new(
    business: Models::Components::CreateBusinessProfile.new(
      legal_business_name: 'Whole Body Fitness LLC'
    )
  )
)
res = s.accounts.create(request: req)

unless res.account.nil?
  # handle response
end

```

## Authentication

### Per-Client Security Schemes

This SDK supports the following security scheme globally:

| Name                      | Type | Scheme     |
| ------------------------- | ---- | ---------- |
| `username`<br/>`password` | http | HTTP Basic |

You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example:
```ruby
require 'moov_ruby'

Models = ::Moov::Models
s = ::Moov::Client.new(
  security: Models::Components::Security.new(
    username: '',
    password: ''
  )
)

req = Models::Components::CreateAccount.new(
  account_type: Models::Components::CreateAccountType::BUSINESS,
  profile: Models::Components::CreateProfile.new(
    business: Models::Components::CreateBusinessProfile.new(
      legal_business_name: 'Whole Body Fitness LLC'
    )
  )
)
res = s.accounts.create(request: req)

unless res.account.nil?
  # handle response
end

```

### Per-Operation Security Schemes

Some operations in this SDK require the security scheme to be specified at the request level. For example:
```ruby
require 'moov_ruby'

Models = ::Moov::Models
s = ::Moov::Client.new
res = s.avatars.upload(security: Models::Operations::UploadAvatarSecurity.new(

), unique_id: '<id>', avatar_upload_request: Models::Components::AvatarUploadRequest.new(
  file: Models::Components::AvatarUploadRequestFile.new(
    file_name: 'example.file',
    content: File.binread('example.file')
  )
))

if res.status_code == 200
  # handle response
end

```

Full README: https://github.com/moovfinancial/moov-ruby
