Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implement OAuth 2.0 authentication flows for Telnyx API access. This skill provides REST API (curl) examples.
.claude/skills/team-telnyx-telnyx-oauth-curl/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 194% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 58% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 274% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 278% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 324% | 0% |
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
text# curl is pre-installed on macOS, Linux, and Windows 10+
bashexport TELNYX_API_KEY="YOUR_API_KEY_HERE"
All examples below use $TELNYX_API_KEY for authentication.
All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
bash# Check HTTP status code in response response=$(curl -s -w "\n%{http_code}" \ -X POST "https://api.telnyx.com/v2/messages" \ -H "Authorization: Bearer $TELNYX_API_KEY" \ -H "Content-Type: application/json" \ -d '{"to": "+13125550001", "from": "+13125550002", "text": "Hello"}') http_code=$(echo "$response" | tail -1) body=$(echo "$response" | sed '$d') case $http_code in 2*) echo "Success: $body" ;; 422) echo "Validation error — check required fields and formats" ;; 429) echo "Rate limited — retry after delay"; sleep 1 ;; 401) echo "Authentication failed — check TELNYX_API_KEY" ;; *) echo "Error $http_code: $body" ;; esac
Common error codes: 401 invalid API key, 403 insufficient permissions, 404 resource not found, 422 validation error (check field formats), 429 rate limited (retry with exponential backoff).
page[number] and page[size] query parameters to navigate pages. Check meta.total_pages in the response.OAuth 2.0 Authorization Server Metadata (RFC 8414)
GET /.well-known/oauth-authorization-server
bashcurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/.well-known/oauth-authorization-server"
Returns: authorization_endpoint (uri), code_challenge_methods_supported (arraystring]), grant_types_supported (arraystring]), introspection_endpoint (uri), issuer (uri), jwks_uri (uri), registration_endpoint (uri), response_types_supported (arraystring]), scopes_supported (arraystring]), token_endpoint (uri), token_endpoint_auth_methods_supported (arraystring])
OAuth 2.0 Protected Resource Metadata for resource discovery
GET /.well-known/oauth-protected-resource
bashcurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/.well-known/oauth-protected-resource"
Returns: authorization_servers (arraystring]), resource (uri)
OAuth 2.0 authorization endpoint for the authorization code flow
GET /oauth/authorize
bashcurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/oauth/authorize?scope=admin"
Retrieve details about an OAuth consent token
GET /oauth/consent/{consent_token}
bashcurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/oauth/consent/{consent_token}"
Returns: client_id (string), logo_uri (uri), name (string), policy_uri (uri), redirect_uri (uri), requested_scopes (arrayobject]), tos_uri (uri), verified (boolean)
Create an OAuth authorization grant
POST /oauth/grants — Required: allowed, consent_token
bashcurl \ -X POST \ -H "Authorization: Bearer $TELNYX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "allowed": true, "consent_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.example" }' \ "https://api.telnyx.com/v2/oauth/grants"
Returns: redirect_uri (uri)
Introspect an OAuth access token to check its validity and metadata
POST /oauth/introspect — Required: token
bashcurl \ -X POST \ -H "Authorization: Bearer $TELNYX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.example" }' \ "https://api.telnyx.com/v2/oauth/introspect"
Returns: active (boolean), aud (string), client_id (string), exp (integer), iat (integer), iss (string), scope (string)
Retrieve the JSON Web Key Set for token verification
GET /oauth/jwks
bashcurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/oauth/jwks"
Returns: keys (arrayobject])
Register a new OAuth client dynamically (RFC 7591)
POST /oauth/register
Optional: client_name (string), grant_types (arraystring]), logo_uri (uri), policy_uri (uri), redirect_uris (arraystring]), response_types (arraystring]), scope (string), token_endpoint_auth_method (enum: none, client_secret_basic, client_secret_post), tos_uri (uri)
bashcurl \ -X POST \ -H "Authorization: Bearer $TELNYX_API_KEY" \ -H "Content-Type: application/json" \ "https://api.telnyx.com/v2/oauth/register"
Returns: client_id (string), client_id_issued_at (integer), client_name (string), client_secret (string), grant_types (arraystring]), logo_uri (uri), policy_uri (uri), redirect_uris (arraystring]), response_types (arraystring]), scope (string), token_endpoint_auth_method (string), tos_uri (uri)
Exchange authorization code, client credentials, or refresh token for access token
POST /oauth/token — Required: grant_type
Optional: client_id (string), client_secret (string), code (string), code_verifier (string), redirect_uri (uri), refresh_token (string), scope (string)
bashcurl \ -X POST \ -H "Authorization: Bearer $TELNYX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "grant_type": "client_credentials" }' \ "https://api.telnyx.com/v2/oauth/token"
Returns: access_token (string), expires_in (integer), refresh_token (string), scope (string), token_type (enum: Bearer)
Retrieve a paginated list of OAuth clients for the authenticated user
GET /oauth_clients
bashcurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/oauth_clients"
Returns: allowed_grant_types (arraystring]), allowed_scopes (arraystring]), 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 (arraystring]), require_pkce (boolean), tos_uri (uri), updated_at (date-time), user_id (string)
Create a new OAuth client
POST /oauth_clients — Required: name, allowed_scopes, client_type, allowed_grant_types
Optional: logo_uri (uri), policy_uri (uri), redirect_uris (arraystring]), require_pkce (boolean), tos_uri (uri)
bashcurl \ -X POST \ -H "Authorization: Bearer $TELNYX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "My OAuth client", "allowed_scopes": [ "admin" ], "client_type": "public", "allowed_grant_types": [ "client_credentials" ] }' \ "https://api.telnyx.com/v2/oauth_clients"
Returns: allowed_grant_types (arraystring]), allowed_scopes (arraystring]), 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 (arraystring]), require_pkce (boolean), tos_uri (uri), updated_at (date-time), user_id (string)
Retrieve a single OAuth client by ID
GET /oauth_clients/{id}
bashcurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/oauth_clients/550e8400-e29b-41d4-a716-446655440000"
Returns: allowed_grant_types (arraystring]), allowed_scopes (arraystring]), 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 (arraystring]), require_pkce (boolean), tos_uri (uri), updated_at (date-time), user_id (string)
Update an existing OAuth client
PUT /oauth_clients/{id}
Optional: allowed_grant_types (arraystring]), allowed_scopes (arraystring]), logo_uri (uri), name (string), policy_uri (uri), redirect_uris (arraystring]), require_pkce (boolean), tos_uri (uri)
bashcurl \ -X PUT \ -H "Authorization: Bearer $TELNYX_API_KEY" \ -H "Content-Type: application/json" \ "https://api.telnyx.com/v2/oauth_clients/550e8400-e29b-41d4-a716-446655440000"
Returns: allowed_grant_types (arraystring]), allowed_scopes (arraystring]), 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 (arraystring]), require_pkce (boolean), tos_uri (uri), updated_at (date-time), user_id (string)
Delete an OAuth client
DELETE /oauth_clients/{id}
bashcurl \ -X DELETE \ -H "Authorization: Bearer $TELNYX_API_KEY" \ "https://api.telnyx.com/v2/oauth_clients/550e8400-e29b-41d4-a716-446655440000"
Retrieve a paginated list of OAuth grants for the authenticated user
GET /oauth_grants
bashcurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/oauth_grants"
Returns: client_id (string), created_at (date-time), id (uuid), last_used_at (date-time), record_type (enum: oauth_grant), scopes (arraystring])
Retrieve a single OAuth grant by ID
GET /oauth_grants/{id}
bashcurl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/oauth_grants/550e8400-e29b-41d4-a716-446655440000"
Returns: client_id (string), created_at (date-time), id (uuid), last_used_at (date-time), record_type (enum: oauth_grant), scopes (arraystring])
Revoke an OAuth grant
DELETE /oauth_grants/{id}
bashcurl \ -X DELETE \ -H "Authorization: Bearer $TELNYX_API_KEY" \ "https://api.telnyx.com/v2/oauth_grants/550e8400-e29b-41d4-a716-446655440000"
Returns: client_id (string), created_at (date-time), id (uuid), last_used_at (date-time), record_type (enum: oauth_grant), scopes (arraystring])
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-09 | pass→pass | 3,378 | 2,337 | -31% | 1 | 1 | 0% | 660 | 4,156 | +530% | 0 | 0 | — |
case-18 | pass→pass | 6,233 | 4,663 | -25% | 1 | 1 | 0% | 1,216 | 4,619 | +280% | 0 | 0 | — |
case-01 | pass→pass | 4,392 | 4,161 | -5% | 1 | 1 | 0% | 835 | 4,607 | +452% | 0 | 0 | — |
case-02 | fail→pass | 7,513 | 3,374 | -55% | 1 | 1 | 0% | 1,470 | 4,324 | +194% | 0 | 0 | — |
case-03 | fail→pass | 16,410 | 7,301 | -56% | 1 | 1 | 0% | 3,296 | 5,222 | +58% | 0 | 0 | — |
case-04 | fail→pass | 6,106 | 3,032 | -50% | 1 | 1 | 0% | 1,152 | 4,307 | +274% | 0 | 0 | — |
case-05 | fail→pass | 5,880 | 3,466 | -41% | 1 | 1 | 0% | 1,147 | 4,330 | +278% | 0 | 0 | — |
case-06 | pass→pass | 6,737 | 3,318 | -51% | 1 | 1 | 0% | 1,352 | 4,308 | +219% | 0 | 0 | — |
case-07 | pass→pass | 3,457 | 2,022 | -42% | 1 | 1 | 0% | 695 | 4,073 | +486% | 0 | 0 | — |
case-08 | fail→pass | 5,123 | 3,197 | -38% | 1 | 1 | 0% | 1,032 | 4,373 | +324% | 0 | 0 | — |
case-10 | pass→pass | 6,963 | 2,260 | -68% | 1 | 1 | 0% | 1,216 | 4,072 | +235% | 0 | 0 | — |
case-11 | fail→pass | 7,987 | 2,185 | -73% | 1 | 1 | 0% | 1,421 | 3,998 | +181% | 0 | 0 | — |
case-12 | fail→pass | 8,630 | 4,268 | -51% | 1 | 1 | 0% | 1,660 | 4,516 | +172% | 0 | 0 | — |
case-13 | pass→pass | 6,032 | 3,464 | -43% | 1 | 1 | 0% | 1,087 | 4,335 | +299% | 0 | 0 | — |
case-19 | fail→pass | 5,149 | 6,322 | +23% | 1 | 1 | 0% | 1,002 | 4,120 | +311% | 0 | 0 | — |
case-14 | fail→pass | 4,325 | 2,414 | -44% | 1 | 1 | 0% | 827 | 4,169 | +404% | 0 | 0 | — |
case-15 | fail→pass | 5,421 | 2,026 | -63% | 1 | 1 | 0% | 1,035 | 4,021 | +289% | 0 | 0 | — |
case-16 | fail→pass | 6,872 | 1,474 | -79% | 1 | 1 | 0% | 1,182 | 3,922 | +232% | 0 | 0 | — |
case-17 | fail→pass | 5,159 | 2,745 | -47% | 1 | 1 | 0% | 999 | 4,255 | +326% | 0 | 0 | — |
case-20 | pass→pass | 8,670 | 7,468 | -14% | 1 | 1 | 0% | 1,782 | 5,259 | +195% | 0 | 0 | — |
case-21 | pass→pass | 11,670 | 10,925 | -6% | 1 | 1 | 0% | 2,285 | 5,786 | +153% | 0 | 0 | — |
case-22 | pass→pass | 3,318 | 3,402 | +3% | 1 | 1 | 0% | 660 | 4,388 | +565% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +55 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.