Version: 1.0.0
Create a new user account
{
"username": "string (min 3 chars)",
"password": "string (min 6 chars)",
"email": "string (optional)",
"name": "string (optional)"
}
curl -X POST http://localhost:3001/auth/signup -H "Content-Type: application/json" -d '{"username":"string (min 3 chars)","password":"string (min 6 chars)","email":"string (optional)","name":"string (optional)"}'
Sign in to an existing account
{
"username": "string",
"password": "string"
}
curl -X POST http://localhost:3001/auth/signin -H "Content-Type: application/json" -d '{"username":"string","password":"string"}'
Create a new query. Queries are private by default.
{
"content": "string",
"name": "string",
"description": "string (optional)",
"isPublic": "boolean (optional, defaults to false)"
}
curl -X POST -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3001/queries/create -H "Content-Type: application/json" -d '{"content":"string","name":"string","description":"string (optional)","isPublic":"boolean (optional, defaults to false)"}'
Get all public queries, ordered by creation date (newest first)
curl http://localhost:3001/queries/public
Get a specific query. Only accessible if query is public, you own it, or have explicit access.
| Parameter | Type |
|---|---|
| queryId | string |
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3001/queries/:queryId
Update an existing query that you own
| Parameter | Type |
|---|---|
| queryId | string |
{
"content": "string (optional)",
"name": "string (optional)",
"description": "string (optional)",
"isPublic": "boolean (optional)"
}
curl -X PATCH -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3001/queries/:queryId -H "Content-Type: application/json" -d '{"content":"string (optional)","name":"string (optional)","description":"string (optional)","isPublic":"boolean (optional)"}'
Delete a query that you own. This will also remove all saved instances and access controls.
| Parameter | Type |
|---|---|
| queryId | string |
curl -X DELETE -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3001/queries/:queryId
Get all queries created by the authenticated user
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3001/queries/created-queries
Create a copy of a query. Only works for queries you own, have access to, or are public. Cloned queries are private by default.
| Parameter | Type |
|---|---|
| queryId | string |
curl -X POST -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3001/queries/:queryId/clone
Save a public query to your collection. Cannot save private queries.
| Parameter | Type |
|---|---|
| queryId | string |
curl -X POST -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3001/queries/:queryId/save
Get all public queries saved by the authenticated user. Private queries are automatically removed from saved queries.
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3001/queries/saved-queries
Get all public queries saved by a specific user
| Parameter | Type |
|---|---|
| userId | string |
curl http://localhost:3001/queries/user/:userId/saved-queries
Get the number of times a query has been saved
| Parameter | Type |
|---|---|
| queryId | string |
curl http://localhost:3001/queries/:queryId/save-count
Grant access to a specific user for your query
| Parameter | Type |
|---|---|
| queryId | string |
| userId | string |
curl -X POST -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3001/queries/:queryId/access/:userId
Revoke access from a specific user for your query
| Parameter | Type |
|---|---|
| queryId | string |
| userId | string |
curl -X DELETE -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3001/queries/:queryId/access/:userId
Get a list of users who have access to your query
| Parameter | Type |
|---|---|
| queryId | string |
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3001/queries/:queryId/access
Get queries created by a specific user. Returns only public queries and ones you have access to.
| Parameter | Type |
|---|---|
| userId | string |
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3001/queries/user/:userId/queries