curl -X GET 'https://api.weir.ai/console/logs?page=1&limit=20' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"logs": [
{
"logId": "log_123456789",
"type": "INFO",
"message": "Team created successfully",
"userId": "user_123456789",
"timestamp": "2024-01-22T15:30:00Z",
"action": "team.create",
"resourceId": "team_987654321"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8
}
},
"message": "Logs retrieved successfully",
"status": "success"
}
Console APIs - Logs
Get Logs
Retrieve organization logs
GET
/
console
/
logs
curl -X GET 'https://api.weir.ai/console/logs?page=1&limit=20' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"logs": [
{
"logId": "log_123456789",
"type": "INFO",
"message": "Team created successfully",
"userId": "user_123456789",
"timestamp": "2024-01-22T15:30:00Z",
"action": "team.create",
"resourceId": "team_987654321"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8
}
},
"message": "Logs retrieved successfully",
"status": "success"
}
Get Logs
Retrieve logs for your organization’s activities and operations.curl -X GET 'https://api.weir.ai/console/logs?page=1&limit=20' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"logs": [
{
"logId": "log_123456789",
"type": "INFO",
"message": "Team created successfully",
"userId": "user_123456789",
"timestamp": "2024-01-22T15:30:00Z",
"action": "team.create",
"resourceId": "team_987654321"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8
}
},
"message": "Logs retrieved successfully",
"status": "success"
}
Query Parameters
integer
default:"1"
Page number for pagination.
integer
default:"20"
Number of logs per page (1-100).
string
Filter by log type (INFO, WARNING, ERROR).
string
Start date for filtering (YYYY-MM-DD).
string
End date for filtering (YYYY-MM-DD).
Usage Examples
const getLogs = async (filters, accessToken) => {
const params = new URLSearchParams(filters);
const response = await fetch(`https://api.weir.ai/console/logs?${params}`, {
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 get_logs(filters, access_token):
response = requests.get(
'https://api.weir.ai/console/logs',
params=filters,
headers={
'Authorization': f'Bearer {access_token}',
'x-source': 'console'
}
)
response.raise_for_status()
return response.json()
Pro Tip: Use date filters to narrow down logs to specific time periods for easier analysis.
Was this page helpful?