Skip to content

Commit 1d81fda

Browse files
committed
docs: Update API documentation
- Add /api prefix to all endpoint documentation - Document the new /api/health endpoint in README and OpenAPI spec
1 parent 99a7bbc commit 1d81fda

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

API/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ Requests that may change the state (PUT & DELETE) will require authenticaiton if
88
In such case the authorization header must be sent with the proper API key.
99
Example: `authorization: ApiKey SECRET_API_KEY`
1010

11-
## GET `/flags/{namespace}`
11+
## GET `/api/flags/{namespace}`
1212
Get all the enabled feature flags in a namespace.
1313

14-
## HEAD `/flags/{namespace}`
14+
## HEAD `/api/flags/{namespace}`
1515
Check if the feature flags have been updated for a namespace. The response will contain the [etag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header.
1616
If the etag header value is the same as in the most recent GET or HEAD request, the namespace's feature flags have not changed.
1717

18-
## PUT `/flags/{namespace}/{flag}`
18+
## PUT `/api/flags/{namespace}/{flag}`
1919
Enable a feature flag in a namespace.
2020

21-
## DELETE `/flags/{namespace}/{flag}`
22-
Disable a feature flag in a namespace.
21+
## DELETE `/api/flags/{namespace}/{flag}`
22+
Disable a feature flag in a namespace.
23+
24+
## GET `/api/health`
25+
Health check endpoint that can be used to verify the service is running in a healthy state.

open_api.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ paths:
8080
'401':
8181
description: Unauthorized
8282

83+
/api/health:
84+
get:
85+
summary: Health check endpoint
86+
description: Check the health status of the service and its database connection (if any)
87+
responses:
88+
'200':
89+
description: Service is healthy
90+
'503':
91+
description: Service is unavailable
92+
8393
components:
8494
schemas:
8595
Response:

0 commit comments

Comments
 (0)