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"
}
Retrieve organization 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"
}
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"
}
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();
};
Was this page helpful?