Update OAuth client
Updates the specified OAuth client’s configuration and returns the updated client.
PUT
/
oauth
/
clients
/
{id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const oauthClient = await client.oauthClients.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(oauthClient.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
oauth_client = client.oauth_clients.update(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(oauth_client.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
oauthClient, err := client.OAuthClients.Update(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.OAuthClientUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", oauthClient.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.oauthclients.OAuthClientUpdateParams;
import com.telnyx.sdk.models.oauthclients.OAuthClientUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
OAuthClientUpdateResponse oauthClient = client.oauthClients().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
oauth_client = telnyx.oauth_clients.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(oauth_client)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$oauthClient = $client->oauthClients->update(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
allowedGrantTypes: ['client_credentials'],
allowedScopes: ['admin'],
logoUri: 'https://example.com',
name: 'name',
policyUri: 'https://example.com',
redirectUris: ['https://example.com'],
requirePkce: true,
tosUri: 'https://example.com',
);
var_dump($oauthClient);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx oauth-clients update \
--api-key 'My API Key' \
--id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request PUT \
--url https://api.telnyx.com/v2/oauth/clients/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"allowed_scopes": [
"admin"
],
"require_pkce": true,
"allowed_grant_types": [],
"redirect_uris": [
"<string>"
],
"logo_uri": "<string>",
"policy_uri": "<string>",
"tos_uri": "<string>"
}
'{
"data": {
"record_type": "oauth_client",
"client_id": "string",
"name": "string",
"org_id": "string",
"user_id": "string",
"allowed_scopes": [
"string"
],
"client_type": "public",
"require_pkce": false,
"allowed_grant_types": [
"client_credentials"
],
"redirect_uris": [
"https://example.com"
],
"created_at": "2024-01-23T18:10:02.574Z",
"updated_at": "2024-01-23T18:10:02.574Z"
}
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}Authorizations
Body
application/json
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const oauthClient = await client.oauthClients.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(oauthClient.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
oauth_client = client.oauth_clients.update(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(oauth_client.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
oauthClient, err := client.OAuthClients.Update(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.OAuthClientUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", oauthClient.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.oauthclients.OAuthClientUpdateParams;
import com.telnyx.sdk.models.oauthclients.OAuthClientUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
OAuthClientUpdateResponse oauthClient = client.oauthClients().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
oauth_client = telnyx.oauth_clients.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(oauth_client)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$oauthClient = $client->oauthClients->update(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
allowedGrantTypes: ['client_credentials'],
allowedScopes: ['admin'],
logoUri: 'https://example.com',
name: 'name',
policyUri: 'https://example.com',
redirectUris: ['https://example.com'],
requirePkce: true,
tosUri: 'https://example.com',
);
var_dump($oauthClient);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx oauth-clients update \
--api-key 'My API Key' \
--id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request PUT \
--url https://api.telnyx.com/v2/oauth/clients/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"allowed_scopes": [
"admin"
],
"require_pkce": true,
"allowed_grant_types": [],
"redirect_uris": [
"<string>"
],
"logo_uri": "<string>",
"policy_uri": "<string>",
"tos_uri": "<string>"
}
'{
"data": {
"record_type": "oauth_client",
"client_id": "string",
"name": "string",
"org_id": "string",
"user_id": "string",
"allowed_scopes": [
"string"
],
"client_type": "public",
"require_pkce": false,
"allowed_grant_types": [
"client_credentials"
],
"redirect_uris": [
"https://example.com"
],
"created_at": "2024-01-23T18:10:02.574Z",
"updated_at": "2024-01-23T18:10:02.574Z"
}
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}