Endpoints
All endpoints are relative to the base URL https://api.visihub.com/v1. All requests require authentication unless noted otherwise.
List files
Section titled “List files”GET /filesReturns a paginated list of files owned by the authenticated user.
Query parameters:
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
per_page | integer | Results per page (default: 25, max: 100) |
Get a file
Section titled “Get a file”GET /files/:idReturns metadata for a single file.
Upload a file
Section titled “Upload a file”POST /filesUpload a new spreadsheet file. Use multipart/form-data encoding.
Parameters:
| Parameter | Type | Description |
|---|---|---|
file | file | The spreadsheet file (.sheet, .csv, .xlsx) |
name | string | Display name (optional, defaults to filename) |
visibility | string | private or public (default: private) |
Update a file
Section titled “Update a file”PATCH /files/:idUpdate file metadata.
Body parameters:
| Parameter | Type | Description |
|---|---|---|
name | string | New display name |
visibility | string | private or public |
Delete a file
Section titled “Delete a file”DELETE /files/:idMove a file to trash. Files in trash are permanently deleted after 30 days.
Download a file
Section titled “Download a file”GET /files/:id/downloadReturns the file contents with appropriate Content-Type and Content-Disposition headers.
Get current user
Section titled “Get current user”GET /users/meReturns the authenticated user’s profile.
Update current user
Section titled “Update current user”PATCH /users/meBody parameters:
| Parameter | Type | Description |
|---|---|---|
name | string | Display name |
Sessions
Section titled “Sessions”Request magic link
Section titled “Request magic link”POST /sessionsSends a magic link to the provided email address. Does not require authentication.
Body parameters:
| Parameter | Type | Description |
|---|---|---|
email | string | Email address |
Verify magic link
Section titled “Verify magic link”POST /sessions/verifyExchanges a magic link token for a JWT. Does not require authentication.
Body parameters:
| Parameter | Type | Description |
|---|---|---|
token | string | Token from the magic link |
Response:
{ "jwt": "eyJhbGciOi...", "user": { "id": "user_abc123", "email": "user@example.com", "name": "Jane Doe" }}Delete session
Section titled “Delete session”DELETE /sessionsRevokes the current JWT token.