[[rest-api-create-relationship]]
=== Create relationship ===

Upon successful creation of a relationship, the new relationship is
returned.


.Final Graph
["dot", "Final-Graph-Create-relationship.svg", "neoviz"]
----
  N86 [
    label = "{Node\[86\]|name = \'Sara\'\l}"
  ]
  N87 [
    label = "{Node\[87\]|name = \'Joe\'\l}"
  ]
  N87 -> N86 [
    color = "#2e3436"
    fontcolor = "#2e3436"
    label = "knows\n"
  ]
  N87 -> N86 [
    color = "#4e9a06"
    fontcolor = "#4e9a06"
    label = "LOVES\n"
  ]
----

_Example request_

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


_Example response_

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


