-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathopenapi.yaml
More file actions
5350 lines (5115 loc) · 166 KB
/
Copy pathopenapi.yaml
File metadata and controls
5350 lines (5115 loc) · 166 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
openapi: 3.0.3
info:
title: cix-server API
version: v1
description: |
HTTP API for the `cix-server` semantic code-index daemon.
The wire format is byte-stable across server versions; the `api_version`
field in `/api/v1/status` ticks independently from `server_version` when
a backwards-incompatible change lands.
## Authentication
Two parallel auth paths back the same identity model:
- **Browsers / dashboard**: `POST /api/v1/auth/login` with email +
password issues an HttpOnly cookie `cix_session`. The cookie is sent
automatically on subsequent same-origin requests. Sessions roll
forward 14 days from the last request.
- **CLI / SDK**: `Authorization: Bearer <api_key>` where the key was
issued by `POST /api/v1/api-keys`. Keys are owner-scoped and can be
revoked individually without affecting other clients.
Public endpoints (no auth required): `GET /health`, `GET /docs`,
`GET /openapi.yaml`, `GET /api/v1/auth/bootstrap-status`,
`POST /api/v1/auth/login`. Setting `CIX_AUTH_DISABLED=true` skips the
check on every endpoint (development only — a warning is logged).
When the server starts with an empty users table it requires
`CIX_BOOTSTRAP_ADMIN_EMAIL` + `CIX_BOOTSTRAP_ADMIN_PASSWORD` to seed
the first admin (forced to change password on first login). A legacy
`CIX_API_KEY` set on a fresh database is imported as a single
`env-bootstrap` API key owned by that admin.
## Project addressing
Project `host_path` values contain slashes that cannot be embedded in
URL segments cleanly, so project-scoped endpoints take a `{path}` URL
parameter that is the **first 16 hex chars of `SHA1(host_path)`**.
Compute it with `internal/projects.HashPath`.
## Streaming indexing
`POST /api/v1/projects/{path}/index/files` honours the `Accept` header:
sending `Accept: application/x-ndjson` switches the response to a
newline-delimited stream of `IndexProgressEvent` objects, with a
`heartbeat` event every 10 seconds. Old clients that send no Accept
header (or `application/json`) get the legacy single-JSON response.
## Errors
All error responses use the same body shape: `{"detail": "<message>"}`.
`GET /health` is the only exception — the unhealthy variant additionally
carries `{"reason": "..."}`.
servers:
# Relative URL — Swagger UI's "Try it out" sends requests to whatever
# origin served /openapi.json, so localhost:8001, localhost:21847, and a
# remote deployment all just work without CORS preflight surprises.
- url: /
description: Same-origin (auto-detected from the URL serving this spec)
security:
- bearerAuth: []
tags:
- name: probe
description: Health and status probes
- name: projects
description: Project lifecycle (CRUD)
- name: search
description: Symbol, definition, reference, file, and semantic search
- name: indexing
description: Three-phase indexing protocol
- name: docs
description: API documentation
- name: auth
description: Sessions, login/logout, password change, current user
- name: admin
description: Admin-only user management
- name: api-keys
description: Issue and revoke owner-scoped API keys for CLI/SDK use
- name: workspaces
description: |
Workspaces group GitHub repositories for cross-project semantic search.
Server-wide shared — every authenticated user can list, create, and
modify any workspace. PR1 ships CRUD only; repository attachment,
webhooks, and the two-stage search endpoint land in subsequent
releases of the workspaces feature branch.
- name: groups
description: |
View-groups: admin-managed sets of users. External projects and
workspaces are shared to a group, granting its members read/search
access. Group CRUD and membership are admin-only; GET /groups is
member-scoped for regular users so the share picker can populate.
- name: github-tokens
description: |
GitHub Personal Access Tokens used by the workspaces feature for
cloning private repos and (optionally) registering webhooks. Stored
encrypted-at-rest via AES-GCM; the plaintext is surfaced exactly
once on POST and never returned thereafter.
- name: tunnels
description: |
Managed Tunnels — a server-orchestrated outbound tunnel that gives
the server a public URL while it sits behind NAT. Cloudflare Tunnel
ships now; ngrok is reserved. The live tunnel URL is the preferred
origin for GitHub webhook delivery URLs.
paths:
/health:
get:
operationId: getHealth
tags: [probe]
summary: Liveness probe (public)
description: |
Returns `{"status":"ok"}` when the server can reach SQLite within 1
second. Returns 503 with `{"status":"unhealthy","reason":"..."}` when
the DB ping fails. Public — no `Authorization` header required.
security: []
responses:
"200":
description: Server is healthy
content:
application/json:
schema:
$ref: "#/components/schemas/HealthResponse"
"503":
description: Server is unhealthy (e.g. DB unreachable)
content:
application/json:
schema:
$ref: "#/components/schemas/HealthResponse"
/api/v1/status:
get:
operationId: getStatus
tags: [probe]
summary: Server / sidecar status (authenticated)
description: |
Returns server metadata: version, configured embedding model, whether
the llama-server sidecar is reachable (`model_loaded`), number of
registered projects, and number of currently-running indexing jobs.
responses:
"200":
description: Status payload
content:
application/json:
schema:
$ref: "#/components/schemas/StatusResponse"
"401":
$ref: "#/components/responses/Unauthorized"
/api/v1/auth/bootstrap-status:
get:
operationId: getBootstrapStatus
tags: [auth]
summary: Whether the dashboard needs first-run bootstrap (public)
description: |
Returns `{"needs_bootstrap": true}` when the users table is empty.
The dashboard renders an explanatory screen in that case ("ask the
operator to deploy with CIX_BOOTSTRAP_ADMIN_* env vars and
restart"). No authentication required.
security: []
responses:
"200":
description: Bootstrap status
content:
application/json:
schema:
$ref: "#/components/schemas/BootstrapStatusResponse"
/api/v1/auth/login:
post:
operationId: login
tags: [auth]
summary: Exchange email + password for a session cookie (public)
description: |
On success, sets `Set-Cookie: cix_session=<id>; HttpOnly;
SameSite=Strict; Path=/`. Returns the user payload plus a
`must_change_password` flag — when true, the dashboard forces a
change-password screen before any other action.
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/LoginRequest"
responses:
"200":
description: Logged in
headers:
Set-Cookie:
schema:
type: string
description: Session cookie (HttpOnly, SameSite=Strict)
content:
application/json:
schema:
$ref: "#/components/schemas/LoginResponse"
"401":
$ref: "#/components/responses/Unauthorized"
"422":
$ref: "#/components/responses/Unprocessable"
/api/v1/auth/logout:
post:
operationId: logout
tags: [auth]
summary: End the current session
description: |
Deletes the server-side session row and instructs the browser to
clear `cix_session` via `Set-Cookie: cix_session=; Max-Age=0`.
responses:
"204":
description: Session ended
"401":
$ref: "#/components/responses/Unauthorized"
/api/v1/auth/me:
get:
operationId: getMe
tags: [auth]
summary: Current authenticated user
description: |
Returns the user attached to the active session OR API key.
Includes `must_change_password` so the dashboard knows whether to
gate further navigation behind a change-password screen.
responses:
"200":
description: Current user
content:
application/json:
schema:
$ref: "#/components/schemas/MeResponse"
"401":
$ref: "#/components/responses/Unauthorized"
/api/v1/auth/change-password:
post:
operationId: changePassword
tags: [auth]
summary: Change the current user's password
description: |
Verifies `current_password`, updates to `new_password`, clears
`must_change_password`, and revokes every other session of this
user (the cookie carrying the change-password request is kept
alive). Does NOT touch API keys — those are revoked individually.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ChangePasswordRequest"
responses:
"204":
description: Password updated
"401":
$ref: "#/components/responses/Unauthorized"
"422":
$ref: "#/components/responses/Unprocessable"
/api/v1/auth/sessions:
get:
operationId: listMySessions
tags: [auth]
summary: Active sessions of the current user
description: |
Returns every non-expired session of the caller, newest-first, with
`last_seen_at`, `last_seen_ip`, and `last_seen_ua` so the user can
spot unfamiliar logins. The `is_current` flag marks the session
carrying this request.
responses:
"200":
description: Session list
content:
application/json:
schema:
$ref: "#/components/schemas/SessionListResponse"
"401":
$ref: "#/components/responses/Unauthorized"
/api/v1/auth/sessions/{id}:
delete:
operationId: deleteMySession
tags: [auth]
summary: End one of my sessions (sign out a single device)
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
"204":
description: Session ended
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
/api/v1/admin/users:
get:
operationId: listUsers
tags: [admin]
summary: List all users (admin only)
responses:
"200":
description: User list
content:
application/json:
schema:
$ref: "#/components/schemas/UserListResponse"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
post:
operationId: createUser
tags: [admin]
summary: Invite a new user (admin only)
description: |
The admin sets an `initial_password` and shares it out-of-band.
The new user is flagged `must_change_password=true` and will be
forced to change it on first login.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateUserRequest"
responses:
"201":
description: Created
content:
application/json:
schema:
$ref: "#/components/schemas/User"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"409":
$ref: "#/components/responses/Conflict"
"422":
$ref: "#/components/responses/Unprocessable"
/api/v1/admin/users/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
patch:
operationId: updateUser
tags: [admin]
summary: Change role or disabled flag (admin only)
description: |
Refuses to demote or disable the last enabled admin in the system.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateUserRequest"
responses:
"200":
description: Updated
content:
application/json:
schema:
$ref: "#/components/schemas/User"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"422":
$ref: "#/components/responses/Unprocessable"
delete:
operationId: deleteUser
tags: [admin]
summary: Delete a user (admin only)
description: |
Cascades to the user's sessions and API keys. Refuses to delete
the last enabled admin.
responses:
"204":
description: Deleted
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
/api/v1/admin/users/{id}/reset-password:
parameters:
- name: id
in: path
required: true
schema:
type: string
post:
operationId: resetUserPassword
tags: [admin]
summary: Reset a user's password (admin only)
description: |
Sets a new admin-chosen temporary password and forces the user to
change it on next login (must_change_password=true), mirroring the
invite flow. Any admin may reset any user, including another admin.
The target user's existing sessions are revoked.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ResetUserPasswordRequest"
responses:
"200":
description: Password reset
content:
application/json:
schema:
$ref: "#/components/schemas/User"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"422":
$ref: "#/components/responses/Unprocessable"
/api/v1/admin/login-locks:
get:
operationId: listLoginLocks
tags: [admin]
summary: List active login rate-limit locks (admin only)
description: |
Returns the in-memory login-limiter counters that are currently at or
over their threshold — the IPs and (IP, email) pairs a login would be
rejected for right now with 429. State is per-process and self-heals as
the sliding windows expire, so this is a point-in-time snapshot.
responses:
"200":
description: Active locks
content:
application/json:
schema:
$ref: "#/components/schemas/LoginLockListResponse"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
/api/v1/admin/login-locks/reset:
post:
operationId: resetLoginLock
tags: [admin]
summary: Clear a login rate-limit lock (admin only)
description: |
Lifts a single lock surfaced by `GET /admin/login-locks`. `type` picks
the counter: `ip` clears the per-IP horizontal-sweep counter; `ip_email`
clears the per-(IP, email) counter for one account. The admin selects
the exact row to clear — the server never clears across keys.
Idempotent: clearing a key that is no longer locked returns 204.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ResetLoginLockRequest"
responses:
"204":
description: Lock cleared (or already absent)
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"422":
$ref: "#/components/responses/Unprocessable"
/api/v1/admin/runtime-config:
get:
operationId: getRuntimeConfig
tags: [admin]
summary: Read effective runtime config (admin only)
description: |
Returns the resolved runtime config (DB row → env → recommended) the
sidecar is currently configured against, plus a `source` map labelling
each field's origin so the dashboard can render the "DB" / "Env" /
"Recommended" pill next to every value.
responses:
"200":
description: Effective runtime config
content:
application/json:
schema:
$ref: "#/components/schemas/RuntimeConfig"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
put:
operationId: putRuntimeConfig
tags: [admin]
summary: Save runtime config overrides (admin only)
description: |
Replaces the runtime_settings row. Fields omitted from the request
clear their override (= fall back to env / recommended on next Get).
Does NOT restart the sidecar — the dashboard issues a separate
POST /admin/sidecar/restart after a successful PUT.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/RuntimeConfigUpdate"
responses:
"200":
description: Updated config
content:
application/json:
schema:
$ref: "#/components/schemas/RuntimeConfig"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"422":
$ref: "#/components/responses/Unprocessable"
/api/v1/admin/sidecar/restart:
post:
operationId: restartSidecar
tags: [admin]
summary: Restart the llama-server sidecar (admin only)
description: |
Drains the embedding queue (30s timeout), terminates the current
child process, and respawns with the latest runtime config.
Returns 202 immediately; poll GET /admin/sidecar/status to observe
the running → restarting → running transition. In-flight indexing
batches at the moment of restart will fail with ErrSupervisor and
must be re-driven by the operator (`cix reindex <project>`).
responses:
"202":
description: Restart accepted
content:
application/json:
schema:
$ref: "#/components/schemas/RestartAccepted"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"503":
description: Embeddings disabled at boot — restart is a no-op
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/api/v1/admin/sidecar/status:
get:
operationId: getSidecarStatus
tags: [admin]
summary: Sidecar process status (admin only)
responses:
"200":
description: Status snapshot
content:
application/json:
schema:
$ref: "#/components/schemas/SidecarStatus"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
/api/v1/admin/models:
get:
operationId: listModels
tags: [admin]
summary: List GGUF model files cached on disk (admin only)
description: |
Walks `CIX_GGUF_CACHE_DIR` and returns one entry per .gguf file. Used
by the dashboard's embedding-model picker so admins don't have to
type HF repo IDs by hand. Empty list when the cache is empty —
dashboard falls back to a free-text path input in that case.
responses:
"200":
description: Cached model list
content:
application/json:
schema:
$ref: "#/components/schemas/ModelList"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
/api/v1/admin/embedding-providers:
get:
operationId: listEmbeddingProviders
tags: [admin]
summary: List registered embedding-provider kinds (admin only)
description: |
Returns one entry per registered provider kind with its config
schema and the names of the env vars it reads for credentials,
plus whether those env vars are currently set on the server.
The dashboard uses this to render the kind dropdown, the
per-kind form, and the "set CIX_VOYAGE_API_KEY before saving"
banner when a key is missing.
responses:
"200":
description: List of registered providers
content:
application/json:
schema:
$ref: "#/components/schemas/EmbeddingProviderList"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
/api/v1/admin/embedding-providers/active:
get:
operationId: getActiveEmbeddingProvider
tags: [admin]
summary: Get the currently active embedding provider (admin only)
description: |
Returns the persisted provider selection (kind + JSON config
blob) and the live `Provider.ID()` fingerprint. API keys are
never persisted, so the config blob carries env-var NAMES
only — safe to surface to admin clients verbatim.
responses:
"200":
description: Currently active provider
content:
application/json:
schema:
$ref: "#/components/schemas/ActiveEmbeddingProvider"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"503":
description: Embeddings service not wired (e.g. CIX_EMBEDDINGS_ENABLED=false)
put:
operationId: switchEmbeddingProvider
tags: [admin]
summary: Switch to a different embedding provider (admin only)
description: |
Atomic switch. The server validates the submitted config, persists
it, then swaps the live Service over (drains the queue first).
On any error the existing provider stays untouched.
Switching changes the active `Provider.ID()` fingerprint; every
project's `indexed_with_model` becomes stale and the next
clone job per project triggers a full reindex
(`mode=full, reason=model-change`).
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/SwitchEmbeddingProviderRequest"
responses:
"202":
description: Switch accepted; new provider is live
content:
application/json:
schema:
$ref: "#/components/schemas/ActiveEmbeddingProvider"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
/api/v1/admin/embedding-providers/{kind}/test:
post:
operationId: testEmbeddingProvider
tags: [admin]
summary: Validate an embedding-provider config without persisting (admin only)
description: |
Builds a throw-away provider from the submitted config, calls
Start (one short embed for HTTP providers; spawning a child for
ollama), then Stops it. Returns the detected dimension and an
ok flag. Use this from the dashboard before calling PUT
/embedding-providers/active so the admin sees an actionable
error (bad key, wrong URL, missing env var) before the swap.
parameters:
- name: kind
in: path
required: true
schema:
type: string
enum: [ollama, openai, voyage]
requestBody:
required: true
content:
application/json:
schema:
type: object
description: Provider-specific config blob (shape varies by kind).
additionalProperties: true
responses:
"200":
description: Connect test succeeded
content:
application/json:
schema:
$ref: "#/components/schemas/TestEmbeddingProviderResponse"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"502":
description: |
Connect test failed against the upstream service (auth
rejected, network unreachable, etc).
/api/v1/api-keys:
get:
operationId: listApiKeys
tags: [api-keys]
summary: List my API keys (or all keys if admin)
parameters:
- name: owner
in: query
required: false
description: |
`all` — admin-only, returns every key in the system.
Anything else (or unset) returns the caller's keys.
schema:
type: string
enum: [all]
responses:
"200":
description: Key list
content:
application/json:
schema:
$ref: "#/components/schemas/ApiKeyListResponse"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
post:
operationId: createApiKey
tags: [api-keys]
summary: Issue a new API key
description: |
Returns the **plaintext** `full_key` exactly once in the response.
The dashboard shows it with a copy button and a "this is the only
time you will see this value" warning. Subsequent reads only
return the `prefix`.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateApiKeyRequest"
responses:
"201":
description: Key created
content:
application/json:
schema:
$ref: "#/components/schemas/ApiKeyCreated"
"401":
$ref: "#/components/responses/Unauthorized"
"422":
$ref: "#/components/responses/Unprocessable"
/api/v1/api-keys/{id}:
delete:
operationId: revokeApiKey
tags: [api-keys]
summary: Revoke an API key
description: |
The owner can revoke their own keys. An admin can revoke any
key. Revoking is permanent — the row stays in the table marked
with `revoked_at` so the audit trail is preserved, but
subsequent Bearer auth attempts with the value fail with 401.
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
"204":
description: Revoked
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
/api/v1/projects:
post:
operationId: createProject
tags: [projects]
summary: Register a new project
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateProjectRequest"
responses:
"201":
description: Project created
content:
application/json:
schema:
$ref: "#/components/schemas/Project"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
description: |
The caller's account has `local_project_disabled=true`
(cannot create local projects). Admins are exempt.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"409":
description: A project with this `host_path` already exists
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"422":
$ref: "#/components/responses/Unprocessable"
"500":
$ref: "#/components/responses/InternalError"
get:
operationId: listProjects
tags: [projects]
summary: List all registered projects
responses:
"200":
description: Project list
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectListResponse"
"401":
$ref: "#/components/responses/Unauthorized"
"500":
$ref: "#/components/responses/InternalError"
/api/v1/projects/{path}:
parameters:
- $ref: "#/components/parameters/ProjectHash"
get:
operationId: getProject
tags: [projects]
summary: Get one project by hash
responses:
"200":
description: Project
content:
application/json:
schema:
$ref: "#/components/schemas/Project"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
"500":
$ref: "#/components/responses/InternalError"
patch:
operationId: updateProject
tags: [projects]
summary: Patch project settings (admin only)
description: |
Admin-only. Settings changes can shrink the indexing surface
(exclude_patterns, max_file_size); viewers must not be able to
silently de-index a project.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateProjectRequest"
responses:
"200":
description: Updated project
content:
application/json:
schema:
$ref: "#/components/schemas/Project"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"422":
$ref: "#/components/responses/Unprocessable"
"500":
$ref: "#/components/responses/InternalError"
delete:
operationId: deleteProject
tags: [projects]
summary: Delete a project and all its indexed data (admin only)
description: |
Admin-only. Drops the project plus its symbols, refs, file hashes,
and embeddings. Destructive enough that viewer-scoped sessions and
API keys must not reach it.
responses:
"204":
description: Deleted (no body)
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"500":
$ref: "#/components/responses/InternalError"
/api/v1/projects/{path}/summary:
parameters:
- $ref: "#/components/parameters/ProjectHash"
get:
operationId: getProjectSummary
tags: [projects]
summary: Project overview (top dirs, recent symbols, totals)
responses:
"200":
description: Summary
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectSummary"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
"500":
$ref: "#/components/responses/InternalError"
/api/v1/projects/{path}/workspaces:
parameters:
- $ref: "#/components/parameters/ProjectHash"
get:
operationId: listProjectWorkspaces
tags: [projects]
summary: List workspaces that contain this project
description: |
Returns every workspace that has this project attached, owned or
linked. The project page uses this to show "Workspaces" chips
the user can click to jump to the workspace detail page.
Empty list when the project isn't part of any workspace yet —
either it was indexed directly via /projects without ever being
linked, or all its memberships have been detached.
responses:
"200":
description: Memberships
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectWorkspaceList"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
"500":
$ref: "#/components/responses/InternalError"
/api/v1/projects/{path}/search:
parameters:
- $ref: "#/components/parameters/ProjectHash"
post:
operationId: semanticSearch
tags: [search]
summary: Semantic (vector) search
description: |
Embeds the query and runs an approximate nearest-neighbour search
against the project's chromem-go collection. Results are
post-filtered by `min_score`, `paths` (whitelist, prefix-OR-substring
match), `excludes` (blacklist, same matching), and `languages` —
then merged into per-file groups and ranked by best match score.
`min_score` semantics:
- omitted → server default `0.2` (light relevance floor that
doesn't silently drop abstract natural-language queries