| Project | Base URL | Version | Authentication |
|---|---|---|---|
| QuikNote API | https://quiknote.app/api |
1.0.0 | Appwrite Auth Session |
All protected API endpoints require a valid Appwrite auth session. Authentication is handled via Appwrite Auth service with email/password credentials.
Session Verification:
- Client-side:
useAuth()context provides authenticated user data and session token - Server-side: Appwrite SDK automatically includes session in all requests
Session Management:
- Appwrite stores session tokens securely in browser storage
- Automatic token refresh handled by Appwrite SDK
- Manual logout clears session and local data
Registers a new user account.
Request Body:
{
"email": "user@example.com",
"password": "secure-password",
"name": "User Name"
}Response (201 Created):
{
"success": true,
"message": "Account created successfully",
"user": {
"id": "user_abc123",
"email": "user@example.com",
"name": "User Name"
}
}Authenticates a user with email and password.
Request Body:
{
"email": "user@example.com",
"password": "secure-password"
}Response (200 OK):
{
"success": true,
"message": "Signed in successfully",
"user": {
"id": "user_abc123",
"email": "user@example.com",
"name": "User Name"
}
}Logs out the authenticated user and clears session.
Authentication: Requires Appwrite session.
Response (200 OK):
{
"success": true,
"message": "Signed out successfully"
}Retrieves the current authenticated user's information.
Authentication: Requires Appwrite session.
Response (200 OK):
{
"success": true,
"user": {
"id": "user_abc123",
"email": "user@example.com",
"name": "User Name",
"theme": "light"
}
}Retrieves the authenticated user's profile information.
Authentication: Requires Appwrite session.
Response (200 OK):
{
"success": true,
"profile": {
"id": "user_abc123",
"name": "User Name",
"email": "user@example.com",
"theme": "light",
"createdAt": "2025-12-18T10:00:00.000Z"
}
}Updates the authenticated user's profile information.
Authentication: Requires Appwrite session.
Request Body:
{
"name": "New Name"
}Response (200 OK):
{
"success": true,
"message": "Profile updated successfully",
"profile": {
"id": "user_abc123",
"name": "New Name",
"email": "user@example.com"
}
}Updates the user's theme preference (light/dark).
Authentication: Requires Appwrite session.
Request Body:
{
"theme": "dark"
}Response (200 OK):
{
"success": true,
"message": "Theme updated successfully",
"theme": "dark"
}Retrieves all notebooks for the authenticated user.
Authentication: Requires Appwrite session.
Response (200 OK):
{
"success": true,
"notebooks": [
{
"id": "nb_abc123",
"name": "Personal",
"description": "Personal notes and ideas",
"color": "blue",
"noteCount": 15,
"createdAt": "2025-12-18T10:00:00.000Z"
}
]
}Creates a new notebook for the authenticated user.
Authentication: Requires Appwrite session.
Request Body:
{
"name": "Work Projects",
"description": "Notes for work projects",
"color": "green"
}Response (201 Created):
{
"success": true,
"message": "Notebook created successfully",
"notebook": {
"id": "nb_abc123",
"name": "Work Projects",
"description": "Notes for work projects",
"color": "green",
"createdAt": "2025-12-18T10:00:00.000Z"
}
}Updates a specific notebook.
Authentication: Requires Appwrite session.
Path Parameters:
notebookId- The Appwrite Document ID of the notebook
Request Body:
{
"name": "Updated Name",
"color": "red"
}Response (200 OK):
{
"success": true,
"message": "Notebook updated successfully",
"notebook": {
"id": "nb_abc123",
"name": "Updated Name",
"color": "red"
}
}Deletes a notebook and optionally its associated notes.
Authentication: Requires Appwrite session.
Path Parameters:
notebookId- The Appwrite Document ID of the notebook
Query Parameters:
| Param | Type | Required | Description |
|---|---|---|---|
| deleteNotes | boolean | No | If true, delete all notes in notebook. If false, move to default notebook. |
Response (200 OK):
{
"success": true,
"message": "Notebook deleted successfully"
}Retrieves all notes for the authenticated user with optional filters.
Authentication: Requires Appwrite session.
Query Parameters:
| Param | Type | Required | Description |
|---|---|---|---|
| notebookId | string | No | Filter by notebook ID |
| search | string | No | Search by title or content |
| isDeleted | boolean | No | Include deleted notes (trash) |
Example Request:
GET /api/notes?notebookId=nb_abc123&search=javascriptResponse (200 OK):
{
"success": true,
"notes": [
{
"id": "note_abc123",
"title": "JavaScript Async/Await",
"content": "Learn how to use async/await for promises...",
"notebookId": "nb_abc123",
"isFavorite": true,
"isDeleted": false,
"createdAt": "2025-12-18T10:00:00.000Z",
"updatedAt": "2025-12-18T15:30:00.000Z"
}
]
}Retrieves all favorite notes for the authenticated user.
Authentication: Requires Appwrite session.
Response (200 OK):
{
"success": true,
"favorites": [
{
"id": "note_abc123",
"title": "Important Meeting Notes",
"content": "Discussion points...",
"notebookId": "nb_abc123",
"isFavorite": true,
"createdAt": "2025-12-18T10:00:00.000Z"
}
]
}Retrieves all deleted notes (trash) for the authenticated user.
Authentication: Requires Appwrite session.
Response (200 OK):
{
"success": true,
"trash": [
{
"id": "note_abc123",
"title": "Deleted Note",
"content": "This note was deleted...",
"notebookId": "nb_abc123",
"isDeleted": true,
"deletedAt": "2025-12-18T14:00:00.000Z"
}
]
}Creates a new note.
Authentication: Requires Appwrite session.
Request Body:
{
"title": "My First Note",
"content": "This is the content of my note",
"notebookId": "nb_abc123"
}Response (201 Created):
{
"success": true,
"message": "Note created successfully",
"note": {
"id": "note_abc123",
"title": "My First Note",
"content": "This is the content of my note",
"notebookId": "nb_abc123",
"isFavorite": false,
"createdAt": "2025-12-18T10:00:00.000Z"
}
}Updates a specific note.
Authentication: Requires Appwrite session.
Path Parameters:
noteId- The Appwrite Document ID of the note
Request Body:
{
"title": "Updated Title",
"content": "Updated content here",
"notebookId": "nb_abc123"
}Response (200 OK):
{
"success": true,
"message": "Note updated successfully",
"note": {
"id": "note_abc123",
"title": "Updated Title",
"content": "Updated content here",
"notebookId": "nb_abc123",
"updatedAt": "2025-12-18T15:30:00.000Z"
}
}Soft deletes a note (moves to trash).
Authentication: Requires Appwrite session.
Path Parameters:
noteId- The Appwrite Document ID of the note
Response (200 OK):
{
"success": true,
"message": "Note moved to trash successfully"
}Restores a deleted note from trash.
Authentication: Requires Appwrite session.
Path Parameters:
noteId- The Appwrite Document ID of the note
Response (200 OK):
{
"success": true,
"message": "Note restored successfully",
"note": {
"id": "note_abc123",
"title": "Restored Note",
"isDeleted": false
}
}Permanently deletes a note (cannot be recovered).
Authentication: Requires Appwrite session.
Path Parameters:
noteId- The Appwrite Document ID of the note
Response (200 OK):
{
"success": true,
"message": "Note permanently deleted successfully"
}Toggles the favorite status of a note.
Authentication: Requires Appwrite session.
Path Parameters:
noteId- The Appwrite Document ID of the note
Request Body:
{
"isFavorite": true
}Response (200 OK):
{
"success": true,
"message": "Favorite status updated",
"isFavorite": true
}The API uses standard HTTP status codes.
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request succeeded. |
| 201 | Created | Resource successfully created. |
| 400 | Bad Request | Missing required fields, invalid JSON, or validation error. |
| 401 | Unauthorized | Invalid or missing session. User must sign in. |
| 403 | Forbidden | User does not have permission to access this resource. |
| 404 | Not Found | The requested resource does not exist. |
| 409 | Conflict | Resource already exists (e.g., duplicate notebook name). |
| 413 | Payload Too Large | Request body size exceeds allowed limit. |
| 429 | Too Many Requests | Rate limit exceeded. Retry after the specified time. |
| 500 | Server Error | Internal server error. Database or external service failure. |
| 503 | Service Unavailable | External service temporarily unavailable. |
All error responses follow a consistent format:
{
"success": false,
"error": "ErrorType",
"message": "Human-readable error description"
}Example Errors:
Missing Required Field:
{
"success": false,
"error": "ValidationError",
"message": "title is required"
}Resource Not Found:
{
"success": false,
"error": "ResourceNotFound",
"message": "Note with ID note_abc123 does not exist"
}Unauthorized:
{
"success": false,
"error": "Unauthorized",
"message": "You must be signed in to access this resource"
}Insufficient Permissions:
{
"success": false,
"error": "Forbidden",
"message": "You do not have permission to modify this note"
}(Planned for future implementation)
Proposed Limits:
- Standard Endpoints: 100 requests per minute per user
- Create Note Endpoint: 30 notes per minute per user
- Bulk Operations: 10 operations per minute per user
Headers (Future):
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1702991400
(Planned for future implementation)
Current endpoints return all applicable items. Future versions will support pagination for large note lists.
Query Parameters (future):
limit(number) - Items per page (default: 50, max: 100)page(number) - Page number (1-indexed)cursor(string) - Cursor for pagination of large datasets
Response Meta (future):
{
"data": [...],
"meta": {
"total": 250,
"page": 1,
"limit": 50,
"hasMore": true,
"nextCursor": "cursor_xyz"
}
}(Planned for future implementation)
Future support for notifications:
note.created- Triggered when a note is creatednote.updated- Triggered when a note is modifiednote.deleted- Triggered when a note is permanently deletednotebook.created- Triggered when a notebook is createduser.profile_updated- Triggered when user profile changes
- PRD.md - Product requirements and user stories
- ARCHITECTURE.md - System architecture and technical design
- DEPLOYMENT.md - Deployment and operations guide
- README.md - Project overview and quick start