[[rest-api-create-a-unique-relationship-in-an-index]]
=== Create a unique relationship in an index ===

.Final Graph
["dot", "Final-Graph-Create-a-unique-relationship-in-an-index.svg", "neoviz"]
----
  N68 [
    label = "{Node\[68\]|}"
  ]
  N68 -> N69 [
    color = "#2e3436"
    fontcolor = "#2e3436"
    label = "knowledge\nname = \'Tobias\'\l"
  ]
  N69 [
    label = "{Node\[69\]|}"
  ]
----

_Example request_

* *+POST+*  +http://localhost:7474/db/data/index/relationship/knowledge/?unique+
* *+Accept:+* +application/json+
* *+Content-Type:+* +application/json+
[source,javascript]
----
{"key": "name", "value":"Tobias", "start": "http://localhost:7474/db/data/node/68", "end": "http://localhost:7474/db/data/node/69", "type": "knowledge"}
----


_Example response_

* *+201:+* +Created+
* *+Content-Type:+* +application/json+
* *+Location:+* +http://localhost:7474/db/data/index/relationship/knowledge/name/Tobias/23+
[source,javascript]
----
{
  "indexed" : "http://localhost:7474/db/data/index/relationship/knowledge/name/Tobias/23",
  "start" : "http://localhost:7474/db/data/node/68",
  "data" : {
    "name" : "Tobias"
  },
  "self" : "http://localhost:7474/db/data/relationship/23",
  "property" : "http://localhost:7474/db/data/relationship/23/properties/{key}",
  "properties" : "http://localhost:7474/db/data/relationship/23/properties",
  "type" : "knowledge",
  "extensions" : {
  },
  "end" : "http://localhost:7474/db/data/node/69"
}
----


