quick-addition-90714
04/21/2025, 4:44 PMunexpected end of JSON input response error when deleting an identity via the admin api for Kratos?chilly-king-10285
04/21/2025, 4:44 PMchilly-king-10285
04/21/2025, 4:44 PMDELETE /admin/identities/{id} This endpoint returns a 204 status code when the identity was successfully deleted or when the identity was not found (in which case it's assumed the identity has already been deleted). The HTTP 204 response intentionally has no response body. The API documentation states: > This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already. [Kratos API Reference](https://www.ory.sh/docs/kratos/reference/api) If you're getting this error, it's likely that your client code is trying to parse the empty response as JSON, which is causing the "unexpected end of JSON input" error. You should modify your code to handle the 204 No Content response appropriately without attempting to parse it as JSON. This is consistent with Ory's REST API guidelines which specify that for operations like DELETE, a 204 No Content response is sent without a body: > Some API calls such as DELETE return 204 No Content without a body. [REST API Guidelines](https://www.ory.sh/docs/open-source/guidelines/rest-api-guidelines#responses)