{"id":"549b710a-c110-44b2-8ad9-32920d05b73a","shortId":"pbTp3v","kind":"skill","title":"telnyx-account-go","tagline":">-","description":"<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->\n\n# Telnyx Account - Go\n\n## Installation\n\n```bash\ngo get github.com/team-telnyx/telnyx-go\n```\n\n## Setup\n\n```go\nimport (\n  \"context\"\n  \"fmt\"\n  \"os\"\n\n  \"github.com/team-telnyx/telnyx-go\"\n  \"github.com/team-telnyx/telnyx-go/option\"\n)\n\nclient := telnyx.NewClient(\n  option.WithAPIKey(os.Getenv(\"TELNYX_API_KEY\")),\n)\n```\n\nAll examples below assume `client` is already initialized as shown above.\n\n## Error Handling\n\nAll API calls can fail with network errors, rate limits (429), validation errors (422),\nor authentication errors (401). Always handle errors in production code:\n\n```go\nimport \"errors\"\n\nresult, err := client.Messages.Send(ctx, params)\nif err != nil {\n  var apiErr *telnyx.Error\n  if errors.As(err, &apiErr) {\n    switch apiErr.StatusCode {\n    case 422:\n      fmt.Println(\"Validation error — check required fields and formats\")\n    case 429:\n      // Rate limited — wait and retry with exponential backoff\n      fmt.Println(\"Rate limited, retrying...\")\n    default:\n      fmt.Printf(\"API error %d: %s\\n\", apiErr.StatusCode, apiErr.Error())\n    }\n  } else {\n    fmt.Println(\"Network error — check connectivity and retry\")\n  }\n}\n```\n\nCommon error codes: `401` invalid API key, `403` insufficient permissions,\n`404` resource not found, `422` validation error (check field formats),\n`429` rate limited (retry with exponential backoff).\n\n## Important Notes\n\n- **Pagination:** Use `ListAutoPaging()` for automatic iteration: `iter := client.Resource.ListAutoPaging(ctx, params); for iter.Next() { item := iter.Current() }`.\n\n## List Audit Logs\n\nRetrieve a list of audit log entries. Audit logs are a best-effort, eventually consistent record of significant account-related changes.\n\n`GET /audit_events`\n\n```go\n\tpage, err := client.AuditEvents.List(context.Background(), telnyx.AuditEventListParams{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n```\n\nReturns: `alternate_resource_id` (string | null), `change_made_by` (enum: telnyx, account_manager, account_owner, organization_member), `change_type` (string), `changes` (array | null), `created_at` (date-time), `id` (uuid), `organization_id` (uuid), `record_type` (string), `resource_id` (string), `user_id` (uuid)\n\n## Get user balance details\n\n`GET /balance`\n\n```go\n\tbalance, err := client.Balance.Get(context.Background())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", balance.Data)\n```\n\nReturns: `available_credit` (string), `balance` (string), `credit_limit` (string), `currency` (string), `pending` (string), `record_type` (enum: balance)\n\n## Get monthly charges breakdown\n\nRetrieve a detailed breakdown of monthly charges for phone numbers in a specified date range. The date range cannot exceed 31 days.\n\n`GET /charges_breakdown`\n\n```go\n\tchargesBreakdown, err := client.ChargesBreakdown.Get(context.Background(), telnyx.ChargesBreakdownGetParams{\n\t\tStartDate: time.Now(),\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", chargesBreakdown.Data)\n```\n\nReturns: `currency` (string), `end_date` (date), `results` (array[object]), `start_date` (date), `user_email` (email), `user_id` (string)\n\n## Get monthly charges summary\n\nRetrieve a summary of monthly charges for a specified date range. The date range cannot exceed 31 days.\n\n`GET /charges_summary`\n\n```go\n\tchargesSummary, err := client.ChargesSummary.Get(context.Background(), telnyx.ChargesSummaryGetParams{\n\t\tEndDate:   time.Now(),\n\t\tStartDate: time.Now(),\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", chargesSummary.Data)\n```\n\nReturns: `currency` (string), `end_date` (date), `start_date` (date), `summary` (object), `total` (object), `user_email` (email), `user_id` (string)\n\n## Search detail records\n\nSearch for any detail record across the Telnyx Platform\n\n`GET /detail_records`\n\n```go\n\tpage, err := client.DetailRecords.List(context.Background(), telnyx.DetailRecordListParams{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n```\n\nReturns: `carrier` (string), `carrier_fee` (string), `cld` (string), `cli` (string), `completed_at` (date-time), `cost` (string), `country_code` (string), `created_at` (date-time), `currency` (string), `delivery_status` (string), `delivery_status_failover_url` (string), `delivery_status_webhook_url` (string), `direction` (enum: inbound, outbound), `errors` (array[string]), `fteu` (boolean), `mcc` (string), `message_type` (enum: SMS, MMS, RCS), `mnc` (string), `on_net` (boolean), `parts` (integer), `profile_id` (string), `profile_name` (string), `rate` (string), `record_type` (string), `sent_at` (date-time), `source_country_code` (string), `status` (enum: gw_timeout, delivered, dlr_unconfirmed, dlr_timeout, received, gw_reject, failed), `tags` (string), `updated_at` (date-time), `user_id` (string), `uuid` (string)\n\n## List invoices\n\nRetrieve a paginated list of invoices.\n\n`GET /invoices`\n\n```go\n\tpage, err := client.Invoices.List(context.Background(), telnyx.InvoiceListParams{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n```\n\nReturns: `file_id` (uuid), `invoice_id` (uuid), `paid` (boolean), `period_end` (date), `period_start` (date), `url` (uri)\n\n## Get invoice by ID\n\nRetrieve a single invoice by its unique identifier.\n\n`GET /invoices/{id}`\n\n```go\n\tinvoice, err := client.Invoices.Get(\n\t\tcontext.Background(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\ttelnyx.InvoiceGetParams{},\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", invoice.Data)\n```\n\nReturns: `download_url` (uri), `file_id` (uuid), `invoice_id` (uuid), `paid` (boolean), `period_end` (date), `period_start` (date), `url` (uri)\n\n## List auto recharge preferences\n\nReturns the payment auto recharge preferences.\n\n`GET /payment/auto_recharge_prefs`\n\n```go\n\tautoRechargePrefs, err := client.Payment.AutoRechargePrefs.List(context.Background())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", autoRechargePrefs.Data)\n```\n\nReturns: `enabled` (boolean), `id` (string), `invoice_enabled` (boolean), `preference` (enum: credit_paypal, ach), `recharge_amount` (string), `record_type` (string), `threshold_amount` (string)\n\n## Update auto recharge preferences\n\nUpdate payment auto recharge preferences.\n\n`PATCH /payment/auto_recharge_prefs`\n\nOptional: `enabled` (boolean), `invoice_enabled` (boolean), `preference` (enum: credit_paypal, ach), `recharge_amount` (string), `threshold_amount` (string)\n\n```go\n\tautoRechargePref, err := client.Payment.AutoRechargePrefs.Update(context.Background(), telnyx.PaymentAutoRechargePrefUpdateParams{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", autoRechargePref.Data)\n```\n\nReturns: `enabled` (boolean), `id` (string), `invoice_enabled` (boolean), `preference` (enum: credit_paypal, ach), `recharge_amount` (string), `record_type` (string), `threshold_amount` (string)\n\n## List User Tags\n\nList all user tags.\n\n`GET /user_tags`\n\n```go\n\tuserTags, err := client.UserTags.List(context.Background(), telnyx.UserTagListParams{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", userTags.Data)\n```\n\nReturns: `number_tags` (array[string]), `outbound_profile_tags` (array[string])\n\n## Create a stored payment transaction\n\n`POST /v2/payment/stored_payment_transactions` — Required: `amount`\n\n```go\n\tresponse, err := client.Payment.NewStoredPaymentTransaction(context.Background(), telnyx.PaymentNewStoredPaymentTransactionParams{\n\t\tAmount: \"120.00\",\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n```\n\nReturns: `amount_cents` (integer), `amount_currency` (string), `auto_recharge` (boolean), `created_at` (date-time), `id` (string), `processor_status` (string), `record_type` (enum: transaction), `transaction_processing_type` (enum: stored_payment)\n\n## List webhook deliveries\n\nLists webhook_deliveries for the authenticated user\n\n`GET /webhook_deliveries`\n\n```go\n\tpage, err := client.WebhookDeliveries.List(context.Background(), telnyx.WebhookDeliveryListParams{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n```\n\nReturns: `attempts` (array[object]), `finished_at` (date-time), `id` (uuid), `record_type` (string), `started_at` (date-time), `status` (enum: delivered, failed), `user_id` (uuid), `webhook` (object)\n\n## Find webhook_delivery details by ID\n\nProvides webhook_delivery debug data, such as timestamps, delivery status and attempts.\n\n`GET /webhook_deliveries/{id}`\n\n```go\n\twebhookDelivery, err := client.WebhookDeliveries.Get(context.Background(), \"C9C0797E-901D-4349-A33C-C2C8F31A92C2\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", webhookDelivery.Data)\n```\n\nReturns: `attempts` (array[object]), `finished_at` (date-time), `id` (uuid), `record_type` (string), `started_at` (date-time), `status` (enum: delivered, failed), `user_id` (uuid), `webhook` (object)","tags":["telnyx","account","team-telnyx","agent-skills","ai-coding-agent","claude-code","cpaas","cursor","iot","llm","sdk","sip"],"capabilities":["skill","source-team-telnyx","skill-telnyx-account-go","topic-agent-skills","topic-ai-coding-agent","topic-claude-code","topic-cpaas","topic-cursor","topic-iot","topic-llm","topic-sdk","topic-sip","topic-sms","topic-speech-to-text","topic-telephony"],"categories":["ai"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/team-telnyx/ai/telnyx-account-go","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add team-telnyx/ai","source_repo":"https://github.com/team-telnyx/ai","install_from":"skills.sh"}},"qualityScore":"0.533","qualityRationale":"deterministic score 0.53 from registry signals: · indexed on github topic:agent-skills · 167 github stars · SKILL.md body (8,794 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T12:54:40.121Z","embedding":null,"createdAt":"2026-04-18T22:05:53.886Z","updatedAt":"2026-04-22T12:54:40.121Z","lastSeenAt":"2026-04-22T12:54:40.121Z","tsv":"'/audit_events':202 '/balance':265 '/charges_breakdown':324 '/charges_summary':383 '/detail_records':435 '/invoices':569,615 '/payment/auto_recharge_prefs':669,716 '/team-telnyx/telnyx-go':14,23 '/team-telnyx/telnyx-go/option':26 '/user_tags':779 '/v2/payment/stored_payment_transactions':811 '/webhook_deliveries':872,935 '120.00':821 '182bd5e5':623 '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e':622 '31':321,380 '401':64,135 '403':139 '404':142 '422':60,92,146 '429':57,102,152 '4349':945 '4fe4':625 '6e1a':624 '901d':944 'a33c':947 'a33c-c2c8f31a92c2':946 'a799':626 'aa6d9a6ab26e':627 'account':3,6,198,229,231 'account-rel':197 'ach':696,727,761 'across':430 'alreadi':40 'altern':219 'alway':65 'amount':698,704,729,732,763,769,813,820,832,835 'api':32,48,117,137 'apierr':83,88 'apierr.error':123 'apierr.statuscode':90,122 'array':239,349,496,798,803,890,960 'assum':37 'attempt':889,933,959 'audit':176,182,185 'authent':62,869 'auto':659,665,707,712,838 'automat':165 'autorechargepref':671,735 'autorechargepref.data':748 'autorechargeprefs.data':683 'avail':281 'backoff':110,158 'balanc':262,267,284,296 'balance.data':279 'bash':9 'best':190 'best-effort':189 'boolean':499,512,593,649,686,691,719,722,751,756,840 'breakdown':300,304 'c2c8f31a92c2':948 'c9c0797e':943 'c9c0797e-901d':942 'call':49 'cannot':319,378 'carrier':452,454 'case':91,101 'cent':833 'chang':200,224,235,238 'charg':299,307,362,369 'chargesbreakdown':326 'chargesbreakdown.data':341 'chargessummari':385 'chargessummary.data':402 'check':96,128,149 'cld':457 'cli':459 'client':27,38 'client.auditevents.list':206 'client.balance.get':269 'client.chargesbreakdown.get':328 'client.chargessummary.get':387 'client.detailrecords.list':439 'client.invoices.get':620 'client.invoices.list':573 'client.messages.send':76 'client.payment.autorechargeprefs.list':673 'client.payment.autorechargeprefs.update':737 'client.payment.newstoredpaymenttransaction':817 'client.resource.listautopaging':168 'client.usertags.list':783 'client.webhookdeliveries.get':940 'client.webhookdeliveries.list':876 'code':70,134,469,533 'common':132 'complet':461 'connect':129 'consist':193 'context':18 'context.background':207,270,329,388,440,574,621,674,738,784,818,877,941 'cost':466 'countri':468,532 'creat':241,471,805,841 'credit':282,286,694,725,759 'ctx':77,169 'currenc':289,343,404,476,836 'd':119 'data':926 'date':244,314,317,346,347,352,353,373,376,407,408,410,411,464,474,529,553,596,599,652,655,844,895,905,965,975 'date-tim':243,463,473,528,552,843,894,904,964,974 'day':322,381 'debug':925 'default':115 'deliv':539,909,979 'deliveri':478,481,486,863,866,918,924,930 'detail':263,303,423,428,919 'direct':491 'dlr':540,542 'download':639 'effort':191 'els':124 'email':355,356,417,418 'enabl':685,690,718,721,750,755 'end':345,406,595,651 'enddat':390 'entri':184 'enum':227,295,492,504,536,693,724,758,853,858,908,978 'err':75,80,87,205,210,213,268,272,275,327,334,337,386,395,398,438,443,446,572,577,580,619,630,633,672,676,679,736,741,744,782,787,790,816,823,826,875,880,883,939,950,953 'error':45,54,59,63,67,73,95,118,127,133,148,495 'errors.as':86 'eventu':192 'exampl':35 'exceed':320,379 'exponenti':109,157 'fail':51,547,910,980 'failov':483 'fee':455 'field':98,150 'file':586,642 'find':916 'finish':892,962 'fmt':19 'fmt.printf':116,214,276,338,399,447,581,634,680,745,791,827,884,954 'fmt.println':93,111,125 'format':100,151 'found':145 'fteu':498 'get':11,201,260,264,297,323,360,382,434,568,602,614,668,778,871,934 'github.com':13,22,25 'github.com/team-telnyx/telnyx-go':12,21 'github.com/team-telnyx/telnyx-go/option':24 'go':4,7,10,16,71,203,266,325,384,436,570,617,670,734,780,814,873,937 'gw':537,545 'handl':46,66 'id':221,246,249,255,258,358,420,516,556,587,590,605,616,643,646,687,752,846,897,912,921,936,967,982 'identifi':613 'import':17,72,159 'inbound':493 'initi':41 'instal':8 'insuffici':140 'integ':514,834 'invalid':136 'invoic':561,567,589,603,609,618,645,689,720,754 'invoice.data':637 'item':173 'iter':166,167 'iter.current':174 'iter.next':172 'key':33,138 'limit':56,104,113,154,287 'list':175,180,560,565,658,771,774,861,864 'listautopag':163 'log':177,183,186 'log.fatal':212,274,336,397,445,579,632,678,743,789,825,882,952 'made':225 'manag':230 'mcc':500 'member':234 'messag':502 'mms':506 'mnc':508 'month':298,306,361,368 'n':121,216,278,340,401,449,583,636,682,747,793,829,886,956 'name':519 'net':511 'network':53,126 'nil':81,211,273,335,396,444,578,631,677,742,788,824,881,951 'note':160 'null':223,240 'number':310,796 'object':350,413,415,891,915,961,985 'option':717 'option.withapikey':29 'organ':233,248 'os':20 'os.getenv':30 'outbound':494,800 'owner':232 'page':204,217,437,450,571,584,874,887 'pagin':161,564 'paid':592,648 'param':78,170 'part':513 'patch':715 'payment':664,711,808,860 'paypal':695,726,760 'pend':291 'period':594,597,650,653 'permiss':141 'phone':309 'platform':433 'post':810 'prefer':661,667,692,709,714,723,757 'process':856 'processor':848 'product':69 'profil':515,518,801 'provid':922 'rang':315,318,374,377 'rate':55,103,112,153,521 'rcs':507 'receiv':544 'recharg':660,666,697,708,713,728,762,839 'record':194,251,293,424,429,523,700,765,851,899,969 'reject':546 'relat':199 'requir':97,812 'resourc':143,220,254 'respons':815 'response.data':830 'result':74,348 'retri':107,114,131,155 'retriev':178,301,364,562,606 'return':218,280,342,403,451,585,638,662,684,749,795,831,888,958 'search':422,425 'sent':526 'setup':15 'shown':43 'signific':196 'singl':608 'skill' 'skill-telnyx-account-go' 'sms':505 'sourc':531 'source-team-telnyx' 'specifi':313,372 'start':351,409,598,654,902,972 'startdat':331,392 'status':479,482,487,535,849,907,931,977 'store':807,859 'string':222,237,253,256,283,285,288,290,292,344,359,405,421,453,456,458,460,467,470,477,480,485,490,497,501,509,517,520,522,525,534,549,557,559,688,699,702,705,730,733,753,764,767,770,799,804,837,847,850,901,971 'summari':363,366,412 'switch':89 'tag':548,773,777,797,802 'telnyx':2,5,31,228,432 'telnyx-account-go':1 'telnyx.auditeventlistparams':208 'telnyx.chargesbreakdowngetparams':330 'telnyx.chargessummarygetparams':389 'telnyx.detailrecordlistparams':441 'telnyx.error':84 'telnyx.invoicegetparams':628 'telnyx.invoicelistparams':575 'telnyx.newclient':28 'telnyx.paymentautorechargeprefupdateparams':739 'telnyx.paymentnewstoredpaymenttransactionparams':819 'telnyx.usertaglistparams':785 'telnyx.webhookdeliverylistparams':878 'threshold':703,731,768 'time':245,465,475,530,554,845,896,906,966,976 'time.now':332,391,393 'timeout':538,543 'timestamp':929 'topic-agent-skills' 'topic-ai-coding-agent' 'topic-claude-code' 'topic-cpaas' 'topic-cursor' 'topic-iot' 'topic-llm' 'topic-sdk' 'topic-sip' 'topic-sms' 'topic-speech-to-text' 'topic-telephony' 'total':414 'transact':809,854,855 'type':236,252,294,503,524,701,766,852,857,900,970 'unconfirm':541 'uniqu':612 'updat':550,706,710 'uri':601,641,657 'url':484,489,600,640,656 'use':162 'user':257,261,354,357,416,419,555,772,776,870,911,981 'usertag':781 'usertags.data':794 'uuid':247,250,259,558,588,591,644,647,898,913,968,983 'v':215,277,339,400,448,582,635,681,746,792,828,885,955 'valid':58,94,147 'var':82 'wait':105 'webhook':488,862,865,914,917,923,984 'webhookdeliveri':938 'webhookdelivery.data':957","prices":[{"id":"cad10dfa-a5c8-4c00-901f-eb158815aa99","listingId":"549b710a-c110-44b2-8ad9-32920d05b73a","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"team-telnyx","category":"ai","install_from":"skills.sh"},"createdAt":"2026-04-18T22:05:53.886Z"}],"sources":[{"listingId":"549b710a-c110-44b2-8ad9-32920d05b73a","source":"github","sourceId":"team-telnyx/ai/telnyx-account-go","sourceUrl":"https://github.com/team-telnyx/ai/tree/main/skills/telnyx-account-go","isPrimary":false,"firstSeenAt":"2026-04-18T22:05:53.886Z","lastSeenAt":"2026-04-22T12:54:40.121Z"}],"details":{"listingId":"549b710a-c110-44b2-8ad9-32920d05b73a","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"team-telnyx","slug":"telnyx-account-go","github":{"repo":"team-telnyx/ai","stars":167,"topics":["agent-skills","ai","ai-coding-agent","claude-code","cpaas","cursor","iot","llm","sdk","sip","sms","speech-to-text","telephony","telnyx","tts","twilio-migration","voice-agents","voice-ai","webrtc","windsurf"],"license":"mit","html_url":"https://github.com/team-telnyx/ai","pushed_at":"2026-04-21T22:09:49Z","description":"Official one-stop shop for AI Agents and developers building with Telnyx.","skill_md_sha":"3cc9c21bc8aed8b42c804760dafc94add94401da","skill_md_path":"skills/telnyx-account-go/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/team-telnyx/ai/tree/main/skills/telnyx-account-go"},"layout":"multi","source":"github","category":"ai","frontmatter":{"name":"telnyx-account-go","description":">-"},"skills_sh_url":"https://skills.sh/team-telnyx/ai/telnyx-account-go"},"updatedAt":"2026-04-22T12:54:40.121Z"}}