Update OAuth client
curl --request PUT \
--url https://api.opencard.io/api/v1/application/accounts/{accountId}/oauthclients/{oauthClientId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Production EMS",
"scopes": [
"organizations-read",
"organizations-write",
"webhooks-write"
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Production EMS',
scopes: ['organizations-read', 'organizations-write', 'webhooks-write']
})
};
fetch('https://api.opencard.io/api/v1/application/accounts/{accountId}/oauthclients/{oauthClientId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.opencard.io/api/v1/application/accounts/{accountId}/oauthclients/{oauthClientId}"
payload = {
"name": "Production EMS",
"scopes": ["organizations-read", "organizations-write", "webhooks-write"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opencard.io/api/v1/application/accounts/{accountId}/oauthclients/{oauthClientId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Production EMS',
'scopes' => [
'organizations-read',
'organizations-write',
'webhooks-write'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": 2,
"name": "Production EMS",
"organization_id": null,
"revoked": false,
"scopes": [
{
"id": 10,
"scope": "organizations-read"
}
],
"secret": null
}OAuth Clients
Update OAuth client
Update name and replace scopes. organization_id and secret cannot be changed here — regenerate the secret with the dedicated endpoint.
PUT
/
accounts
/
{accountId}
/
oauthclients
/
{oauthClientId}
Update OAuth client
curl --request PUT \
--url https://api.opencard.io/api/v1/application/accounts/{accountId}/oauthclients/{oauthClientId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Production EMS",
"scopes": [
"organizations-read",
"organizations-write",
"webhooks-write"
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Production EMS',
scopes: ['organizations-read', 'organizations-write', 'webhooks-write']
})
};
fetch('https://api.opencard.io/api/v1/application/accounts/{accountId}/oauthclients/{oauthClientId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.opencard.io/api/v1/application/accounts/{accountId}/oauthclients/{oauthClientId}"
payload = {
"name": "Production EMS",
"scopes": ["organizations-read", "organizations-write", "webhooks-write"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opencard.io/api/v1/application/accounts/{accountId}/oauthclients/{oauthClientId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Production EMS',
'scopes' => [
'organizations-read',
'organizations-write',
'webhooks-write'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": 2,
"name": "Production EMS",
"organization_id": null,
"revoked": false,
"scopes": [
{
"id": 10,
"scope": "organizations-read"
}
],
"secret": null
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Response
200 - application/json
Updated OAuth client

