一键导入
telnyx-account-reports-go
Generate and retrieve usage reports for billing, analytics, and reconciliation. This skill provides Go SDK examples.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate and retrieve usage reports for billing, analytics, and reconciliation. This skill provides Go SDK examples.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Automated Telnyx bot account signup via obfuscated mathematical challenge
Track agent activities using the Telnyx AI Missions API. Use this skill when executing multi-step tasks that should be logged and tracked. Supports creating voice/SMS agents, scheduling calls, and retrieving conversation insights. Use when tasks involve calling people, sending SMS, or any substantial tracked work.
Automatically upgrade Telnyx account from freemium to professional tier
Test VoIP push notifications for Telnyx WebRTC iOS (APNs) and Android (FCM) apps. Use when debugging push notification delivery, validating certificate/credential setup, or testing that a device receives VoIP pushes correctly.
Text-to-vector embeddings and semantic search using Telnyx AI. Generate embedding vectors via an OpenAI-compatible API — no OpenAI or Google API keys required.
Register brands and campaigns for 10DLC (10-digit long code) A2P messaging compliance in the US. Manage campaign assignments to phone numbers. This skill provides Go SDK examples.
| name | telnyx-account-reports-go |
| description | Generate and retrieve usage reports for billing, analytics, and reconciliation. This skill provides Go SDK examples. |
| metadata | {"author":"telnyx","product":"account-reports","language":"go","generated_by":"telnyx-ext-skills-generator"} |
go get github.com/team-telnyx/telnyx-go
import (
"context"
"fmt"
"os"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
client := telnyx.NewClient(
option.WithAPIKey(os.Getenv("TELNYX_API_KEY")),
)
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, err := client.Legacy.Reporting.BatchDetailRecords.Messaging.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messagings.Data)
Creates a new MDR detailed report request with the specified filters
POST /legacy_reporting/batch_detail_records/messaging — Required: start_time, end_time
messaging, err := client.Legacy.Reporting.BatchDetailRecords.Messaging.New(context.TODO(), telnyx.LegacyReportingBatchDetailRecordMessagingNewParams{
EndTime: time.Now(),
StartTime: time.Now(),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messaging.Data)
Retrieves a specific MDR detailed report request by ID
GET /legacy_reporting/batch_detail_records/messaging/{id}
messaging, err := client.Legacy.Reporting.BatchDetailRecords.Messaging.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messaging.Data)
Deletes a specific MDR detailed report request by ID
DELETE /legacy_reporting/batch_detail_records/messaging/{id}
messaging, err := client.Legacy.Reporting.BatchDetailRecords.Messaging.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messaging.Data)
Retrieves all CDR report requests for the authenticated user
GET /legacy_reporting/batch_detail_records/voice
voices, err := client.Legacy.Reporting.BatchDetailRecords.Voice.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", voices.Data)
Creates a new CDR report request with the specified filters
POST /legacy_reporting/batch_detail_records/voice — Required: start_time, end_time
voice, err := client.Legacy.Reporting.BatchDetailRecords.Voice.New(context.TODO(), telnyx.LegacyReportingBatchDetailRecordVoiceNewParams{
EndTime: time.Now(),
StartTime: time.Now(),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", voice.Data)
Retrieves a specific CDR report request by ID
GET /legacy_reporting/batch_detail_records/voice/{id}
voice, err := client.Legacy.Reporting.BatchDetailRecords.Voice.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", voice.Data)
Deletes a specific CDR report request by ID
DELETE /legacy_reporting/batch_detail_records/voice/{id}
voice, err := client.Legacy.Reporting.BatchDetailRecords.Voice.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", voice.Data)
Retrieves all available fields that can be used in CDR reports
GET /legacy_reporting/batch_detail_records/voice/fields
response, err := client.Legacy.Reporting.BatchDetailRecords.Voice.GetFields(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Billing)
Fetch all previous requests for MDR usage reports.
GET /legacy_reporting/usage_reports/messaging
page, err := client.Legacy.Reporting.UsageReports.Messaging.List(context.TODO(), telnyx.LegacyReportingUsageReportMessagingListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Creates a new legacy usage V2 MDR report request with the specified filters
POST /legacy_reporting/usage_reports/messaging
messaging, err := client.Legacy.Reporting.UsageReports.Messaging.New(context.TODO(), telnyx.LegacyReportingUsageReportMessagingNewParams{
AggregationType: 0,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messaging.Data)
Fetch single MDR usage report by id.
GET /legacy_reporting/usage_reports/messaging/{id}
messaging, err := client.Legacy.Reporting.UsageReports.Messaging.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messaging.Data)
Deletes a specific V2 legacy usage MDR report request by ID
DELETE /legacy_reporting/usage_reports/messaging/{id}
messaging, err := client.Legacy.Reporting.UsageReports.Messaging.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messaging.Data)
Retrieve a paginated list of telco data usage reports
GET /legacy_reporting/usage_reports/number_lookup
numberLookups, err := client.Legacy.Reporting.UsageReports.NumberLookup.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", numberLookups.Data)
Submit a new telco data usage report
POST /legacy_reporting/usage_reports/number_lookup
numberLookup, err := client.Legacy.Reporting.UsageReports.NumberLookup.New(context.TODO(), telnyx.LegacyReportingUsageReportNumberLookupNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", numberLookup.Data)
Retrieve a specific telco data usage report by its ID
GET /legacy_reporting/usage_reports/number_lookup/{id}
numberLookup, err := client.Legacy.Reporting.UsageReports.NumberLookup.Get(context.TODO(), "id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", numberLookup.Data)
Delete a specific telco data usage report by its ID
DELETE /legacy_reporting/usage_reports/number_lookup/{id}
err := client.Legacy.Reporting.UsageReports.NumberLookup.Delete(context.TODO(), "id")
if err != nil {
panic(err.Error())
}
Generate and fetch speech to text usage report synchronously.
GET /legacy_reporting/usage_reports/speech_to_text
response, err := client.Legacy.Reporting.UsageReports.GetSpeechToText(context.TODO(), telnyx.LegacyReportingUsageReportGetSpeechToTextParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
Fetch all previous requests for cdr usage reports.
GET /legacy_reporting/usage_reports/voice
page, err := client.Legacy.Reporting.UsageReports.Voice.List(context.TODO(), telnyx.LegacyReportingUsageReportVoiceListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Creates a new legacy usage V2 CDR report request with the specified filters
POST /legacy_reporting/usage_reports/voice
voice, err := client.Legacy.Reporting.UsageReports.Voice.New(context.TODO(), telnyx.LegacyReportingUsageReportVoiceNewParams{
EndTime: time.Now(),
StartTime: time.Now(),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", voice.Data)
Fetch single cdr usage report by id.
GET /legacy_reporting/usage_reports/voice/{id}
voice, err := client.Legacy.Reporting.UsageReports.Voice.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", voice.Data)
Deletes a specific V2 legacy usage CDR report request by ID
DELETE /legacy_reporting/usage_reports/voice/{id}
voice, err := client.Legacy.Reporting.UsageReports.Voice.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", voice.Data)
Fetch all messaging usage reports.
GET /reports/mdr_usage_reports
page, err := client.Reports.MdrUsageReports.List(context.TODO(), telnyx.ReportMdrUsageReportListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Submit request for new new messaging usage report.
POST /reports/mdr_usage_reports
mdrUsageReport, err := client.Reports.MdrUsageReports.New(context.TODO(), telnyx.ReportMdrUsageReportNewParams{
AggregationType: telnyx.ReportMdrUsageReportNewParamsAggregationTypeNoAggregation,
EndDate: time.Now(),
StartDate: time.Now(),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mdrUsageReport.Data)
Fetch a single messaging usage report by id
GET /reports/mdr_usage_reports/{id}
mdrUsageReport, err := client.Reports.MdrUsageReports.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mdrUsageReport.Data)
Delete messaging usage report by id
DELETE /reports/mdr_usage_reports/{id}
mdrUsageReport, err := client.Reports.MdrUsageReports.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mdrUsageReport.Data)
Generate and fetch messaging usage report synchronously.
GET /reports/mdr_usage_reports/sync
response, err := client.Reports.MdrUsageReports.FetchSync(context.TODO(), telnyx.ReportMdrUsageReportFetchSyncParams{
AggregationType: telnyx.ReportMdrUsageReportFetchSyncParamsAggregationTypeProfile,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
Generate and fetch voice usage report synchronously.
GET /reports/cdr_usage_reports/sync
response, err := client.Reports.CdrUsageReports.FetchSync(context.TODO(), telnyx.ReportCdrUsageReportFetchSyncParams{
AggregationType: telnyx.ReportCdrUsageReportFetchSyncParamsAggregationTypeNoAggregation,
ProductBreakdown: telnyx.ReportCdrUsageReportFetchSyncParamsProductBreakdownNoBreakdown,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
Get Telnyx usage data by product, broken out by the specified dimensions
GET /usage_reports
page, err := client.UsageReports.List(context.TODO(), telnyx.UsageReportListParams{
Dimensions: []string{"string"},
Metrics: []string{"string"},
Product: "product",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Get the Usage Reports options for querying usage, including the products available and their respective metrics and dimensions
GET /usage_reports/options
response, err := client.UsageReports.GetOptions(context.TODO(), telnyx.UsageReportGetOptionsParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)