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

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

_Example request_

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


_Example response_

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


