Article DetailsDetailsHelp DetailsThe Query API can be used to execute Cypher statements against a Neo4j Aura instance through HTTP requests.This article aims to demonstrate the same through Postman. The feature is available through all Tiers in Aura. Prerequisites: Running Aura instanceDB user credentials for the instancePostman (see https://www.postman.com/downloads/ Note: If you are on a VDC (Aura Enterprise) environment with Private Link and Public Traffic disabled, you will be able to perform these actions only from a client that is a part of your VPC or is connected to your VPC (VPN, Direct Access, etc.,) Authorization You can set the authorization at the parent level so that every child request can be inherited from the parent. Parent Authorization Configuration Launch Postman from the Home screen, click on Workspaces and select either the default value (My Workspace) or create a new one.In this example, we have created a new workspace called Aura_Query_APICreate a new collection. We are calling it Aura_Query_API_1 Navigate to the variables Tab and create three variables Variable Name: AURA_URI . Initial Value: https://<dbid>.databases.neo4j.io/db/neo4j/query/v2For example, If your Aura instance's DBID is abcd1234, this would be https://abcd1234.databases.neo4j.io/db/neo4j/query/v2Variable Name: NEO4J_USER . Initial Value: <your_DB_username>For example, if your DB user name is neo4j, this would be neo4jVariable Name: NEO4J_PASS . Initial Value: <DB_Password> This would be the password for the user you had added under NEO4J_USER Configuring Authorization at the Parent Level, to use the variables added in the previous step Navigate to the Authorization tab in the same collectionSet the 'Type' to 'Basic Auth'Enter {{NEO4J_USER}} in the Username fieldEnter {{NEO4J_PASS}} in the Password field Making a POST request: Create a new request in the same collection to ensure the authorization configured at the parent level can be utilized.3 dots from the collection > 'Add request' Change the request type to POST and enter {{AURA_URI}} in the URL.This will fetch the Aura URL configured in the variables earlierNavigate to the Authorization tab and set the Type to 'Inherit Auth from Parent'No changes are required in the default headers generated by Postman. Click the Body tab, choose 'raw' and JSON as the typeThe payload is expected as a JSON in the format {"statement" : "<Cypher to Run>"}For example: { "statement": "MATCH(n:Person{name:'Kevin Bacon'}) RETURN n.born" } Send the request.The Query API response will include the values in the return clause in the Cypher statement, along with the bookmarks. CURL equivalent of the above:curl --location 'https://abcd1234.databases.neo4j.io/db/neo4j/query/v2' \ --user "neo4j:veryStrongPassword" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{"statement": "MATCH (n:Person {name: \"Kevin Bacon\"}) RETURN n.born"}'MERGE query with no RETURN Please note that the field names/parameters must be enclosed in quotes. Example parameterized READ query : CURL: curl --location 'https://abcd1234.databases.neo4j.io/db/neo4j/query/v2'; \ --user "neo4j:veryStrongPassword" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{"statement": "MATCH (n {name: $person_name}) RETURN (n[$fieldName]) as field_value", "parameters": { "person_name": "Kevin Bacon", "fieldName": "born" }}' Postman: References: Neo4j Docs - Query APINeo4j Developer Blog - Querying Your Neo4j Aura Database Via HTTPSInformationTitleNeo4j Query API for Aura - configuration and Testing in PostmanArticle Created Date12/11/2024, 2:49 AMURL NameNeo4j-Query-API-for-Aura-configuration-and-Testing-in-PostmanLast Modified Date2/3/2025, 7:48 AM