[[rest-api-nodes-with-relationships-can-not-be-deleted]]
=== Nodes with relationships can not be deleted ===

The relationships on a node has to be deleted before the node can be
deleted.


.Final Graph
["dot", "Final-Graph-Nodes-with-relationships-can-not-be-deleted.svg", "neoviz"]
----
  N193 [
    label = "{Node\[193\]|}"
  ]
  N193 -> N194 [
    color = "#2e3436"
    fontcolor = "#2e3436"
    label = "LOVES\n"
  ]
  N194 [
    label = "{Node\[194\]|}"
  ]
----

_Example request_

* *+DELETE+*  +http://localhost:7474/db/data/node/193+
* *+Accept:+* +application/json+

_Example response_

* *+409:+* +Conflict+
* *+Content-Type:+* +application/json+
[source,javascript]
----
{
  "message" : "The node with id 193 cannot be deleted. Check that the node is orphaned before deletion.",
  "exception" : "OperationFailureException",
  "stacktrace" : [ "org.neo4j.server.rest.web.DatabaseActions.deleteNode(DatabaseActions.java:255)", "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteNode(RestfulGraphDatabase.java:239)", "java.lang.reflect.Method.invoke(Method.java:597)", "org.neo4j.server.statistic.StatisticFilter.doFilter(StatisticFilter.java:62)" ]
}
----


