-
Notifications
You must be signed in to change notification settings - Fork 0
API
REST API v1 for Nexora — file workspace backend.
Base URL: https://your-domain/api/v1
Cookie-based session: session=<jwt>; csrf_token=<token>
Mutating requests require X-CSRF-Token header.
{
"error": "error_code",
"message": "Human-readable description",
"request": "req_abc123"
}| Status | Code | Description |
|---|---|---|
| 400 | bad_request |
Invalid input |
| 401 | unauthorized |
Missing/invalid auth |
| 403 | forbidden |
Insufficient permissions |
| 404 | not_found |
Not found |
| 429 | rate_limited |
Too many requests |
| 500 | internal_error |
Server error |
Initial admin setup. Only works once.
{"username": "admin", "password": "secure", "email": "admin@example.com"}{"username": "admin", "password": "secure", "totp_code": "123456"}Current session info. Returns user object.
-
POST /auth/totp/setup→{secret, qr_code, backup_codes} -
POST /auth/totp/verify→{code} -
POST /auth/totp/disable→{password}
[{"id": "root1", "name": "Primary", "type": "local", "permission": "write"}]{"name": "S3 Archive", "type": "s3", "config": {"bucket": "my-bucket", "region": "us-east-1"}}| Param | Type | Description |
|---|---|---|
root |
string | Root ID (required) |
path |
string | Relative path |
sort |
string |
name, modified, size, type
|
order |
string |
asc, desc
|
filter |
string |
all, documents, images, videos, audio, archives, folders
|
offset |
int | Pagination offset |
limit |
int | Page size (max 1000) |
Response:
{"items": [FileItem...], "has_more": false, "next_offset": 0}Single file metadata.
Create directory: {root, path}
{root, path, new_name}
{root, paths: [], target_root, target_path}
Same as move.
{root, paths: []} — moves to trash.
Multipart form: POST /api/v1/files/upload?root=root1&path=folder/
Download path(s). Supports Range header for video seeking.
Raw file stream.
On-the-fly transcoding. Params: target (hls, mp4, webm, jpg, webp), width, height, quality.
List trashed items.
{id}
Permanent delete: {id}
| Param | Type | Description |
|---|---|---|
q |
string | Query |
roots[] |
string | Root IDs |
filter |
string | Type filter |
offset |
int | Pagination |
limit |
int | Page size |
List versions for a file. {root, path}
Create version snapshot.
Restore specific version.
{name, root, paths: []}
{root, path, permission, password?, expires_in?}
-
GET /api/v1/share/{token}— info -
GET /api/v1/share/{token}/download— download -
GET /api/v1/share/{token}/raw— raw stream -
POST /api/v1/share/{token}/verify— password
GET /api/v1/admin/users-
POST /api/v1/admin/users—{username, password, role} PUT /api/v1/admin/users/{id}DELETE /api/v1/admin/users/{id}- User root permissions:
GET/POST/DELETE /api/v1/admin/users/{id}/roots
-
GET /api/v1/admin/audit— with pagination + filters
POST /api/v1/admin/search/reindex-
GET /api/v1/admin/usage— storage stats
| Category | Limit |
|---|---|
| Auth | 5/min per IP |
| File operations | 60/min per user |
| Search | 30/min per user |
| Upload | 10/min per user |
- Architecture — System design
- Deployment — Production deployment