api/ruby/telnyx-account-reports-ruby/SKILL.md
Generate and retrieve usage reports for billing, analytics, and reconciliation. This skill provides Ruby SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-account-reports-rubyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
gem install telnyx
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.
Retrieves all MDR detailed report requests for the authenticated user
GET /legacy_reporting/batch_detail_records/messaging
messagings = client.legacy.reporting.batch_detail_records.messaging.list
puts(messagings)
Creates a new MDR detailed report request with the specified filters
POST /legacy_reporting/batch_detail_records/messaging — Required: start_time, end_time
messaging = client.legacy.reporting.batch_detail_records.messaging.create(
end_time: "2024-02-12T23:59:59Z",
start_time: "2024-02-01T00:00:00Z"
)
puts(messaging)
Retrieves a specific MDR detailed report request by ID
GET /legacy_reporting/batch_detail_records/messaging/{id}
messaging = client.legacy.reporting.batch_detail_records.messaging.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(messaging)
Deletes a specific MDR detailed report request by ID
DELETE /legacy_reporting/batch_detail_records/messaging/{id}
messaging = client.legacy.reporting.batch_detail_records.messaging.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(messaging)
Retrieves all CDR report requests for the authenticated user
GET /legacy_reporting/batch_detail_records/voice
voices = client.legacy.reporting.batch_detail_records.voice.list
puts(voices)
Creates a new CDR report request with the specified filters
POST /legacy_reporting/batch_detail_records/voice — Required: start_time, end_time
voice = client.legacy.reporting.batch_detail_records.voice.create(
end_time: "2024-02-12T23:59:59Z",
start_time: "2024-02-01T00:00:00Z"
)
puts(voice)
Retrieves a specific CDR report request by ID
GET /legacy_reporting/batch_detail_records/voice/{id}
voice = client.legacy.reporting.batch_detail_records.voice.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(voice)
Deletes a specific CDR report request by ID
DELETE /legacy_reporting/batch_detail_records/voice/{id}
voice = client.legacy.reporting.batch_detail_records.voice.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(voice)
Retrieves all available fields that can be used in CDR reports
GET /legacy_reporting/batch_detail_records/voice/fields
response = client.legacy.reporting.batch_detail_records.voice.retrieve_fields
puts(response)
Fetch all previous requests for MDR usage reports.
GET /legacy_reporting/usage_reports/messaging
page = client.legacy.reporting.usage_reports.messaging.list
puts(page)
Creates a new legacy usage V2 MDR report request with the specified filters
POST /legacy_reporting/usage_reports/messaging
messaging = client.legacy.reporting.usage_reports.messaging.create(aggregation_type: 0)
puts(messaging)
Fetch single MDR usage report by id.
GET /legacy_reporting/usage_reports/messaging/{id}
messaging = client.legacy.reporting.usage_reports.messaging.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(messaging)
Deletes a specific V2 legacy usage MDR report request by ID
DELETE /legacy_reporting/usage_reports/messaging/{id}
messaging = client.legacy.reporting.usage_reports.messaging.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(messaging)
Retrieve a paginated list of telco data usage reports
GET /legacy_reporting/usage_reports/number_lookup
number_lookups = client.legacy.reporting.usage_reports.number_lookup.list
puts(number_lookups)
Submit a new telco data usage report
POST /legacy_reporting/usage_reports/number_lookup
number_lookup = client.legacy.reporting.usage_reports.number_lookup.create
puts(number_lookup)
Retrieve a specific telco data usage report by its ID
GET /legacy_reporting/usage_reports/number_lookup/{id}
number_lookup = client.legacy.reporting.usage_reports.number_lookup.retrieve("id")
puts(number_lookup)
Delete a specific telco data usage report by its ID
DELETE /legacy_reporting/usage_reports/number_lookup/{id}
result = client.legacy.reporting.usage_reports.number_lookup.delete("id")
puts(result)
Generate and fetch speech to text usage report synchronously.
GET /legacy_reporting/usage_reports/speech_to_text
response = client.legacy.reporting.usage_reports.retrieve_speech_to_text
puts(response)
Fetch all previous requests for cdr usage reports.
GET /legacy_reporting/usage_reports/voice
page = client.legacy.reporting.usage_reports.voice.list
puts(page)
Creates a new legacy usage V2 CDR report request with the specified filters
POST /legacy_reporting/usage_reports/voice
voice = client.legacy.reporting.usage_reports.voice.create(
end_time: "2024-02-01T00:00:00Z",
start_time: "2024-02-01T00:00:00Z"
)
puts(voice)
Fetch single cdr usage report by id.
GET /legacy_reporting/usage_reports/voice/{id}
voice = client.legacy.reporting.usage_reports.voice.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(voice)
Deletes a specific V2 legacy usage CDR report request by ID
DELETE /legacy_reporting/usage_reports/voice/{id}
voice = client.legacy.reporting.usage_reports.voice.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(voice)
Fetch all messaging usage reports.
GET /reports/mdr_usage_reports
page = client.reports.mdr_usage_reports.list
puts(page)
Submit request for new new messaging usage report.
POST /reports/mdr_usage_reports
mdr_usage_report = client.reports.mdr_usage_reports.create(
aggregation_type: :NO_AGGREGATION,
end_date: "2020-07-01T00:00:00-06:00",
start_date: "2020-07-01T00:00:00-06:00"
)
puts(mdr_usage_report)
Fetch a single messaging usage report by id
GET /reports/mdr_usage_reports/{id}
mdr_usage_report = client.reports.mdr_usage_reports.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(mdr_usage_report)
Delete messaging usage report by id
DELETE /reports/mdr_usage_reports/{id}
mdr_usage_report = client.reports.mdr_usage_reports.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(mdr_usage_report)
Generate and fetch messaging usage report synchronously.
GET /reports/mdr_usage_reports/sync
response = client.reports.mdr_usage_reports.fetch_sync(aggregation_type: :PROFILE)
puts(response)
Generate and fetch voice usage report synchronously.
GET /reports/cdr_usage_reports/sync
response = client.reports.cdr_usage_reports.fetch_sync(
aggregation_type: :NO_AGGREGATION,
product_breakdown: :NO_BREAKDOWN
)
puts(response)
Get Telnyx usage data by product, broken out by the specified dimensions
GET /usage_reports
page = client.usage_reports.list(dimensions: ["string"], metrics: ["string"], product: "product")
puts(page)
Get the Usage Reports options for querying usage, including the products available and their respective metrics and dimensions
GET /usage_reports/options
response = client.usage_reports.get_options
puts(response)
tools
Build cross-platform VoIP calling apps with React Native using Telnyx Voice SDK. High-level reactive API with automatic lifecycle management, CallKit/ConnectionService integration, and push notifications. Use for mobile VoIP apps with minimal setup.
tools
Build browser-based VoIP calling apps using Telnyx WebRTC JavaScript SDK. Covers authentication, voice calls, events, debugging, call quality metrics, and AI Agent integration. Use for web-based real-time communication.
tools
Build VoIP calling apps on iOS using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, CallKit integration, PushKit/APNS push notifications, call quality metrics, and AI Agent integration. Use when implementing real-time voice communication on iOS.
tools
Build cross-platform VoIP calling apps with Flutter using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, push notifications (FCM + APNS), call quality metrics, and AI Agent integration. Works on Android, iOS, and Web.