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.md
+23-2Lines changed: 23 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,20 @@ The API is served from the configured domain (set via `WEBSITE_ADDRESS` environm
10
10
11
11
Most endpoints do not require authentication. However, some endpoints require specific authentication:
12
12
13
+
-**API endpoints**: Require API key authentication via request header (using `API_KEY` environment variable)
13
14
-**Download endpoints**: Require username/password authentication via request body (using `LOGIN_USER` and `LOGIN_PASSWORD` environment variables)
14
15
-**GitHub webhook endpoints**: Use GitHub webhook secret for verification
15
16
-**GitHub API interactions**: Use GitHub App authentication
16
17
18
+
### API Key Authentication
19
+
20
+
For endpoints requiring API key authentication, include one of the following headers:
21
+
22
+
-`X-API-Key: <your-api-key>`
23
+
-`Authorization: Bearer <your-api-key>`
24
+
25
+
The API key must match the value set in the `API_KEY` environment variable. If the API key is missing or invalid, the endpoint will return `401 Unauthorized`.
-`issues.opened`: Adds welcome comment to new issues
43
53
-`push`: Logs push events
44
54
45
-
**Note**: For "docs review" label, the app integrates with DocsAgent service if configured. This is limited to repositories specified in the `DOCS_REPOS` environment variable.
55
+
**Note**: For "docs review" label, the app integrates with DocsAgent service if configured. This is limited to repositories specified in the `DOCS_REPOS` environment variable. The DocsAgent service uses the `API_POST_GITHUB_COMMENT` environment variable (or defaults to `WEBSITE_ADDRESS/api/comment`) to post review results back to GitHub.
46
56
47
57
---
48
58
@@ -208,6 +218,8 @@ Adds a comment to a GitHub issue or pull request.
208
218
209
219
**Description**: Adds a comment to a specified GitHub issue or PR (used by external services like docs agent).
210
220
221
+
**Authentication**: Requires API key authentication via `X-API-Key` or `Authorization: Bearer <key>` header.
222
+
211
223
**Request Body** (JSON):
212
224
```json
213
225
{
@@ -221,12 +233,14 @@ Adds a comment to a GitHub issue or pull request.
221
233
**Response**:
222
234
-`200 OK`: "Comment added to GitHub issue or PR"
223
235
-`400 Bad Request`: Missing required parameters
236
+
-`401 Unauthorized`: API key missing or invalid
224
237
-`500 Internal Server Error`: Failed to add comment
-`API_KEY`: API key for protecting API endpoints (e.g., `/api/comment`)
302
+
286
303
### Download Endpoint Authentication
287
304
-`LOGIN_USER`: Username for download authentication
288
305
-`LOGIN_PASSWORD`: Password for download authentication
@@ -297,6 +314,7 @@ The following environment variables affect API behavior:
297
314
-`DOCS_AGENT_API_LINK_URL`: URL for docs linking endpoint
298
315
-`DOCS_AGENT_API_TIMEOUT`: Timeout for DocsAgent API calls (default: 350000ms)
299
316
-`DOCS_REPOS`: Comma-separated list of repositories eligible for docs review
317
+
-`API_POST_GITHUB_COMMENT`: Webhook URL for DocsAgent to post result back to (defaults to `our WEBSITE_ADDRESS/api/comment` where we have configured github issue/pr comments). Allows use case to use a proxy url for this webhook url in staging server.
0 commit comments