curl -X PATCH 'https://api.weir.ai/org/refresh/client?clientId=cli_123456789' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"clientId": "cli_123456789",
"credentials": {
"clientId": "NewClientId123",
"secretKey": "NewSecretKey456"
},
"refreshedAt": "2024-01-22T15:30:00Z"
},
"message": "Client credentials refreshed successfully",
"status": "success"
}
Console APIs - Clients
Refresh Client Credentials
Generate new credentials for an API client
PATCH
/
org
/
refresh
/
client
curl -X PATCH 'https://api.weir.ai/org/refresh/client?clientId=cli_123456789' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"clientId": "cli_123456789",
"credentials": {
"clientId": "NewClientId123",
"secretKey": "NewSecretKey456"
},
"refreshedAt": "2024-01-22T15:30:00Z"
},
"message": "Client credentials refreshed successfully",
"status": "success"
}
Refresh Client Credentials
Generate new credentials for an existing API client. The old credentials will be invalidated.Important: Old credentials will be immediately invalidated. Update all applications using the old credentials.
curl -X PATCH 'https://api.weir.ai/org/refresh/client?clientId=cli_123456789' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"clientId": "cli_123456789",
"credentials": {
"clientId": "NewClientId123",
"secretKey": "NewSecretKey456"
},
"refreshedAt": "2024-01-22T15:30:00Z"
},
"message": "Client credentials refreshed successfully",
"status": "success"
}
Query Parameters
string
required
Client ID to refresh credentials for.
Response Fields
object
required
Usage Examples
const refreshClient = async (clientId, accessToken) => {
const response = await fetch(`https://api.weir.ai/org/refresh/client?clientId=${clientId}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${accessToken}`,
'x-source': 'console'
}
});
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
return await response.json();
};
import requests
def refresh_client(client_id, access_token):
response = requests.patch(
f'https://api.weir.ai/org/refresh/client?clientId={client_id}',
headers={
'Authorization': f'Bearer {access_token}',
'x-source': 'console'
}
)
response.raise_for_status()
return response.json()
Pro Tip: Refresh credentials if they are compromised or as part of regular security rotation practices.
Was this page helpful?