Chapter 19. REST API

Table of Contents

19.1. Service root
19.2. Nodes
19.3. Relationships
19.4. Relationship types
19.5. Node properties
19.6. Relationship properties
19.7. Indexes
19.8. Unique Indexes
19.9. Automatic Indexes
19.10. Configurable Automatic Indexing
19.11. Traversals
19.12. Cypher queries
19.13. Built-in Graph Algorithms
19.14. Batch operations
19.15. Cypher Plugin
19.16. Gremlin Plugin

The Neo4j REST API is designed with discoverability in mind, so that you can start with a GET on the Section 19.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. For language bindings to the REST API, see Chapter 6, Using the Neo4j REST API.

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.