<@U04UQ68083H> What does it mean when I get the `u...
# ory-copilot
q
@chilly-king-10285 What does it mean when I get the
unexpected end of JSON input
response error when deleting an identity via the admin api for Kratos?
b
A message from kapa.ai
The "unexpected end of JSON input" error when deleting an identity via the Kratos Admin API typically indicates that you're receiving an empty response body when you were expecting JSON content. When you delete an identity using the Kratos Admin API, the expected successful response is actually HTTP 204 No Content with an empty response body. According to the documentation:
Copy code
DELETE /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)