Rest API
Table of Contents
Authentication
Settings
- Set Configuration Value - POST /api/config
- Get Configuration Value - GET /api/config
- Create New User - POST /api/user
- Delete User - DELETE /api/user
- Get All Users - GET /api/user
- Modify a User - PATCH /api/user/{userName}
Graph
- Create a Graph & Run A Query - GET /api/graph/{graphName}
- Delete a Graph - DELETE /api/graph/{graphName}
- Get All Graphs - GET /api/graph
- Duplicate a Graph - POST /api/graph/{destinationGraphName}
- Get Graph Count - GET /api/graph/{graphName}/count
- Add Node Attribute - POST /api/graph/{graphName}/{id}/{attribute}
- Delete Node Attribute - DELETE /api/graph/{graphName}/{id}/{attribute}
- Add Node Label - POST /api/graph/{graphName}/{id}/label
- Delete Node Label - DELETE /api/graph/{graphName}/{id}/label
- Delete Node - DELETE /api/graph/{graphName}/{id}
Schema
- Create New Schema & Run A Query - GET /api/graph/{schemaName}
- Delete a Schema - DELETE /api/graph/{schemaName}
- Get Schema Count - GET /api/schema/{schemaName}/count
- Add Schema Node - POST /api/schema/{schemaName}/{id}
- Delete Schema Node - DELETE /api/schema/{schemaName}/{id}
- Add Schema Attribute - PATCH /api/schema/{schemaName}/{id}/{attribute}
- Delete Schema Attribute - DELETE /api/schema/{schemaName}/{id}/{attribute}
- Add Schema Label - POST /api/schema/{schemaName}/{id}/label
- Delete Schema Label - DELETE /api/schema/{schemaName}/{id}/label
Authentication
Login - GET /api/auth/providers
This endpoint retrieves information about authentication providers and their respective URLs for sign-in and callback.
Responses
- 200: Successful authentication provider retrieval
- Content-Type:
application/json
-
Example response:
{ "credentials": { "id": "credentials", "name": "Credentials", "type": "credentials", "signinUrl": "http://localhost:3000/api/auth/signin/credentials", "callbackUrl": "http://localhost:3000/api/auth/callback/credentials" } }
- Content-Type:
Logout - POST /api/auth/signout
This endpoint signs out a user, ending their authenticated session.
Request Body
- Content-Type:
application/x-www-form-urlencoded
-
Example request:
{ "csrfToken": "insert csrfToken", "callbackUrl": "/login", "json": true }
Responses
- 200: Successful logout
- Content-Type:
application/json
-
Example response:
{ "url": "http://localhost:3000/api/auth/signout?csrf=true" }
- Content-Type:
Settings
Set Configuration Value - POST /api/config
This endpoint sets a configuration value for MAX_QUEUED_QUERIES
.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.config
(query, required): The configuration name.value
(query, required): The integer value to set.
Responses
- 200: Successful configuration update
- Content-Type:
application/json
-
Example response:
{ "config": "OK" }
- Content-Type:
Get Configuration Value - GET /api/config
This endpoint retrieves the value for MAX_QUEUED_QUERIES
.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.config
(query, required): The name of the configuration to retrieve.
Responses
- 200: Successful configuration retrieval
- Content-Type:
application/json
-
Example response:
{ "config": [ "MAX_QUEUED_QUERIES", 25 ] }
- Content-Type:
Create New User - POST /api/user
This endpoint creates a new user with specified credentials.
Request Body
- Content-Type:
application/json
-
Example request:
{ "username": "user", "password": "Pass123@", "role": "Read-Write" }
Responses
- 201: User created successfully
- Content-Type:
application/json
-
Example response:
{ "message": "User created" }
- Content-Type:
Delete User - DELETE /api/user
This endpoint deletes a user based on their username and role.
Request Body
- Content-Type:
application/json
-
Example request:
{ "users": [ { "username": "userName", "role": "Read-Write" } ] }
Responses
- 200: User deleted successfully
- Content-Type:
application/json
-
Example response:
{ "message": "User deleted" }
- Content-Type:
Get All Users - GET /api/user
This endpoint retrieves a list of all users.
Responses
- 200: List of users retrieved successfully
- Content-Type:
application/json
-
Example response:
{ "result": [ { "username": "default", "role": "Admin", "checked": false } ] }
- Content-Type:
Modify A User - PATCH /api/user/{userName}
This endpoint updates the role of a specific user.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.userName
(path, required): The username of the user to modify.role
(query, required): The new role to assign to the user (Admin
,Read-Only
,Read-Write
).
Responses
- 200: User updated successfully
- Content-Type:
application/json
-
Example response:
{ "message": "User role updated" }
- Content-Type:
Graph
Create A Graph & Run A Query - GET /api/graph/{graphName}
This endpoint creates a graph and runs a query.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.graphName
(path, required): The name of the graph to be created.query
(query, required): The query to run, such asRETURN 1
.
Responses
- 200: Graph created and query executed
- Content-Type:
application/json
-
Example response:
{ "result": { "metadata": [ "Nodes created: 40", "Relationships created: 20", "Cached execution: 1", "Query internal execution time: 0.201420 milliseconds" ], "data": [ { "queryData": "exampleData" } ] } }
- Content-Type:
Delete A Graph - DELETE /api/graph/{graphName}
This endpoint deletes a specified graph.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.graphName
(path, required): The name of the graph to be deleted.
Responses
- 200: Graph deleted successfully
- Content-Type:
application/json
-
Example response:
{ "message": "GraphName graph deleted" }
- Content-Type:
Get All Graphs - GET /api/graph
This endpoint retrieves a list of all graphs.
Responses
- 200: List of graphs retrieved successfully
- Content-Type:
application/json
-
Example response:
{ "result": [ "graphName" ] }
- Content-Type:
Duplicate A Graph - POST /api/graph/{destinationGraphName}
This endpoint duplicates a graph from source to destination.
Parameters
destinationGraphName
(path, required): The name of the destination graph.sourceName
(query, required): The name of the source graph to duplicate.
Responses
- 200: Graph duplicated successfully
- Content-Type:
application/json
-
Example response:
{ "success": "OK" }
- Content-Type:
Get Graph Count - GET /api/graph/{graphName}/count
This endpoint retrieves the count of nodes and edges in a specified graph.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.graphName
(path, required): The name of the graph to count nodes and edges.
Responses
- 200: Graph count retrieved successfully
- Content-Type:
application/json
-
Example response:
{ "result": { "data": [ { "nodes": 7417, "edges": 4341 } ] } }
- Content-Type:
Add Node Attribute - POST /api/graph/{graphName}/{id}/{attribute}
This endpoint adds an attribute to a node in a graph.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.graphName
(path, required): The name of the graph.id
(path, required): The ID of the node to which the attribute will be added.attribute
(path, required): The name of the attribute to add.
Request Body
- Content-Type:
application/json
-
Example request:
{ "value": "your_attribute_value", "type": true }
Responses
- 200: Node attribute added successfully
- Content-Type:
application/json
-
Example response:
{ "result": { "metadata": [ "Cached execution: 0", "Query internal execution time: 0.412958 milliseconds" ] } }
- Content-Type:
Delete Node Attribute - DELETE /api/graph/{graphName}/{id}/{attribute}
This endpoint deletes an attribute from a node in a graph.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.graphName
(path, required): The name of the graph.id
(path, required): The ID of the node from which the attribute will be deleted.attribute
(path, required): The name of the attribute to delete.
Request Body
- Content-Type:
application/json
-
Example request:
{ "type": true }
Responses
- 200: Node attribute deleted successfully
- Content-Type:
application/json
-
Example response:
{ "result": { "metadata": [ "Cached execution: 0", "Query internal execution time: 0.407125 milliseconds" ] } }
- Content-Type:
Add Node Label - POST /api/graph/{graphName}/{id}/label
This endpoint adds a label to a node in a graph.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.graphName
(path, required): The name of the graph.id
(path, required): The ID of the node to which the label will be added.
Request Body
- Content-Type:
application/json
-
Example request:
{ "label": "your_label_name" }
Responses
- 200: Node label added successfully
- Content-Type:
application/json
-
Example response:
{ "message": "Label added successfully" }
- Content-Type:
Delete Node Label - DELETE /api/graph/{graphName}/{id}/label
This endpoint deletes a label from a node in a graph.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.graphName
(path, required): The name of the graph.id
(path, required): The ID of the node from which the label will be deleted.
Request Body
- Content-Type:
application/json
-
Example request:
{ "label": "your_label_name" }
Responses
- 200: Node label deleted successfully
- Content-Type:
application/json
-
Example response:
{ "message": "Label removed successfully" }
- Content-Type:
Delete Node - DELETE /api/graph/{graphName}/{id}
This endpoint deletes a node from a graph.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.graphName
(path, required): The name of the graph.id
(path, required): The ID of the node to delete.
Request Body
- Content-Type:
application/json
-
Example request:
{ "type": true }
Responses
- 200: Node deleted successfully
- Content-Type:
application/json
-
Example response:
{ "message": "Node deleted successfully" }
- Content-Type:
Schema
Create New Schema & Run A Query - GET /api/graph/{schemaName}
This endpoint creates a new schema and runs a query.
Parameters
schemaName
(path, required): The name of the schema to create.query
(query, required): The query to execute.
Responses
- 200: Schema created and query executed
- Content-Type:
application/json
-
Example response:
{ "result": { "metadata": [ "Cached execution: 0", "Query internal execution time: 0.153307 milliseconds" ], "data": [ { "1": 1 } ] } }
- Content-Type:
Delete A Schema - DELETE /api/graph/{schemaName}
This endpoint deletes a specified schema.
Parameters
schemaName
(path, required): The name of the schema to delete.
Responses
- 200: Schema deleted successfully
- Content-Type:
application/json
-
Example response:
{ "message": "SchemaName schema deleted" }
- Content-Type:
Get Schema Count - GET /api/schema/{schemaName}/count
This endpoint retrieves the count of nodes and edges in a specified schema.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.schemaName
(path, required): The name of the schema to count nodes and edges.
Responses
- 200: Schema count retrieved successfully
- Content-Type:
application/json
-
Example response:
{ "result": { "data": [ { "nodes": 0, "edges": 0 } ] } }
- Content-Type:
Add Schema Node - POST /api/schema/{schemaName}/{id}
This endpoint adds a node to a schema.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.schemaName
(path, required): The name of the schema.id
(path, required): The ID of the node to add (use -1 for new nodes).
Request Body
- Content-Type:
application/json
-
Example request:
{ "type": true, "label": ["your_label_name"], "attributes": [["attribute_name", ["String", "default_value", "true", "true"]]], "selectedNodes": [null, null] }
Responses
- 200: Schema node added successfully
- Content-Type:
application/json
-
Example response:
{ "result": { "metadata": [ "Labels added: 1", "Nodes created: 1", "Properties set: 1", "Cached execution: 0", "Query internal execution time: 0.987458 milliseconds" ], "data": [ { "n": { "id": 0, "labels": [ "your_label_name" ], "properties": { "attribute_name": "String!*default_value" } } } ] } }
- Content-Type:
Delete Schema Node - DELETE /api/schema/{schemaName}/{id}
This endpoint deletes a node from a schema.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.schemaName
(path, required): The name of the schema.id
(path, required): The ID of the node to delete.
Request Body
- Content-Type:
application/json
-
Example request:
{ "type": true }
Responses
- 200: Schema node deleted successfully
- Content-Type:
application/json
-
Example response:
{ "message": "Node deleted successfully" }
- Content-Type:
Add Schema Attribute - PATCH /api/schema/{schemaName}/{id}/{attribute}
This endpoint adds an attribute to a node in a schema.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.schemaName
(path, required): The name of the schema.id
(path, required): The ID of the node to which the attribute will be added.attribute
(path, required): The name of the attribute to add.
Request Body
- Content-Type:
application/json
-
Example request:
{ "type": true, "attribute": ["String", "default_value", "true", "true"] }
Responses
- 200: Schema node attribute added successfully
- Content-Type:
application/json
-
Example response:
{ "message": "Attribute updated successfully" }
- Content-Type:
Delete Schema Attribute - DELETE /api/schema/{schemaName}/{id}/{attribute}
This endpoint deletes an attribute from a node in a schema.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.schemaName
(path, required): The name of the schema.id
(path, required): The ID of the node from which the attribute will be deleted.attribute
(path, required): The name of the attribute to delete.
Request Body
- Content-Type:
application/json
-
Example request:
{ "type": true }
Responses
- 200: Schema node attribute deleted successfully
- Content-Type:
application/json
-
Example response:
{ "message": "Attribute deleted successfully" }
- Content-Type:
Add Schema Label - POST /api/schema/{schemaName}/{id}/label
This endpoint adds a label to a node in a schema.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.schemaName
(path, required): The name of the schema.id
(path, required): The ID of the node to which the label will be added.
Request Body
- Content-Type:
application/json
-
Example request:
{ "label": "your_label_name" }
Responses
- 200: Schema node label added successfully
- Content-Type:
application/json
-
Example response:
{ "result": { "metadata": [ "Cached execution: 0", "Query internal execution time: 0.417250 milliseconds" ] } }
- Content-Type:
Delete Schema Label - DELETE /api/schema/{schemaName}/{id}/label
This endpoint deletes a label from a node in a schema.
Parameters
cookie
(header, required): Cookie header with session and auth tokens.schemaName
(path, required): The name of the schema.id
(path, required): The ID of the node from which the label will be deleted.
Request Body
- Content-Type:
application/json
-
Example request:
{ "label": "your_label_name" }
Responses
- 200: Schema node label deleted successfully
- Content-Type:
application/json
-
Example response:
{ "result": { "metadata": [ "Cached execution: 0", "Query internal execution time: 0.829917 milliseconds" ] } }
- Content-Type: