API endpoint to retrieve the Latest Event for an Issue returns list

According to the documentation I should be able to get the latest event of an issue at /api/0/issues/{issue_id}/events/latest/. However, this always returns a list of all events of that issue. Changing the path from .../events/latest/ to .../events/oldest/ or .../events/foo/ or removing the trailing slash doesn’t change anything either.

Is this a bug or is there something wrong with my setup?

version: Sentry 20.8.0.dev0

Okay the problem was that this was not a ticket with an exception but only a ticket with a message with events. For that it didn’t work. For exceptions the endpoint works as expected. Maybe this should be clarified in the docs?

1 Like

Would you like to give this a shot? The docs are generated from here: https://github.com/getsentry/sentry/blob/09ba964934989af645231d9c1a9aa889a7e7b8b6/api-docs/paths/events/latest-event.json

//cc @Colleen who updated these recently and @MeredithAnya for adding a “edit this on GitHub” link to generated API docs.