[[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"]
----
  N176 [
    label = "{Node\[176\]|}"
  ]
  N176 -> N177 [
    color = "#2e3436"
    fontcolor = "#2e3436"
    label = "LOVES\n"
  ]
  N177 [
    label = "{Node\[177\]|}"
  ]
----

_Example request_

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

_Example response_

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


