Table of Contents
- Login - GET /api/auth/providers
- Logout - POST /api/auth/signout
- Set Configuration Value - POST /api/config
- Get Configuration Value - GET /api/config
- Create New User - POST /api/user
- Delete User - POST /api/user
- Get All Users - GET /api/user
- Modify a User - PATCH /api/user/{userName}
- 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}
- Create New Schema & Run A Query - GET /api/graph/{schemaName}
- Delete a Schema - DELETE /api/graph/{schemaName}
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:
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 - POST /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:
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:
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: