-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPI_DOCUMENTATION.txt
More file actions
1123 lines (993 loc) · 28.3 KB
/
API_DOCUMENTATION.txt
File metadata and controls
1123 lines (993 loc) · 28.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ============================================================================
// Sereni-Base API Documentation
// Complete API endpoints with TypeScript request/response interfaces
// ============================================================================
// ============================================================================
// AUTH ENDPOINTS - /api/v1/auth
// ============================================================================
/**
* POST /api/v1/auth/login
* Public endpoint - No authentication required
* Description: Login with email and password
*/
interface AuthLoginRequest {
email: string; // user email address (required, email format)
password: string; // user password (required, min 8 characters)
}
interface AuthLoginResponse {
user: UserResponse;
token: {
access_token: string; // JWT access token
refresh_token: string; // JWT refresh token
};
}
/**
* POST /api/v1/auth/otp/verify
* Public endpoint - No authentication required
* Description: Verify email with OTP
*/
interface AuthVerifyEmailRequest {
token: string; // JWT token (required)
otp: string; // One-time password (required, 6 digits)
}
/**
* POST /api/v1/auth/otp/resend
* Public endpoint - No authentication required
* Description: Resend OTP
*/
interface AuthResendOTPRequest {
token: string; // JWT token (required)
}
/**
* POST /api/v1/auth/forgot-password
* Public endpoint - No authentication required
* Description: Request password reset
*/
interface AuthForgotPasswordRequest {
email: string; // user email (required, email format)
}
interface AuthForgotPasswordResponse {
message: string; // Success message
}
/**
* POST /api/v1/auth/reset-password
* Public endpoint - No authentication required
* Description: Reset password with token
*/
interface AuthResetPasswordRequest {
token: string; // Reset token UUID (required)
new_password: string; // New password (required, min 8 characters)
}
/**
* POST /api/v1/auth/validate-token
* Public endpoint
* Description: Validate if token is valid
*/
interface AuthValidateTokenRequest {
token: string; // JWT token (required)
}
/**
* POST /api/v1/auth/verify-token
* Public endpoint
* Description: Verify token validity
*/
interface AuthVerifyTokenRequest {
token: string; // JWT token (required)
}
/**
* POST /api/v1/auth/logout
* Protected endpoint - Requires authentication
* Description: Logout and invalidate token
*/
interface AuthLogoutRequest {
token: string; // JWT token (required)
}
// ============================================================================
// USER MANAGEMENT ENDPOINTS - /api/v1/user
// ============================================================================
/**
* GET /api/v1/user/profile/:id
* Protected endpoint - Requires authentication
* Description: Get user profile by ID
*/
interface UserProfileResponse {
id: string; // User UUID
email: string;
first_name: string;
last_name: string;
status: string; // active, inactive, suspended
email_verified: boolean;
dob?: string; // Date of birth (YYYY-MM-DD)
country?: string;
timezone?: string;
created_at: string; // ISO 8601 timestamp
updated_at: string;
roles?: string[]; // List of roles assigned
}
/**
* PATCH /api/v1/user/profile/:id
* Protected endpoint - Requires authentication
* Description: Update user profile
*/
interface UserUpdateProfileRequest {
first_name?: string;
last_name?: string;
dob?: string; // Date of birth (YYYY-MM-DD)
country?: string;
timezone?: string;
}
/**
* POST /api/v1/user/change-password/:id
* Protected endpoint - Requires authentication
* Description: Change user password
*/
interface UserChangePasswordRequest {
current_password: string; // Current password (required)
new_password: string; // New password (required, min 8 chars)
}
/**
* POST /api/v1/user/profile/:id/avatar
* Protected endpoint - Requires authentication
* Description: Add user avatar (multipart/form-data)
*/
interface UserAddAvatarRequest {
// File upload as multipart/form-data with field name 'file'
file: File; // Image file (max 5MB based on config)
}
/**
* DELETE /api/v1/user/profile/:id/avatar
* Protected endpoint - Requires authentication
* Description: Remove user avatar
*/
/**
* GET /api/v1/user/workspaces
* Protected endpoint - Requires authentication
* Description: Get all workspaces for current user
*/
interface UserWorkspacesResponse {
id: string;
title: string;
description?: string;
slug: string;
status: string;
created_at: string;
}[]
/**
* GET /api/v1/user/access-details
* Protected endpoint - Requires authentication
* Description: Get detailed access information for user
*/
interface UserAccessDetailsResponse {
user_id: string;
workspaces: Array<{
workspace_id: string;
workspace_name: string;
role: string;
access_level: string;
bases: Array<{
base_id: string;
base_name: string;
role: string;
access_level: string;
}>;
}>;
}
/**
* POST /api/v1/user/assign
* Protected endpoint - Requires authentication (Admin/Owner)
* Description: Assign user to workspace
*/
interface UserAssignRequest {
user_id: string; // User UUID (required)
workspace_id: string; // Workspace UUID (required)
role: string; // Role name (required)
access_level?: string; // Access level (optional)
}
/**
* PUT /api/v1/user/access/update
* Protected endpoint - Requires authentication
* Description: Update user access permissions
*/
interface UserUpdateAccessRequest {
user_id: string; // User UUID (required)
workspace_id: string; // Workspace UUID (required)
role: string; // New role name (required)
access_level?: string; // New access level (optional)
}
/**
* POST /api/v1/user/create
* Protected endpoint - Requires authentication (Tenant Admin)
* Description: Create new user
*/
interface UserCreateRequest {
email: string; // Email (required, unique)
first_name: string; // First name (required)
last_name: string; // Last name (required)
password?: string; // Password (optional, generated if not provided)
dob?: string; // Date of birth (YYYY-MM-DD)
country?: string;
timezone?: string;
}
interface UserCreateResponse extends UserProfileResponse {
temporary_password?: string; // If password was generated
}
/**
* POST /api/v1/user/remove
* Protected endpoint - Requires authentication (Tenant Admin)
* Description: Remove/delete user
*/
interface UserRemoveRequest {
user_id: string; // User UUID (required)
}
/**
* POST /api/v1/user/activate
* Protected endpoint - Requires authentication (Tenant Admin)
* Description: Activate user account
*/
interface UserActivateRequest {
user_id: string; // User UUID (required)
}
/**
* POST /api/v1/user/deactivate
* Protected endpoint - Requires authentication (Tenant Admin)
* Description: Deactivate user account
*/
interface UserDeactivateRequest {
user_id: string; // User UUID (required)
}
/**
* GET /api/v1/user/list
* Protected endpoint - Requires authentication (Tenant Admin)
* Description: Get all users in tenant
*/
interface UserListResponse extends UserProfileResponse {}[]
/**
* GET /api/v1/user/list-for-assign
* Protected endpoint - Requires authentication
* Description: Get active users available for assignment
*/
// ============================================================================
// WORKSPACE ENDPOINTS - /api/v1/workspace
// ============================================================================
/**
* POST /api/v1/workspace/create
* Protected endpoint - Requires authentication
* Description: Create new workspace
*/
interface WorkspaceCreateRequest {
title: string; // Workspace title (required)
description?: string; // Workspace description (optional)
created_by?: string; // Creator user ID (optional, auto-set)
}
interface WorkspaceResponse {
id: string; // UUID
title: string;
description?: string;
slug: string;
meta?: Record<string, any>;
is_default: boolean;
status: string; // active, inactive
created_by: string;
created_at: string; // ISO 8601
updated_at: string;
}
/**
* GET /api/v1/workspace/
* Protected endpoint - Requires authentication
* Description: Get all workspaces
*/
interface WorkspaceListResponse extends WorkspaceResponse {}[]
/**
* GET /api/v1/workspace/:id
* Protected endpoint - Requires authentication
* Description: Get workspace by ID
*/
/**
* PUT /api/v1/workspace/:id
* Protected endpoint - Requires authentication (Admin)
* Description: Update workspace
*/
interface WorkspaceUpdateRequest {
title?: string;
description?: string;
slug?: string;
meta?: Record<string, any>;
is_default?: boolean;
status?: string;
}
/**
* DELETE /api/v1/workspace/:id
* Protected endpoint - Requires authentication (Admin)
* Description: Delete workspace
*/
/**
* GET /api/v1/workspace/:id/tables
* Protected endpoint - Requires authentication
* Description: Get all tables in workspace
*/
interface WorkspaceTablesResponse {
id: string;
name: string;
description?: string;
base_id: string;
created_at: string;
}[]
/**
* GET /api/v1/workspace/:id/bases
* Protected endpoint - Requires authentication
* Description: Get all bases in workspace
*/
interface WorkspaceBasesResponse {
id: string;
title: string;
description?: string;
status: string;
created_at: string;
}[]
/**
* POST /api/v1/workspace/:id/remove
* Protected endpoint - Requires authentication (Admin)
* Description: Remove user from workspace
*/
interface WorkspaceRemoveUserRequest {
user_id: string; // User UUID (required)
}
/**
* GET /api/v1/workspace/:id/members
* Protected endpoint - Requires authentication
* Description: Get workspace members
*/
interface WorkspaceMember {
id: string;
user_id: string;
email: string;
first_name: string;
last_name: string;
role: string;
access_level: string;
status: string;
}
interface WorkspaceMembersResponse extends WorkspaceMember {}[]
/**
* GET /api/v1/workspace/:id/members-with-roles
* Protected endpoint - Requires authentication
* Description: Get members with detailed role information
*/
interface WorkspaceMemberWithRole extends WorkspaceMember {
role_details?: {
name: string;
description?: string;
permissions: string[];
};
}
interface WorkspaceMembersWithRolesResponse extends WorkspaceMemberWithRole {}[]
/**
* POST /api/v1/workspace/:id/bulk-add-members
* Protected endpoint - Requires authentication (Admin)
* Description: Add multiple members to workspace
*/
interface WorkspaceBulkAddMembersRequest {
members: Array<{
user_id: string; // User UUID (required)
role: string; // Role name (required)
access_level?: string;
}>;
}
// ============================================================================
// BASE ENDPOINTS - /api/v1/base
// ============================================================================
/**
* POST /api/v1/base/create
* Protected endpoint - Requires authentication
* Description: Create new base (database)
*/
interface BaseCreateRequest {
title: string; // Base title (required)
description?: string; // Base description (optional)
workspace_id?: string; // Workspace ID (optional)
}
interface BaseResponse {
id: string; // UUID
title: string;
description?: string;
icon?: string;
status: string;
workspace_id: string;
created_by: string;
created_at: string;
updated_at: string;
}
/**
* GET /api/v1/base/:id
* Protected endpoint - Requires authentication
* Description: Get base by ID
*/
/**
* PUT /api/v1/base/:id
* Protected endpoint - Requires authentication (Admin)
* Description: Update base
*/
interface BaseUpdateRequest {
title?: string;
description?: string;
icon?: string;
status?: string;
}
/**
* DELETE /api/v1/base/:id
* Protected endpoint - Requires authentication (Admin)
* Description: Delete base
*/
/**
* GET /api/v1/base/:id/tables
* Protected endpoint - Requires authentication
* Description: Get all tables in base
*/
/**
* GET /api/v1/base/:id/members
* Protected endpoint - Requires authentication
* Description: Get base members
*/
/**
* GET /api/v1/base/:id/members-with-roles
* Protected endpoint - Requires authentication
* Description: Get members with role details
*/
/**
* POST /api/v1/base/:id/bulk-add-members
* Protected endpoint - Requires authentication (Admin)
* Description: Add multiple members to base
*/
interface BaseBulkAddMembersRequest {
members: Array<{
user_id: string;
role: string;
access_level?: string;
}>;
}
// ============================================================================
// TABLE ENDPOINTS - /api/v1/table
// ============================================================================
/**
* POST /api/v1/table/create
* Protected endpoint - Requires authentication
* Description: Create new table
*/
interface TableCreateRequest {
name: string; // Table name (required)
description?: string;
base_id: string; // Base UUID (required)
columns?: ColumnCreateRequest[];
}
interface ColumnCreateRequest {
name: string; // Column name (required)
type: string; // Data type (required): text, number, email, date, single_select, multiple_select, checkbox, link, lookup, etc.
is_primary?: boolean;
is_required?: boolean;
is_unique?: boolean;
meta?: Record<string, any>; // Type-specific metadata
}
interface TableResponse {
id: string; // UUID
name: string;
description?: string;
base_id: string;
status: string;
created_by: string;
created_at: string;
updated_at: string;
columns?: ColumnResponse[];
record_count?: number;
}
interface ColumnResponse {
id: string;
name: string;
type: string;
is_primary: boolean;
is_required: boolean;
is_unique: boolean;
meta?: Record<string, any>;
}
/**
* GET /api/v1/table/:id
* Protected endpoint - Requires authentication
* Description: Get table by ID with optional pagination
* Query params: page, page_size
*/
/**
* GET /api/v1/table/
* Protected endpoint - Requires authentication
* Description: Get all tables
*/
/**
* PATCH /api/v1/table/:id
* Protected endpoint - Requires authentication
* Description: Update table
*/
interface TableUpdateRequest {
name?: string;
description?: string;
status?: string;
}
/**
* DELETE /api/v1/table/:id
* Protected endpoint - Requires authentication
* Description: Delete table
*/
/**
* POST /api/v1/table/import
* Protected endpoint - Requires authentication
* Description: Import table from CSV/file
*/
interface TableImportRequest {
// Multipart form data with CSV file
file: File;
table_name: string;
base_id: string;
has_headers?: boolean;
}
/**
* GET /api/v1/table/:id/columns
* Protected endpoint - Requires authentication
* Description: Get all columns in table
*/
/**
* GET /api/v1/table/:id/views
* Protected endpoint - Requires authentication
* Description: Get all views for table
*/
/**
* GET /api/v1/table/:id/records
* Protected endpoint - Requires authentication
* Description: Get all records in table
* Query params: page, page_size, filter, sort, search
*/
interface TableRecordsResponse {
total: number;
page: number;
page_size: number;
records: Record<string, any>[];
}
// ============================================================================
// COLUMN ENDPOINTS - /api/v1/column
// ============================================================================
/**
* POST /api/v1/column/create
* Protected endpoint - Requires authentication
* Description: Create new column in table
*/
interface ColumnCreateEndpointRequest {
table_id: string; // Table UUID (required)
name: string; // Column name (required)
type: string; // Data type (required)
is_required?: boolean;
is_unique?: boolean;
meta?: Record<string, any>;
}
/**
* GET /api/v1/column/:id
* Protected endpoint - Requires authentication
* Description: Get column by ID
*/
/**
* GET /api/v1/column/
* Protected endpoint - Requires authentication
* Description: Get all columns
*/
/**
* PATCH /api/v1/column/:id
* Protected endpoint - Requires authentication
* Description: Update column
*/
interface ColumnUpdateRequest {
name?: string;
type?: string;
is_required?: boolean;
is_unique?: boolean;
meta?: Record<string, any>;
}
/**
* DELETE /api/v1/column/:id
* Protected endpoint - Requires authentication
* Description: Delete column
*/
/**
* POST /api/v1/column/reorder
* Protected endpoint - Requires authentication
* Description: Reorder columns in table
*/
interface ColumnReorderRequest {
column_ids: string[]; // Ordered list of column UUIDs
}
// ============================================================================
// ROW ENDPOINTS - /api/v1/row
// ============================================================================
/**
* POST /api/v1/row/create
* Protected endpoint - Requires authentication
* Description: Create new record/row
*/
interface RowCreateRequest {
table_id: string; // Table UUID (required)
data: Record<string, any>; // Column data (column_name: value)
}
interface RowResponse {
id: string; // Row UUID
table_id: string;
data: Record<string, any>;
created_at: string;
updated_at: string;
}
/**
* POST /api/v1/row/remove
* Protected endpoint - Requires authentication
* Description: Delete row(s)
*/
interface RowDeleteRequest {
row_ids: string[]; // Array of row UUIDs to delete
}
/**
* POST /api/v1/row/data/insert
* Protected endpoint - Requires authentication
* Description: Insert row data
*/
interface RowDataInsertRequest {
table_id: string;
row_id?: string;
data: Record<string, any>;
}
/**
* POST /api/v1/row/data/relation
* Protected endpoint - Requires authentication
* Description: Insert relationship/link data between rows
*/
interface RowDataRelationRequest {
from_table_id: string;
from_row_id: string;
to_table_id: string;
to_row_id: string;
relation_type?: string; // one_to_one, one_to_many, many_to_many
}
/**
* POST /api/v1/row/attachment/add
* Protected endpoint - Requires authentication
* Description: Add attachment to row (multipart/form-data)
*/
interface RowAttachmentAddRequest {
model_id: string; // Row UUID (form field)
column_id: string; // Column UUID (form field)
files: File[]; // Multiple files (form field 'files')
}
/**
* POST /api/v1/row/attachment/remove
* Protected endpoint - Requires authentication
* Description: Remove attachment from row
*/
interface RowAttachmentRemoveRequest {
attachment_ids: string[]; // Array of attachment UUIDs
}
// ============================================================================
// VIEW ENDPOINTS - /api/v1/view
// ============================================================================
/**
* POST /api/v1/view/create
* Protected endpoint - Requires authentication
* Description: Create view of table data
*/
interface ViewCreateRequest {
table_id: string; // Table UUID (required)
name: string; // View name (required)
type: string; // grid, calendar, gallery, kanban, timeline
filters?: FilterConfig[];
sort?: SortConfig[];
meta?: Record<string, any>;
}
interface FilterConfig {
column_id: string;
operator: string; // =, !=, <, >, <=, >=, contains, in, etc.
value: any;
}
interface SortConfig {
column_id: string;
direction: 'asc' | 'desc';
}
interface ViewResponse {
id: string;
table_id: string;
name: string;
type: string;
filters?: FilterConfig[];
sort?: SortConfig[];
meta?: Record<string, any>;
created_at: string;
}
/**
* GET /api/v1/view/:id
* Protected endpoint - Requires authentication
* Description: Get view by ID
*/
/**
* GET /api/v1/view/
* Protected endpoint - Requires authentication
* Description: Get all views
*/
/**
* PATCH /api/v1/view/:id
* Protected endpoint - Requires authentication
* Description: Update view
*/
interface ViewUpdateRequest {
name?: string;
type?: string;
filters?: FilterConfig[];
sort?: SortConfig[];
meta?: Record<string, any>;
}
/**
* DELETE /api/v1/view/:id
* Protected endpoint - Requires authentication
* Description: Delete view
*/
// ============================================================================
// ASSET ENDPOINTS - /api/v1/asset
// ============================================================================
/**
* POST /api/v1/asset/upload
* Protected endpoint - Requires authentication
* Description: Upload assets/files (multipart/form-data)
*/
interface AssetUploadRequest {
// Multiple files - form field 'files'
files: File[];
description?: string;
tags?: string[];
}
interface AssetResponse {
id: string; // UUID
filename: string;
original_filename: string;
file_type: string; // mime type
file_size: number; // bytes
url: string; // public URL
storage_path: string;
created_at: string;
}
/**
* POST /api/v1/asset/upload-image
* Protected endpoint - Requires authentication
* Description: Upload single image (optimized)
*/
interface AssetUploadImageRequest {
file: File; // Single image file
optimize?: boolean; // Apply optimization
}
/**
* POST /api/v1/asset/bulk
* Protected endpoint - Requires authentication
* Description: Get multiple assets by IDs
*/
interface AssetBulkRequest {
asset_ids: string[]; // Array of asset UUIDs
}
interface AssetBulkResponse extends AssetResponse {}[]
/**
* PATCH /api/v1/asset/:id
* Protected endpoint - Requires authentication
* Description: Update asset metadata
*/
interface AssetUpdateRequest {
filename?: string;
description?: string;
tags?: string[];
}
/**
* DELETE /api/v1/asset/:id
* Protected endpoint - Requires authentication
* Description: Delete asset
*/
// ============================================================================
// ORGANIZATION ENDPOINTS - /api/v1/organization
// ============================================================================
/**
* GET /api/v1/organization
* Protected endpoint - Requires authentication
* Description: Get all organizations (user is member of)
*/
interface OrganizationResponse {
id: string;
name: string;
slug: string;
description?: string;
logo_url?: string;
status: string;
created_at: string;
updated_at: string;
}
interface OrganizationListResponse extends OrganizationResponse {}[]
/**
* PUT /api/v1/organization/:id
* Protected endpoint - Requires authentication (Admin)
* Description: Update organization
*/
interface OrganizationUpdateRequest {
name?: string;
slug?: string;
description?: string;
logo_url?: string;
status?: string;
}
// ============================================================================
// HEALTH CHECK ENDPOINTS
// ============================================================================
/**
* GET /api/v1/health
* Public endpoint - No authentication required
* Description: Health check endpoint
*/
interface HealthCheckResponse {
status: 'ok';
message: string;
version: string;
features: string[];
}
/**
* GET /api/v1/auth/health
* Public endpoint
* Description: Auth service health check
*/
/**
* GET /api/v1/auth/healthy
* Public endpoint
* Description: Liveness probe
*/
/**
* GET /api/v1/auth/ready
* Public endpoint
* Description: Readiness probe
*/
// ============================================================================
// COMMON RESPONSE WRAPPER
// ============================================================================
/**
* All API responses follow this wrapper format
*/
interface APIResponse<T> {
success: boolean;
message: string;
description?: string;
data?: T;
code?: string; // Error code for failures
timestamp: string; // ISO 8601
}
interface APIErrorResponse {
success: false;
message: string;
description: string;
code: string; // e.g., "AUTH_ERR_1001"
timestamp: string;
details?: Record<string, any>;
}
// ============================================================================
// PAGINATION & FILTERING
// ============================================================================
interface PaginationParams {
page?: number; // Page number (1-indexed)
page_size?: number; // Items per page (default: 20, max: 100)
limit?: number; // Alternative to page_size
offset?: number; // Alternative to page
}
interface PaginatedResponse<T> {
total: number; // Total count
page: number;
page_size: number;
items: T[];
}
interface FilterOperators {
'eq': any; // equals