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}.
Export governance events as OCSF 1.9.0
The organisation's governance events as OCSF 1.9.0 API Activity (6003) events, oldest first: traces from ingestion sources, events pulled from provider audit APIs, admin workspace views and OCSF events pushed in from other sources (source_type ocsf_push, returned as received). Each LangWatch event carries ai_model, ai_agent and message_context token counts when known, and the cost under unmapped.langwatch. Filter with source_type and source_id. Pass next_cursor back as cursor to read on; it is always set, so a puller stores it between runs. has_more is true when more events are already waiting. since (ISO 8601) starts the first read and a cursor carries its own position. until (ISO 8601) is not in the cursor: send it with every page.
Try this endpoint
app.langwatch.ai
API key · Authorization
Kept in this tab. Cleared when you reload.
In UTC.
In UTC.
The response appears below.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/governance/ocsf/events"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/ocsf/events";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/ocsf/events' \ --header "Authorization: Bearer $LANGWATCH_API_KEY"Call the LangWatch API from this project: Export governance events as OCSF 1.9.0.Request: GET https://app.langwatch.ai/api/v1/governance/ocsf/eventsReference: https://langwatch.ai/docs/api-reference/governance-ocsf/export-governance-events-as-ocsf-1-9-0.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
{ "ocsf_version": "string", "data": [ {} ], "next_cursor": "string", "has_more": false}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 ]}Unprocessable Entity
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 ]}Query parameters
limitintegersincestring (date-time)untilstring (date-time)cursorstringsource_typestringsource_idstringResponses
200Success
application/json
ocsf_versionstringrequireddataobject[]requirednext_cursorstringrequiredhas_morebooleanrequired400Bad Request
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstring"customer""platform""provider""presumed_platform"reasonsany[]401Unauthorized
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstring"customer""platform""provider""presumed_platform"reasonsany[]403Forbidden
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstring"customer""platform""provider""presumed_platform"reasonsany[]422Unprocessable Entity
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstring"customer""platform""provider""presumed_platform"reasonsany[]500Internal Server Error
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstring"customer""platform""provider""presumed_platform"reasonsany[]