[[rest-api-creating-a-loop-relationship]]
=== Creating a loop relationship ===

.Final Graph
["dot", "Final-Graph-creating-a-loop-relationship.svg", "neoviz"]
----
  N101 [
    label = "{Node\[101\]|name = \'Sara\'\l}"
  ]
  N102 [
    label = "{Node\[102\]|name = \'Joe\'\l}"
  ]
  N102 -> N101 [
    color = "#2e3436"
    fontcolor = "#2e3436"
    label = "knows\n"
  ]
  N102 -> N102 [
    color = "#4e9a06"
    fontcolor = "#4e9a06"
    label = "LOVES\n"
  ]
----

_Example request_

* *+POST+*  +http://localhost:7474/db/data/node/102/relationships+
* *+Accept:+* +application/json+
* *+Content-Type:+* +application/json+
[source,javascript]
----
{"to" : "http://localhost:7474/db/data/node/102", "type" : "LOVES"}
----


_Example response_

* *+201:+* +Created+
* *+Content-Type:+* +application/json+
* *+Location:+* +http://localhost:7474/db/data/relationship/36+
[source,javascript]
----
{
  "start" : "http://localhost:7474/db/data/node/102",
  "data" : {
  },
  "self" : "http://localhost:7474/db/data/relationship/36",
  "property" : "http://localhost:7474/db/data/relationship/36/properties/{key}",
  "properties" : "http://localhost:7474/db/data/relationship/36/properties",
  "type" : "LOVES",
  "extensions" : {
  },
  "end" : "http://localhost:7474/db/data/node/102"
}
----


