I would start with the Discourse Data Explorer Plugin where you can create a saved query that you can send an API call to and pass it a user id to return exactly what you are after. But yes, creating a plugin that creates a new route to expose those fields is also an option.
Hmm I have also noticed a few differences between the two endpoints (in case @blake you were going to add the silence user to the API docs)
suspend
silence
differences
PUT /admin/users/{id}/suspend
PUT /admin/users/{id}/silence
endpoints
suspend_until
silenced_till
request body
Yes
No
Update while silenced /suspended
The last column in the table is causing me some trouble at the moment. I am trying to silence a user programmatically, but if they have already been silenced before, and I make a new silencing request with a later silenced_till date the date doesn’t get updated.
Almost as if the endpoint is saying “do nothing if the user is already silenced”
The suspend endpoint doesn’t behave like this. Rather it updates the suspend_until time.
It’s possible to update the silenced_till parameter directly on the user, but there’s no API endpoint for that, so doing it that way would require a plugin.