Why getting Logs via API not working properly ?
# support
m
Getting logs by assistant id isn’t working and the api only works without filters which get logs of all my account, https://cdn.discordapp.com/attachments/1340460668524171316/1340460668901523538/IMG_7640.png?ex=67b270c8&is=67b11f48&hm=ed3781f531fb9f25a3157acaad4504a3564a40832b0884bbf05bab94b54fccbb&
a
Hey Mahmoud, can you help me with more context what information your looking out for with reference to an assistant ID?
m
I want to get logs of specific “assistant_id”, and NOT all the logs of my Vapi account without any filters. So when you use Get Logs API it works fine without any Query parameters, BUT When I include the assistant_id it returns an empty array [] ( so it seems Vapi Logs filters Don’t work )
a
Here's how to properly make the request: // Example request const response = await fetch('', { headers: { 'Authorization':
Bearer ${YOUR_API_KEY}
, 'Content-Type': 'application/json' } }); The query parameters should include: - assistantId: The UUID of the assistant you want to filter logs for - Optional: type: Can be 'API' | 'Webhook' | 'Call' | 'Provider' - Optional: page: For pagination (defaults to 1) - Optional: limit: Number of results per page (defaults to 100, max 1000)
If you're still getting an empty array, Would you mind sharing: - The exact API endpoint you're calling The assistant ID - The complete query parameters you're using - The time range for which you're trying to fetch logs