Get Logs

Retrieve logs with optional filtering.

This endpoint retrieves logs with extensive filtering options and pagination support.
Logs may include API calls, webhooks, call events, and provider interactions.

Parameters:
request (Request): The FastAPI request object
db (AsyncSession): The database session (injected)
organization_id (Optional[int]): The organization ID from the API key or request
log_type (Optional[LogType]): Filter by log type (API, Webhook, Call, Provider)
webhook_type (Optional[str]): Filter by webhook type
assistant_id (Optional[str]): Filter by assistant ID
phone_number_id (Optional[str]): Filter by phone number ID
customer_id (Optional[str]): Filter by customer ID
squad_id (Optional[str]): Filter by squad ID
call_id (Optional[str]): Filter by call ID
page (Optional[int]): Page number for pagination
sort_order (Optional[SortOrder]): Sort order (ASC or DESC)
limit (Optional[int]): Maximum number of items to return
created_at_gt (Optional[datetime]): Filter by created after date
created_at_lt (Optional[datetime]): Filter by created before date
created_at_ge (Optional[datetime]): Filter by created after or on date
created_at_le (Optional[datetime]): Filter by created before or on date
updated_at_gt (Optional[datetime]): Filter by updated after date
updated_at_lt (Optional[datetime]): Filter by updated before date
updated_at_ge (Optional[datetime]): Filter by updated after or on date
updated_at_le (Optional[datetime]): Filter by updated before or on date

Returns:
Dict[str, Any]: The logs data and pagination information

Raises:
HTTPException:
- 400: If organization ID is missing
- 422: If there's a validation error in the request parameters
- 500: If an unexpected error occurs during retrieval

Language
Credentials
Header
Click Try It! to start a request and see the response here!