curl -X POST 'https://api.weir.ai/org/create/client' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'x-source: console' \
-d '{
"name": "Production API Client",
"environment": "production"
}'
{
"data": {
"clientId": "cli_123456789",
"name": "Production API Client",
"environment": "production",
"credentials": {
"clientId": "V2ndYYV7PMQVjqyTsk2QkokCv",
"secretKey": "gMZUzD9fcn6Imd28Hi9rvZeZkhqSClMN4TjCLhc654UeBU9Uxj"
},
"createdAt": "2024-01-22T15:30:00Z"
},
"message": "Client created successfully",
"status": "success"
}
Console APIs - Clients
Create API Client
Create a new API client for external access
POST
/
org
/
create
/
client
curl -X POST 'https://api.weir.ai/org/create/client' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'x-source: console' \
-d '{
"name": "Production API Client",
"environment": "production"
}'
{
"data": {
"clientId": "cli_123456789",
"name": "Production API Client",
"environment": "production",
"credentials": {
"clientId": "V2ndYYV7PMQVjqyTsk2QkokCv",
"secretKey": "gMZUzD9fcn6Imd28Hi9rvZeZkhqSClMN4TjCLhc654UeBU9Uxj"
},
"createdAt": "2024-01-22T15:30:00Z"
},
"message": "Client created successfully",
"status": "success"
}
Create API Client
Create a new API client with credentials for external API access.curl -X POST 'https://api.weir.ai/org/create/client' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'x-source: console' \
-d '{
"name": "Production API Client",
"environment": "production"
}'
{
"data": {
"clientId": "cli_123456789",
"name": "Production API Client",
"environment": "production",
"credentials": {
"clientId": "V2ndYYV7PMQVjqyTsk2QkokCv",
"secretKey": "gMZUzD9fcn6Imd28Hi9rvZeZkhqSClMN4TjCLhc654UeBU9Uxj"
},
"createdAt": "2024-01-22T15:30:00Z"
},
"message": "Client created successfully",
"status": "success"
}
Request Body
string
required
Client name for identification.
string
required
Environment type: “production”, “staging”, or “development”.
Response Fields
string
required
Unique client identifier.
object
required
Important: The secret key is shown only once. Store it securely immediately.
Usage Examples
const createClient = async (clientData, accessToken) => {
const response = await fetch('https://api.weir.ai/org/create/client', {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'x-source': 'console'
},
body: JSON.stringify(clientData)
});
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
const data = await response.json();
// Store credentials securely
console.warn('Store these credentials securely - they will not be shown again');
return data;
};
import requests
def create_client(client_data, access_token):
response = requests.post(
'https://api.weir.ai/org/create/client',
headers={
'Authorization': f'Bearer {access_token}',
'Content-Type': 'application/json',
'x-source': 'console'
},
json=client_data
)
response.raise_for_status()
data = response.json()
# Store credentials securely
print('Warning: Store these credentials securely - they will not be shown again')
return data
Pro Tip: Create separate clients for different environments (production, staging, development) for better security and tracking.
Was this page helpful?