Send and receive faxes programmatically. Manage fax applications and media. This skill provides Ruby SDK examples.
Scanned 2/12/2026
Install via CLI
openskills install team-telnyx/telnyx-ext-agent-skills---
name: telnyx-fax-ruby
description: >-
Send and receive faxes programmatically. Manage fax applications and media.
This skill provides Ruby SDK examples.
metadata:
author: telnyx
product: fax
language: ruby
---
# Telnyx Fax - Ruby
## Installation
```bash
gem install telnyx
```
## Setup
```ruby
require "telnyx"
client = Telnyx::Client.new(
api_key: ENV["TELNYX_API_KEY"], # This is the default and can be omitted
)
```
All examples below assume `client` is already initialized as shown above.
## List all Fax Applications
This endpoint returns a list of your Fax Applications inside the 'data' attribute of the response.
`GET /fax_applications`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.fax_applications.list
puts(page)
```
## Creates a Fax Application
Creates a new Fax Application based on the parameters sent in the request.
`POST /fax_applications` — Required: `application_name`, `webhook_event_url`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
fax_application = telnyx.fax_applications.create(application_name: "fax-router", webhook_event_url: "https://example.com")
puts(fax_application)
```
## Retrieve a Fax Application
Return the details of an existing Fax Application inside the 'data' attribute of the response.
`GET /fax_applications/{id}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
fax_application = telnyx.fax_applications.retrieve("1293384261075731499")
puts(fax_application)
```
## Update a Fax Application
Updates settings of an existing Fax Application based on the parameters of the request.
`PATCH /fax_applications/{id}` — Required: `application_name`, `webhook_event_url`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
fax_application = telnyx.fax_applications.update(
"1293384261075731499",
application_name: "fax-router",
webhook_event_url: "https://example.com"
)
puts(fax_application)
```
## Deletes a Fax Application
Permanently deletes a Fax Application.
`DELETE /fax_applications/{id}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
fax_application = telnyx.fax_applications.delete("1293384261075731499")
puts(fax_application)
```
## View a list of faxes
`GET /faxes`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.faxes.list
puts(page)
```
## Send a fax
Send a fax.
`POST /faxes` — Required: `connection_id`, `from`, `to`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
fax = telnyx.faxes.create(connection_id: "234423", from: "+13125790015", to: "+13127367276")
puts(fax)
```
## View a fax
`GET /faxes/{id}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
fax = telnyx.faxes.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(fax)
```
## Delete a fax
`DELETE /faxes/{id}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
result = telnyx.faxes.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(result)
```
## Cancel a fax
Cancel the outbound fax that is in one of the following states: `queued`, `media.processed`, `originated` or `sending`
`POST /faxes/{id}/actions/cancel`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.faxes.actions.cancel("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(response)
```
## Refresh a fax
Refreshes the inbound fax's media_url when it has expired
`POST /faxes/{id}/actions/refresh`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.faxes.actions.refresh("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(response)
```
---
## Webhooks
The following webhook events are sent to your configured webhook URL.
All webhooks include `telnyx-timestamp` and `telnyx-signature-ed25519` headers for verification (Standard Webhooks compatible).
| Event | Description |
|-------|-------------|
| `fax.delivered` | Fax Delivered |
| `fax.failed` | Fax Failed |
| `fax.media.processed` | Fax Media Processed |
| `fax.queued` | Fax Queued |
| `fax.sending.started` | Fax Sending Started |
No comments yet. Be the first to comment!