Authentication Required
Login to generate and manage your API keys.
Authentication: All endpoints require a valid API key.
POST /lookup

Description

Retrieve a list of all available JSON filenames that your API key has access to.

Parameters

Parameter Type Required Description
api_key string Required Your unique API key

Example Request

Python
import requests

url = "/lookup"
payload = {"api_key": "your-api-key-here"}
response = requests.post(url, json=payload)
print(response.json())

Example Response

JSON
{"filenames": ["users", "products", "orders"]}
POST /jsondata

Description

Retrieve data from a specific JSON file. Optionally limit the number of returned items.

Parameters

Parameter Type Required Description
api_key string Required Your unique API key
filename string Required Name of the JSON file
datanumber integer Optional Limit items returned

Example Request

Python
import requests

url = "/jsondata"
params = {
    "api_key": "your-key",
    "filename": "users",
    "datanumber": 5
}
response = requests.post(url, params=params)
print(response.json())

Example Response

JSON
[{"id": 1, "name": "John"}, {"id": 2, "name": "Jane"}]
POST /upload WRITE

Description

Create a new JSON file. Requires an API key with write or both permission.

Parameters

Parameter Type Required Description
api_key string Required API key with write permission
filename string Required Name for the new JSON file
data object/array Required JSON data (sent in request body)

Example Request

Python
import requests
import json

url = "/upload"
params = {"api_key": "your-key", "filename": "products"}
data = {"items": [{"id": 1, "name": "Product A"}]}

response = requests.post(url, params=params, json=data)
print(response.json())

Example Response

JSON
{"status": "success", "message": "File 'products' created successfully", "filename": "products"}
POST /update WRITE

Description

Update an existing JSON file. Supports two modes:

Parameters

Parameter Type Required Description
api_key string Required API key with write permission
filename string Required Name of the JSON file to update
data object Required JSON data (sent in request body)
overwrite boolean Optional Default: false. If true, replace all data
Upsert Mode Note: Only works with object {} data. If your file contains an array [], use overwrite=true.

Example: Overwrite Mode

Python
import requests

url = "/update"
params = {"api_key": "your-key", "filename": "config", "overwrite": True}
data = {"setting1": "new_value", "setting2": "another_value"}

response = requests.post(url, params=params, json=data)
print(response.json())
# Result: File completely replaced with new data

Example: Upsert Mode (Merge)

Python
# Existing file: {"name": "John", "age": 30}
# Update with: {"age": 31, "city": "NYC"}

url = "/update"
params = {"api_key": "your-key", "filename": "user", "overwrite": False}
data = {"age": 31, "city": "NYC"}

response = requests.post(url, params=params, json=data)
# Result: {"name": "John", "age": 31, "city": "NYC"}
# - "age" updated (existed)
# - "city" added (new key)

Example Response (Upsert)

JSON
{
  "status": "success",
  "message": "File 'user' updated successfully",
  "mode": "upsert",
  "added_keys": ["city"],
  "updated_keys": ["age"]
}
API Key Permission Levels:
  • Read: Can use /lookup and /jsondata
  • Write: Can use /upload, /update, and read endpoints
  • Both: Full access to all endpoints
Error Codes:
  • 400: Invalid JSON format or upsert not supported
  • 403: No access or insufficient permission
  • 404: File does not exist (for /update)
  • 409: File already exists (for /upload)

API Testing

Test endpoints directly from this page.

Testing...