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