[[rest-api-create-a-unique-node-in-an-index-the-case-where-it-exists]]
=== Create a unique node in an index (the case where it exists) ===

.Final Graph
["dot", "Final-Graph-Create-a-unique-node-in-an-index-(the-case-where-it-exists).svg", "neoviz"]
----
  N181 [
    label = "{Node\[181\]|name = \'Peter\'\lsequence = 1\l}"
  ]
----

_Example request_

* *+POST+*  +http://localhost:7474/db/data/index/node/people?unique+
* *+Accept:+* +application/json+
* *+Content-Type:+* +application/json+
[source,javascript]
----
{"key": "name", "value": "Peter", "properties": {"name": "Peter", "sequence": 2}}
----


_Example response_

* *+200:+* +OK+
* *+Content-Type:+* +application/json+
[source,javascript]
----
{
  "extensions" : {
  },
  "paged_traverse" : "http://localhost:7474/db/data/node/181/paged/traverse/{returnType}{?pageSize,leaseTime}",
  "outgoing_relationships" : "http://localhost:7474/db/data/node/181/relationships/out",
  "traverse" : "http://localhost:7474/db/data/node/181/traverse/{returnType}",
  "all_typed_relationships" : "http://localhost:7474/db/data/node/181/relationships/all/{-list|&|types}",
  "all_relationships" : "http://localhost:7474/db/data/node/181/relationships/all",
  "property" : "http://localhost:7474/db/data/node/181/properties/{key}",
  "self" : "http://localhost:7474/db/data/node/181",
  "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/181/relationships/out/{-list|&|types}",
  "properties" : "http://localhost:7474/db/data/node/181/properties",
  "incoming_relationships" : "http://localhost:7474/db/data/node/181/relationships/in",
  "incoming_typed_relationships" : "http://localhost:7474/db/data/node/181/relationships/in/{-list|&|types}",
  "create_relationship" : "http://localhost:7474/db/data/node/181/relationships",
  "data" : {
    "sequence" : 1,
    "name" : "Peter"
  },
  "indexed" : "http://localhost:7474/db/data/index/node/people/name/Peter/181"
}
----


