Skip to contentSkip to page list

Docs

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.

POST/api/v1/governance/ocsf/ingest
Request and response examples
request.py
import osimport requests​origin = "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())

Success

application/json · Generated from schema

{  "accepted": 0}
api-reference/governance-ocsf/push-ocsf-events-in-from-another-source

Authorization

Authorizationstringheaderrequired

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}.

Request body

application/json · Required

sourcestringrequired
Pattern ^[a-z0-9][a-z0-9_.-]{0,62}$
eventsobject[]required
class_uidintegerrequired
Minimum 0Maximum 999999
category_uidinteger
Minimum 0Maximum 999
activity_idinteger
Minimum 0Maximum 255
type_uidinteger
Minimum 0Maximum 99999999
severity_idintegerrequired
Minimum 0Maximum 255
timeintegerrequired
Minimum 946684800000Maximum 9007199254740991
metadataobjectrequired

Responses

200

Success

application/json

acceptedintegerrequired
Minimum 0Maximum 9007199254740991
400

Bad Request

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
401

Unauthorized

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
403

Forbidden

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
422

Unprocessable Entity

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
500

Internal Server Error

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]

Documentation