Chapter 20. REST API

Table of Contents

20.1. Transactional HTTP endpoint
20.2. Neo4j Status Codes
20.3. Service root
20.4. Streaming
20.5. Cypher queries via REST
20.6. Property values
20.7. Nodes
20.8. Relationships
20.9. Relationship types
20.10. Node properties
20.11. Relationship properties
20.12. Node labels
20.13. Indexing
20.14. Constraints
20.15. Traversals
20.16. Graph Algorithms
20.17. Batch operations
20.18. Legacy indexing
20.19. Unique Indexing
20.20. Legacy Automatic Indexes
20.21. Configurable Legacy Automatic Indexing
20.22. WADL Support

The Neo4j REST API is designed with discoverability in mind, so that you can start with a GET on the Section 20.3, “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, Languages.

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.

The server supports streaming results, with better performance and lower memory overhead. See Section 20.4, “Streaming” for more information.