Admin API key for organization-level operations (managing projects, API keys). Create one in Settings > API Keys or via POST /api/api-keys. Format: sk-lw-{id}_{secret}.
Read a Security Lake source's health
The source's last read time, lag (from the oldest event written in the last run to that run), running counts of messages, objects, rows, events written and dropped, the last run's error, and the latest poison objects the reader gave up on.
Try this endpoint
app.langwatch.ai
API key · Authorization
Kept in this tab. Cleared when you reload.
The response appears below.
Request and response examples
request.py
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/governance/security-lake/sources/<sourceId>/health"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "Authorization": "Bearer " + api_key,}response = requests.get( origin + path, headers=headers,)print(response.json())const url = "https://app.langwatch.ai/api/v1/governance/security-lake/sources/<sourceId>/health";const response = await fetch(url, { method: "GET", headers: { "Authorization": "Bearer " + process.env.LANGWATCH_API_KEY, },});const data = await response.json();curl --request GET \ --url 'https://app.langwatch.ai/api/v1/governance/security-lake/sources/<sourceId>/health' \ --header "Authorization: Bearer $LANGWATCH_API_KEY"Call the LangWatch API from this project: Read a Security Lake source's health.Request: GET https://app.langwatch.ai/api/v1/governance/security-lake/sources/<sourceId>/healthReference: https://langwatch.ai/docs/api-reference/governance-security-lake/read-a-security-lake-source-s-health.mdAuthentication: send the Authorization header as a Bearer token, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Use the HTTP client this project already uses, handle non-2xx responses, and show me the parsed result.Success
application/json · Generated from schema
{ "sourceId": "string", "status": "string", "lastError": "string", "health": { "lastReadAt": 0, "lagMs": 0, "runs": 0, "messages": 0, "objects": 0, "rows": 0, "written": 0, "dropped": 0, "invalid": 0, "retried": 0, "poisonCount": 0, "poison": [ { "messageId": "string", "key": "string", "reason": "string", "at": 0 } ] }}Bad Request
application/json · Generated from schema
{ "type": "string", "code": "string", "message": "string", "retryable": false, "meta": {}, "trace_id": "string", "span_id": "string", "trace": { "traceId": "string", "spanId": "string", "traceUrl": "string", "logsUrl": "string" }, "tips": [ "string" ], "docs_url": "string", "fault": "customer", "reasons": [ null ]}Unauthorized
application/json · Generated from schema
{ "type": "string", "code": "string", "message": "string", "retryable": false, "meta": {}, "trace_id": "string", "span_id": "string", "trace": { "traceId": "string", "spanId": "string", "traceUrl": "string", "logsUrl": "string" }, "tips": [ "string" ], "docs_url": "string", "fault": "customer", "reasons": [ null ]}Forbidden
application/json · Generated from schema
{ "type": "string", "code": "string", "message": "string", "retryable": false, "meta": {}, "trace_id": "string", "span_id": "string", "trace": { "traceId": "string", "spanId": "string", "traceUrl": "string", "logsUrl": "string" }, "tips": [ "string" ], "docs_url": "string", "fault": "customer", "reasons": [ null ]}Internal Server Error
application/json · Generated from schema
{ "type": "string", "code": "string", "message": "string", "retryable": false, "meta": {}, "trace_id": "string", "span_id": "string", "trace": { "traceId": "string", "spanId": "string", "traceUrl": "string", "logsUrl": "string" }, "tips": [ "string" ], "docs_url": "string", "fault": "customer", "reasons": [ null ]}Path parameters
sourceIdstringrequiredAt least 1 character
Responses
200Success
application/json
sourceIdstringrequiredstatusstringrequiredlastErrorstring | nullrequiredhealthobjectrequired400Bad Request
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstringOne of
"customer""platform""provider""presumed_platform"reasonsany[]401Unauthorized
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstringOne of
"customer""platform""provider""presumed_platform"reasonsany[]403Forbidden
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstringOne of
"customer""platform""provider""presumed_platform"reasonsany[]500Internal Server Error
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstringOne of
"customer""platform""provider""presumed_platform"reasonsany[]