Skip to main content
GET
https://api-dev.weir.ai/
/
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

page
integer
default:"1"
Page number for pagination.
limit
integer
default:"20"
Number of logs per page (1-100).
type
string
Filter by log type (INFO, WARNING, ERROR).
startDate
string
Start date for filtering (YYYY-MM-DD).
endDate
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();
};
Pro Tip: Use date filters to narrow down logs to specific time periods for easier analysis.