You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-reference/sourcebot-public.openapi.json
+33-4Lines changed: 33 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,18 @@
3
3
"info": {
4
4
"title": "Sourcebot Public API",
5
5
"version": "v4.16.3",
6
-
"description": "OpenAPI description for the public Sourcebot REST endpoints used for search, repository listing, and file browsing."
6
+
"description": "OpenAPI description for the public Sourcebot REST endpoints used for search, repository listing, and file browsing. Authentication is instance-dependent: API keys are the standard integration mechanism, OAuth bearer tokens are EE-only, and some instances may allow anonymous access."
7
+
7
8
},
9
+
"security": [
10
+
{
11
+
"bearerAuth": []
12
+
},
13
+
{
14
+
"sourcebotApiKey": []
15
+
},
16
+
{}
17
+
],
8
18
"tags": [
9
19
{
10
20
"name": "Search",
@@ -512,8 +522,7 @@
512
522
"properties": {
513
523
"version": {
514
524
"type": "string",
515
-
"description": "Running Sourcebot version.",
516
-
"example": "v4.15.2"
525
+
"description": "Running Sourcebot version."
517
526
}
518
527
},
519
528
"required": [
@@ -657,11 +666,25 @@
657
666
"additionalProperties": false
658
667
}
659
668
},
660
-
"parameters": {}
669
+
"parameters": {},
670
+
"securitySchemes": {
671
+
"bearerAuth": {
672
+
"type": "http",
673
+
"scheme": "bearer",
674
+
"description": "Send either a Sourcebot API key (`sbk_...` or legacy `sourcebot-...`) or, on EE instances with OAuth enabled, an OAuth access token (`sboa_...`) in the Authorization header."
675
+
},
676
+
"sourcebotApiKey": {
677
+
"type": "apiKey",
678
+
"in": "header",
679
+
"name": "X-Sourcebot-Api-Key",
680
+
"description": "Send a Sourcebot API key (`sbk_...` or legacy `sourcebot-...`) in the X-Sourcebot-Api-Key header."
Copy file name to clipboardExpand all lines: docs/docs/api-reference/overview.mdx
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,13 @@ You can fetch the OpenAPI document for your Sourcebot instance from `/api/openap
7
7
8
8
This API reference is generated from the web app's Zod schemas and OpenAPI registry. Mintlify renders it from the checked-in spec at [`/api-reference/sourcebot-public.openapi.json`](/api-reference/sourcebot-public.openapi.json).
9
9
10
+
For authenticated access, create an API key in Sourcebot from **Settings -> API Keys** and send it with either:
11
+
12
+
-`X-Sourcebot-Api-Key: sbk_...`
13
+
-`Authorization: Bearer sbk_...`
14
+
15
+
Some instances may also allow anonymous access for these endpoints. On EE instances with OAuth enabled, bearer tokens with the `sboa_...` prefix are also accepted.
description: 'Send either a Sourcebot API key (`sbk_...` or legacy `sourcebot-...`) or, on EE instances with OAuth enabled, an OAuth access token (`sboa_...`) in the Authorization header.',
53
+
},
54
+
sourcebotApiKey: {
55
+
type: 'apiKey',
56
+
in: 'header',
57
+
name: 'X-Sourcebot-Api-Key',
58
+
description: 'Send a Sourcebot API key (`sbk_...` or legacy `sourcebot-...`) in the X-Sourcebot-Api-Key header.',
@@ -66,6 +80,7 @@ export function createPublicOpenApiDocument(version: string) {
66
80
registry.registerPath({
67
81
method: 'post',
68
82
path: '/api/search',
83
+
operationId: 'search',
69
84
tags: [searchTag.name],
70
85
summary: 'Run a blocking code search',
71
86
request: {
@@ -87,6 +102,7 @@ export function createPublicOpenApiDocument(version: string) {
87
102
registry.registerPath({
88
103
method: 'post',
89
104
path: '/api/stream_search',
105
+
operationId: 'streamSearch',
90
106
tags: [searchTag.name],
91
107
summary: 'Run a streaming code search',
92
108
description: 'Returns a server-sent event stream. Each event data payload is a JSON object describing either a chunk, final summary, or error.',
@@ -113,6 +129,7 @@ export function createPublicOpenApiDocument(version: string) {
113
129
registry.registerPath({
114
130
method: 'get',
115
131
path: '/api/repos',
132
+
operationId: 'listRepositories',
116
133
tags: [reposTag.name],
117
134
summary: 'List repositories',
118
135
request: {
@@ -147,6 +164,7 @@ export function createPublicOpenApiDocument(version: string) {
147
164
registry.registerPath({
148
165
method: 'get',
149
166
path: '/api/version',
167
+
operationId: 'getVersion',
150
168
tags: [miscTag.name],
151
169
summary: 'Get Sourcebot version',
152
170
responses: {
@@ -160,6 +178,7 @@ export function createPublicOpenApiDocument(version: string) {
160
178
registry.registerPath({
161
179
method: 'get',
162
180
path: '/api/source',
181
+
operationId: 'getFileSource',
163
182
tags: [filesTag.name],
164
183
summary: 'Get file contents',
165
184
request: {
@@ -179,6 +198,7 @@ export function createPublicOpenApiDocument(version: string) {
179
198
registry.registerPath({
180
199
method: 'post',
181
200
path: '/api/tree',
201
+
operationId: 'getFileTree',
182
202
tags: [filesTag.name],
183
203
summary: 'Get a file tree',
184
204
request: {
@@ -201,6 +221,7 @@ export function createPublicOpenApiDocument(version: string) {
201
221
registry.registerPath({
202
222
method: 'post',
203
223
path: '/api/files',
224
+
operationId: 'listFiles',
204
225
tags: [filesTag.name],
205
226
summary: 'List files in a repository revision',
206
227
request: {
@@ -227,16 +248,26 @@ export function createPublicOpenApiDocument(version: string) {
227
248
info: {
228
249
title: 'Sourcebot Public API',
229
250
version,
230
-
description: 'OpenAPI description for the public Sourcebot REST endpoints used for search, repository listing, and file browsing.',
251
+
description: 'OpenAPI description for the public Sourcebot REST endpoints used for search, repository listing, and file browsing. Authentication is instance-dependent: API keys are the standard integration mechanism, OAuth bearer tokens are EE-only, and some instances may allow anonymous access.',
0 commit comments