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}.
Push OCSF events in from another source
Stores up to 500 OCSF events from another tool, named by source. Each event needs class_uid, severity_id, time (epoch ms) and metadata.uid and metadata.version, and is at most 64 KiB as UTF-8 JSON; the request body is at most 10 MiB. An event is identified by source and metadata.uid: sending it again replaces it. Stored events are returned by GET /api/governance/ocsf/events with source_type=ocsf_push, as received, and are not pushed to webhook endpoints.
Try this endpoint
app.langwatch.ai
API key · Authorization
Kept in this tab. Cleared when you reload.
This sends a live request to app.langwatch.ai.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/governance/ocsf/ingest"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "Authorization": "Bearer " + api_key, "Content-Type": "application/json",}payload = {}response = requests.post( origin + path, headers=headers, json=payload,)print(response.json())const url = "https://app.langwatch.ai/api/v1/governance/ocsf/ingest";const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer " + process.env.LANGWATCH_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify({}),});const data = await response.json();curl --request POST \ --url 'https://app.langwatch.ai/api/v1/governance/ocsf/ingest' \ --header "Authorization: Bearer $LANGWATCH_API_KEY" \ --header 'Content-Type: application/json' \ --data '{}'Call the LangWatch API from this project: Push OCSF events in from another source.Request: POST https://app.langwatch.ai/api/v1/governance/ocsf/ingestReference: https://langwatch.ai/docs/api-reference/governance-ocsf/push-ocsf-events-in-from-another-source.mdAuthentication: send the Authorization header as a Bearer token, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Body (application/json):```json{}```Use the HTTP client this project already uses, handle non-2xx responses, and show me the parsed result.Success
application/json · Generated from schema
{ "accepted": 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 ]}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 ]}Request body
application/json · Required
sourcestringrequiredeventsobject[]requiredResponses
200Success
application/json
acceptedintegerrequired400Bad 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[]