{"id":"557809d5-8df7-4352-beeb-207505d19703","shortId":"c3dqSb","kind":"skill","title":"telnyx-oauth-ruby","tagline":">-","description":"<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->\n\n# Telnyx Oauth - Ruby\n\n## Installation\n\n```bash\ngem install telnyx\n```\n\n## Setup\n\n```ruby\nrequire \"telnyx\"\n\nclient = Telnyx::Client.new(\n  api_key: ENV[\"TELNYX_API_KEY\"], # This is the default and can be omitted\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```ruby\nbegin\n  result = client.messages.send_(to: \"+13125550001\", from: \"+13125550002\", text: \"Hello\")\nrescue Telnyx::Errors::APIConnectionError\n  puts \"Network error — check connectivity and retry\"\nrescue Telnyx::Errors::RateLimitError\n  # 429: rate limited — wait and retry with exponential backoff\n  sleep(1) # Check Retry-After header for actual delay\nrescue Telnyx::Errors::APIStatusError => e\n  puts \"API error #{e.status}: #{e.message}\"\n  if e.status == 422\n    puts \"Validation error — check required fields and formats\"\n  end\nend\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 `.auto_paging_each` for automatic iteration: `page.auto_paging_each { |item| puts item.id }`.\n\n## Authorization server metadata\n\nOAuth 2.0 Authorization Server Metadata (RFC 8414)\n\n`GET /.well-known/oauth-authorization-server`\n\n```ruby\nresponse = client.well_known.retrieve_authorization_server_metadata\n\nputs(response)\n```\n\nReturns: `authorization_endpoint` (uri), `code_challenge_methods_supported` (array[string]), `grant_types_supported` (array[string]), `introspection_endpoint` (uri), `issuer` (uri), `jwks_uri` (uri), `registration_endpoint` (uri), `response_types_supported` (array[string]), `scopes_supported` (array[string]), `token_endpoint` (uri), `token_endpoint_auth_methods_supported` (array[string])\n\n## Protected resource metadata\n\nOAuth 2.0 Protected Resource Metadata for resource discovery\n\n`GET /.well-known/oauth-protected-resource`\n\n```ruby\nresponse = client.well_known.retrieve_protected_resource_metadata\n\nputs(response)\n```\n\nReturns: `authorization_servers` (array[string]), `resource` (uri)\n\n## OAuth authorization endpoint\n\nOAuth 2.0 authorization endpoint for the authorization code flow\n\n`GET /oauth/authorize`\n\n```ruby\nresult = client.oauth.retrieve_authorize(\n  client_id: \"550e8400-e29b-41d4-a716-446655440000\",\n  redirect_uri: \"https://example.com\",\n  response_type: :code\n)\n\nputs(result)\n```\n\n## Get OAuth consent token\n\nRetrieve details about an OAuth consent token\n\n`GET /oauth/consent/{consent_token}`\n\n```ruby\noauth = client.oauth.retrieve(\"consent_token\")\n\nputs(oauth)\n```\n\nReturns: `client_id` (string), `logo_uri` (uri), `name` (string), `policy_uri` (uri), `redirect_uri` (uri), `requested_scopes` (array[object]), `tos_uri` (uri), `verified` (boolean)\n\n## Create OAuth grant\n\nCreate an OAuth authorization grant\n\n`POST /oauth/grants` — Required: `allowed`, `consent_token`\n\n```ruby\nresponse = client.oauth.grants(allowed: true, consent_token: \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.example\")\n\nputs(response)\n```\n\nReturns: `redirect_uri` (uri)\n\n## Token introspection\n\nIntrospect an OAuth access token to check its validity and metadata\n\n`POST /oauth/introspect` — Required: `token`\n\n```ruby\nresponse = client.oauth.introspect(token: \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.example\")\n\nputs(response)\n```\n\nReturns: `active` (boolean), `aud` (string), `client_id` (string), `exp` (integer), `iat` (integer), `iss` (string), `scope` (string)\n\n## JSON Web Key Set\n\nRetrieve the JSON Web Key Set for token verification\n\n`GET /oauth/jwks`\n\n```ruby\nresponse = client.oauth.retrieve_jwks\n\nputs(response)\n```\n\nReturns: `keys` (array[object])\n\n## Dynamic client registration\n\nRegister a new OAuth client dynamically (RFC 7591)\n\n`POST /oauth/register`\n\nOptional: `client_name` (string), `grant_types` (array[string]), `logo_uri` (uri), `policy_uri` (uri), `redirect_uris` (array[string]), `response_types` (array[string]), `scope` (string), `token_endpoint_auth_method` (enum: none, client_secret_basic, client_secret_post), `tos_uri` (uri)\n\n```ruby\nresponse = client.oauth.register\n\nputs(response)\n```\n\nReturns: `client_id` (string), `client_id_issued_at` (integer), `client_name` (string), `client_secret` (string), `grant_types` (array[string]), `logo_uri` (uri), `policy_uri` (uri), `redirect_uris` (array[string]), `response_types` (array[string]), `scope` (string), `token_endpoint_auth_method` (string), `tos_uri` (uri)\n\n## OAuth token endpoint\n\nExchange authorization code, client credentials, or refresh token for access token\n\n`POST /oauth/token` — Required: `grant_type`\n\nOptional: `client_id` (string), `client_secret` (string), `code` (string), `code_verifier` (string), `redirect_uri` (uri), `refresh_token` (string), `scope` (string)\n\n```ruby\nresponse = client.oauth.token(grant_type: :client_credentials)\n\nputs(response)\n```\n\nReturns: `access_token` (string), `expires_in` (integer), `refresh_token` (string), `scope` (string), `token_type` (enum: Bearer)\n\n## List OAuth clients\n\nRetrieve a paginated list of OAuth clients for the authenticated user\n\n`GET /oauth_clients`\n\n```ruby\npage = client.oauth_clients.list\n\nputs(page)\n```\n\nReturns: `allowed_grant_types` (array[string]), `allowed_scopes` (array[string]), `client_id` (string), `client_secret` (string | null), `client_type` (enum: public, confidential), `created_at` (date-time), `logo_uri` (uri), `name` (string), `org_id` (string), `policy_uri` (uri), `record_type` (enum: oauth_client), `redirect_uris` (array[string]), `require_pkce` (boolean), `tos_uri` (uri), `updated_at` (date-time), `user_id` (string)\n\n## Create OAuth client\n\nCreate a new OAuth client\n\n`POST /oauth_clients` — Required: `name`, `allowed_scopes`, `client_type`, `allowed_grant_types`\n\nOptional: `logo_uri` (uri), `policy_uri` (uri), `redirect_uris` (array[string]), `require_pkce` (boolean), `tos_uri` (uri)\n\n```ruby\noauth_client = client.oauth_clients.create(\n  allowed_grant_types: [:client_credentials],\n  allowed_scopes: [\"admin\"],\n  client_type: :public,\n  name: \"My OAuth client\"\n)\n\nputs(oauth_client)\n```\n\nReturns: `allowed_grant_types` (array[string]), `allowed_scopes` (array[string]), `client_id` (string), `client_secret` (string | null), `client_type` (enum: public, confidential), `created_at` (date-time), `logo_uri` (uri), `name` (string), `org_id` (string), `policy_uri` (uri), `record_type` (enum: oauth_client), `redirect_uris` (array[string]), `require_pkce` (boolean), `tos_uri` (uri), `updated_at` (date-time), `user_id` (string)\n\n## Get OAuth client\n\nRetrieve a single OAuth client by ID\n\n`GET /oauth_clients/{id}`\n\n```ruby\noauth_client = client.oauth_clients.retrieve(\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\nputs(oauth_client)\n```\n\nReturns: `allowed_grant_types` (array[string]), `allowed_scopes` (array[string]), `client_id` (string), `client_secret` (string | null), `client_type` (enum: public, confidential), `created_at` (date-time), `logo_uri` (uri), `name` (string), `org_id` (string), `policy_uri` (uri), `record_type` (enum: oauth_client), `redirect_uris` (array[string]), `require_pkce` (boolean), `tos_uri` (uri), `updated_at` (date-time), `user_id` (string)\n\n## Update OAuth client\n\nUpdate an existing OAuth client\n\n`PUT /oauth_clients/{id}`\n\nOptional: `allowed_grant_types` (array[string]), `allowed_scopes` (array[string]), `logo_uri` (uri), `name` (string), `policy_uri` (uri), `redirect_uris` (array[string]), `require_pkce` (boolean), `tos_uri` (uri)\n\n```ruby\noauth_client = client.oauth_clients.update(\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\nputs(oauth_client)\n```\n\nReturns: `allowed_grant_types` (array[string]), `allowed_scopes` (array[string]), `client_id` (string), `client_secret` (string | null), `client_type` (enum: public, confidential), `created_at` (date-time), `logo_uri` (uri), `name` (string), `org_id` (string), `policy_uri` (uri), `record_type` (enum: oauth_client), `redirect_uris` (array[string]), `require_pkce` (boolean), `tos_uri` (uri), `updated_at` (date-time), `user_id` (string)\n\n## Delete OAuth client\n\nDelete an OAuth client\n\n`DELETE /oauth_clients/{id}`\n\n```ruby\nresult = client.oauth_clients.delete(\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\nputs(result)\n```\n\n## List OAuth grants\n\nRetrieve a paginated list of OAuth grants for the authenticated user\n\n`GET /oauth_grants`\n\n```ruby\npage = client.oauth_grants.list\n\nputs(page)\n```\n\nReturns: `client_id` (string), `created_at` (date-time), `id` (uuid), `last_used_at` (date-time), `record_type` (enum: oauth_grant), `scopes` (array[string])\n\n## Get OAuth grant\n\nRetrieve a single OAuth grant by ID\n\n`GET /oauth_grants/{id}`\n\n```ruby\noauth_grant = client.oauth_grants.retrieve(\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\nputs(oauth_grant)\n```\n\nReturns: `client_id` (string), `created_at` (date-time), `id` (uuid), `last_used_at` (date-time), `record_type` (enum: oauth_grant), `scopes` (array[string])\n\n## Revoke OAuth grant\n\nRevoke an OAuth grant\n\n`DELETE /oauth_grants/{id}`\n\n```ruby\noauth_grant = client.oauth_grants.delete(\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\nputs(oauth_grant)\n```\n\nReturns: `client_id` (string), `created_at` (date-time), `id` (uuid), `last_used_at` (date-time), `record_type` (enum: oauth_grant), `scopes` (array[string])","tags":["telnyx","oauth","ruby","team-telnyx","agent-skills","ai-coding-agent","claude-code","cpaas","cursor","iot","llm","sdk"],"capabilities":["skill","source-team-telnyx","skill-telnyx-oauth-ruby","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-oauth-ruby","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 (9,468 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-22T06:54:44.997Z","embedding":null,"createdAt":"2026-04-18T22:07:26.825Z","updatedAt":"2026-04-22T06:54:44.997Z","lastSeenAt":"2026-04-22T06:54:44.997Z","tsv":"'+13125550001':76 '+13125550002':78 '/.well-known/oauth-authorization-server':192 '/.well-known/oauth-protected-resource':258 '/oauth/authorize':287 '/oauth/consent':320 '/oauth/grants':363 '/oauth/introspect':396 '/oauth/jwks':436 '/oauth/register':459 '/oauth/token':562 '/oauth_clients':626,702,823,908,1020 '/oauth_grants':1048,1090,1138 '1':106 '182bd5e5':830,943,1026,1097,1145 '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e':829,942,1025,1096,1144 '2.0':185,250,278 '401':64,141 '403':145 '404':148 '41d4':297 '422':60,127,152 '429':57,96,158 '446655440000':299 '4fe4':832,945,1028,1099,1147 '550e8400':294 '6e1a':831,944,1027,1098,1146 '7591':457 '8414':190 'a716':298 'a799':833,946,1029,1100,1148 'aa6d9a6ab26e':834,947,1030,1101,1149 'access':387,559,596 'activ':407 'actual':113 'admin':740 'allow':365,371,633,638,705,709,733,738,752,757,839,844,911,916,952,957 'alreadi':40 'alway':65 'api':20,24,48,121,143 'apiconnectionerror':84 'apistatuserror':118 'array':209,214,230,234,244,270,347,445,466,476,480,521,531,535,636,640,677,721,755,759,796,842,846,883,914,918,930,955,959,996,1077,1128,1176 'assum':37 'aud':409 'auth':241,486,541 'authent':62,623,1045 'author':181,186,196,202,268,275,279,283,291,360,551 'auto':169 'automat':173 'backoff':104,164 'bash':9 'basic':492 'bearer':610 'begin':72 'boolean':353,408,681,725,800,887,934,1000 'call':49 'challeng':206 'check':88,107,131,155,390 'client':17,38,292,331,411,448,454,461,490,493,505,508,513,516,553,567,570,591,613,620,642,645,649,674,695,700,707,731,736,741,747,750,761,764,768,793,814,819,827,837,848,851,855,880,901,906,940,950,961,964,968,993,1014,1018,1055,1106,1154 'client.messages.send':74 'client.new':19 'client.oauth.grants':370 'client.oauth.introspect':401 'client.oauth.register':501 'client.oauth.retrieve':290,325,439 'client.oauth.token':588 'client.oauth_clients.create':732 'client.oauth_clients.delete':1024 'client.oauth_clients.list':629 'client.oauth_clients.retrieve':828 'client.oauth_clients.update':941 'client.oauth_grants.delete':1143 'client.oauth_grants.list':1051 'client.oauth_grants.retrieve':1095 'client.well_known.retrieve':195,261 'code':70,140,205,284,305,552,573,575 'common':138 'confidenti':653,772,859,972 'connect':89 'consent':310,317,321,326,366,373 'creat':354,357,654,693,696,773,860,973,1058,1109,1157 'credenti':554,592,737 'date':657,688,776,807,863,894,976,1007,1061,1069,1112,1120,1160,1168 'date-tim':656,687,775,806,862,893,975,1006,1060,1068,1111,1119,1159,1167 'default':29 'delay':114 'delet':1012,1015,1019,1137 'detail':313 'discoveri':256 'dynam':447,455 'e':119 'e.message':124 'e.status':123,126 'e29b':296 'e29b-41d4-a716':295 'end':136,137 'endpoint':203,217,225,237,240,276,280,485,540,549 'enum':488,609,651,672,770,791,857,878,970,991,1073,1124,1172 'env':22 'error':45,54,59,63,67,83,87,94,117,122,130,139,154 'exampl':35 'example.com':302 'exchang':550 'exist':904 'exp':414 'expir':599 'exponenti':103,163 'eyj0exaioijkv1qilcjhbgcioijiuzi1nij9.example':375,403 'fail':51 'field':133,156 'flow':285 'format':135,157 'found':151 'gem':10 'get':191,257,286,308,319,435,625,812,822,1047,1079,1089 'grant':211,356,361,464,519,564,589,634,710,734,753,840,912,953,1035,1042,1075,1081,1086,1094,1104,1126,1132,1136,1142,1152,1174 'handl':46,66 'header':111 'hello':80 'iat':416 'id':293,332,412,506,509,568,643,665,691,762,784,810,821,824,849,871,897,909,962,984,1010,1021,1056,1063,1088,1091,1107,1114,1139,1155,1162 'import':165 'initi':41 'instal':8,11 'insuffici':146 'integ':415,417,512,601 'introspect':216,383,384 'invalid':142 'iss':418 'issu':510 'issuer':219 'item':178 'item.id':180 'iter':174 'json':422,428 'jwks':221,440 'key':21,25,144,424,430,444 'last':1065,1116,1164 'limit':56,98,160 'list':611,617,1033,1039 'logo':334,468,523,659,713,778,865,920,978 'metadata':183,188,198,248,253,264,394 'method':207,242,487,542 'name':337,462,514,662,704,744,781,868,923,981 'network':53,86 'new':452,698 'none':489 'note':166 'null':648,767,854,967 'oauth':3,6,184,249,274,277,309,316,324,329,355,359,386,453,547,612,619,673,694,699,730,746,749,792,813,818,826,836,879,900,905,939,949,992,1013,1017,1034,1041,1074,1080,1085,1093,1103,1125,1131,1135,1141,1151,1173 'object':348,446 'omit':33 'option':460,566,712,910 'org':664,783,870,983 'page':170,176,628,631,1050,1053 'page.auto':175 'pagin':167,616,1038 'permiss':147 'pkce':680,724,799,886,933,999 'polici':339,471,526,667,716,786,873,925,986 'post':362,395,458,495,561,701 'product':69 'protect':246,251,262 'public':652,743,771,858,971 'put':85,120,128,179,199,265,306,328,376,404,441,502,593,630,748,835,907,948,1031,1052,1102,1150 'rate':55,97,159 'ratelimiterror':95 'record':670,789,876,989,1071,1122,1170 'redirect':300,342,379,474,529,578,675,719,794,881,928,994 'refresh':556,581,602 'regist':450 'registr':224,449 'request':345 'requir':15,132,364,397,563,679,703,723,798,885,932,998 'rescu':81,92,115 'resourc':149,247,252,255,263,272 'respons':194,200,227,260,266,303,369,377,400,405,438,442,478,500,503,533,587,594 'result':73,289,307,1023,1032 'retri':91,101,109,161 'retriev':312,426,614,815,1036,1082 'retry-aft':108 'return':201,267,330,378,406,443,504,595,632,751,838,951,1054,1105,1153 'revok':1130,1133 'rfc':189,456 'rubi':4,7,14,71,193,259,288,323,368,399,437,499,586,627,729,825,938,1022,1049,1092,1140 'scope':232,346,420,482,537,584,605,639,706,739,758,845,917,958,1076,1127,1175 'secret':491,494,517,571,646,765,852,965 'server':182,187,197,269 'set':425,431 'setup':13 'shown':43 'singl':817,1084 'skill' 'skill-telnyx-oauth-ruby' 'sleep':105 'source-team-telnyx' 'string':210,215,231,235,245,271,333,338,410,413,419,421,463,467,477,481,483,507,515,518,522,532,536,538,543,569,572,574,577,583,585,598,604,606,637,641,644,647,663,666,678,692,722,756,760,763,766,782,785,797,811,843,847,850,853,869,872,884,898,915,919,924,931,956,960,963,966,982,985,997,1011,1057,1078,1108,1129,1156,1177 'support':208,213,229,233,243 'telnyx':2,5,12,16,18,23,82,93,116 'telnyx-oauth-rubi':1 'text':79 'time':658,689,777,808,864,895,977,1008,1062,1070,1113,1121,1161,1169 'token':236,239,311,318,322,327,367,374,382,388,398,402,433,484,539,548,557,560,582,597,603,607 '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' 'tos':349,496,544,682,726,801,888,935,1001 'true':372 'type':212,228,304,465,479,520,534,565,590,608,635,650,671,708,711,735,742,754,769,790,841,856,877,913,954,969,990,1072,1123,1171 'updat':685,804,891,899,902,1004 'uri':204,218,220,222,223,226,238,273,301,335,336,340,341,343,344,350,351,380,381,469,470,472,473,475,497,498,524,525,527,528,530,545,546,579,580,660,661,668,669,676,683,684,714,715,717,718,720,727,728,779,780,787,788,795,802,803,866,867,874,875,882,889,890,921,922,926,927,929,936,937,979,980,987,988,995,1002,1003 'use':168,1066,1117,1165 'user':624,690,809,896,1009,1046 'uuid':1064,1115,1163 'valid':58,129,153,392 'verif':434 'verifi':352,576 'wait':99 'web':423,429","prices":[{"id":"7a20c7e5-e3b4-43cd-8bac-f05f6758225f","listingId":"557809d5-8df7-4352-beeb-207505d19703","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:07:26.825Z"}],"sources":[{"listingId":"557809d5-8df7-4352-beeb-207505d19703","source":"github","sourceId":"team-telnyx/ai/telnyx-oauth-ruby","sourceUrl":"https://github.com/team-telnyx/ai/tree/main/skills/telnyx-oauth-ruby","isPrimary":false,"firstSeenAt":"2026-04-18T22:07:26.825Z","lastSeenAt":"2026-04-22T06:54:44.997Z"}],"details":{"listingId":"557809d5-8df7-4352-beeb-207505d19703","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"team-telnyx","slug":"telnyx-oauth-ruby","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":"8f5734a5e06915261fb0500d8059bab365a973b6","skill_md_path":"skills/telnyx-oauth-ruby/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/team-telnyx/ai/tree/main/skills/telnyx-oauth-ruby"},"layout":"multi","source":"github","category":"ai","frontmatter":{"name":"telnyx-oauth-ruby","description":">-"},"skills_sh_url":"https://skills.sh/team-telnyx/ai/telnyx-oauth-ruby"},"updatedAt":"2026-04-22T06:54:44.997Z"}}