Chapter 6. REST API

Table of Contents

6.1. Service root
6.2. Nodes
6.3. Relationships
6.4. Relationship types
6.5. Node properties
6.6. Relationship properties
6.7. Indexes
6.8. Traversals
6.9. Built-in Graph Algorithms
6.10. Batch operations
6.11. Gremlin Plugin
6.12. Cypher Plugin

The Neo4j REST API is designed with discoverability in mind, so that you can start with a GET on the Section 6.1, “Service root” and from there discover URIs to perform other requests. The examples below uses URIs in the examples; they are subject to change in the future, so for future-proofness discover URIs where possible, instead of relying on the current layout. The default representation is json, both for responses and for data sent with POST/PUT requests.

Below follows a listing of ways to interact with the REST API. You can also see a (at runtime) generated description of the API be pointing your browser to the (exact URI may vary) http://localhost:7474/db/data/application.wadl

To interact with the JSON interface you must explicitly set the request header Accept:application/json for those requests that responds with data. You should also set the header Content-Type:application/json if your request sends data, for example when you’re creating a relationship. The examples include the relevant request and response headers.