Run a Cypher query against a graph in a deployment, or return its EXPLAIN or PROFILE plan
curl --request POST \
--url http://localhost:3001/api/clusters/{clusterName}/query \
--header 'Content-Type: application/json' \
--cookie token= \
--data '
{
"graph": "<string>",
"query": "<string>",
"mode": "query",
"readOnly": true
}
'import requests
url = "http://localhost:3001/api/clusters/{clusterName}/query"
payload = {
"graph": "<string>",
"query": "<string>",
"mode": "query",
"readOnly": True
}
headers = {
"cookie": "token=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'token=', 'Content-Type': 'application/json'},
body: JSON.stringify({graph: '<string>', query: '<string>', mode: 'query', readOnly: true})
};
fetch('http://localhost:3001/api/clusters/{clusterName}/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/clusters/{clusterName}/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'graph' => '<string>',
'query' => '<string>',
'mode' => 'query',
'readOnly' => true
]),
CURLOPT_COOKIE => "token=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3001/api/clusters/{clusterName}/query"
payload := strings.NewReader("{\n \"graph\": \"<string>\",\n \"query\": \"<string>\",\n \"mode\": \"query\",\n \"readOnly\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "token=")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3001/api/clusters/{clusterName}/query")
.header("cookie", "token=")
.header("Content-Type", "application/json")
.body("{\n \"graph\": \"<string>\",\n \"query\": \"<string>\",\n \"mode\": \"query\",\n \"readOnly\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/clusters/{clusterName}/query")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["cookie"] = 'token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"graph\": \"<string>\",\n \"query\": \"<string>\",\n \"mode\": \"query\",\n \"readOnly\": true\n}"
response = http.request(request)
puts response.read_body{
"mode": "query",
"columns": [
"<string>"
],
"rows": [
[
"<unknown>"
]
],
"truncated": true,
"durationMs": 123,
"limits": {
"maxRows": 123,
"timeoutMs": 123
},
"stats": {
"labelsAdded": 123,
"labelsRemoved": 123,
"nodesCreated": 123,
"nodesDeleted": 123,
"propertiesSet": 123,
"propertiesRemoved": 123,
"relationshipsCreated": 123,
"relationshipsDeleted": 123,
"indicesCreated": 123,
"indicesDeleted": 123,
"constraintsCreated": 123,
"constraintsDeleted": 123,
"cachedExecution": true,
"queryInternalExecutionTime": 123
},
"plan": [
"<string>"
]
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}Clusters
Run a Cypher query against a graph in a deployment, or return its EXPLAIN or PROFILE plan
Run a Cypher query against a graph in a deployment, or return its EXPLAIN or PROFILE plan. Read-only queries and EXPLAIN need the read action on clusters.query; queries that may write, and PROFILE, which executes the query, need write.
POST
/
api
/
clusters
/
{clusterName}
/
query
Run a Cypher query against a graph in a deployment, or return its EXPLAIN or PROFILE plan
curl --request POST \
--url http://localhost:3001/api/clusters/{clusterName}/query \
--header 'Content-Type: application/json' \
--cookie token= \
--data '
{
"graph": "<string>",
"query": "<string>",
"mode": "query",
"readOnly": true
}
'import requests
url = "http://localhost:3001/api/clusters/{clusterName}/query"
payload = {
"graph": "<string>",
"query": "<string>",
"mode": "query",
"readOnly": True
}
headers = {
"cookie": "token=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'token=', 'Content-Type': 'application/json'},
body: JSON.stringify({graph: '<string>', query: '<string>', mode: 'query', readOnly: true})
};
fetch('http://localhost:3001/api/clusters/{clusterName}/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/clusters/{clusterName}/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'graph' => '<string>',
'query' => '<string>',
'mode' => 'query',
'readOnly' => true
]),
CURLOPT_COOKIE => "token=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3001/api/clusters/{clusterName}/query"
payload := strings.NewReader("{\n \"graph\": \"<string>\",\n \"query\": \"<string>\",\n \"mode\": \"query\",\n \"readOnly\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "token=")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3001/api/clusters/{clusterName}/query")
.header("cookie", "token=")
.header("Content-Type", "application/json")
.body("{\n \"graph\": \"<string>\",\n \"query\": \"<string>\",\n \"mode\": \"query\",\n \"readOnly\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/clusters/{clusterName}/query")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["cookie"] = 'token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"graph\": \"<string>\",\n \"query\": \"<string>\",\n \"mode\": \"query\",\n \"readOnly\": true\n}"
response = http.request(request)
puts response.read_body{
"mode": "query",
"columns": [
"<string>"
],
"rows": [
[
"<unknown>"
]
],
"truncated": true,
"durationMs": 123,
"limits": {
"maxRows": 123,
"timeoutMs": 123
},
"stats": {
"labelsAdded": 123,
"labelsRemoved": 123,
"nodesCreated": 123,
"nodesDeleted": 123,
"propertiesSet": 123,
"propertiesRemoved": 123,
"relationshipsCreated": 123,
"relationshipsDeleted": 123,
"indicesCreated": 123,
"indicesDeleted": 123,
"constraintsCreated": 123,
"constraintsDeleted": 123,
"cachedExecution": true,
"queryInternalExecutionTime": 123
},
"plan": [
"<string>"
]
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}Authorizations
JWT token stored in HTTP-only cookie
Path Parameters
Query Parameters
namespace is required
Minimum string length:
1Body
application/json
Response
Default Response
Was this page helpful?