agent_id claim matches the agent identified by the provided agent key, ensuring a session cannot be used to log events on behalf of a different agent.
You must call the session creation endpoint first to obtain an
X-OTAS-AGENT-SESSION-TOKEN before logging events. The session token is bound to a single process — never reuse it across separate runs.Request
The agent’s API key. Used to identify and authenticate the agent via UASAM.
Session JWT obtained from the session creation endpoint. Must have been issued for the same agent as the agent key.
Body
Required fieldsUUID of the project this event belongs to.
The external API path that was called (e.g.
/api/v1/the-external-path).HTTP method used for the external request (e.g.
GET, POST, PUT, DELETE).HTTP status code returned by the external API.
Actual measured round-trip latency of the external request in milliseconds.
Size of the request payload in bytes.
Size of the response payload in bytes.
Serialized request headers sent to the external API.
Raw or serialized request body sent to the external API.
Query string or serialized query parameters.
Form post data, if applicable.
Serialized response headers received from the external API.
Raw or serialized response body received from the external API.
Content-Type of the request (e.g. application/json).Content-Type of the response.Arbitrary JSON object for attaching user-defined metadata to the event.
Error message or identifier if the external request failed. Leave empty on success.
Additional JSON metadata for internal or debugging purposes.
Response
On success the endpoint returns HTTP201 and includes an event_id in the response object. You can use this ID to retrieve the event later via the session events endpoint.
1 on success, 0 on failure.event_captured on success.Errors
| HTTP | status_description | Meaning |
|---|---|---|
| 401 | missing_agent_key | X-OTAS-AGENT-KEY header was not provided. |
| 401 | invalid_or_expired_agent_key | The agent key was not recognised, is inactive, or the UASAM call failed. |
| 401 | missing_agent_session_token | X-OTAS-AGENT-SESSION-TOKEN header was not provided. |
| 401 | invalid_or_expired_token | The session JWT is malformed, expired, or has invalid claims. |
| 403 | session_agent_mismatch | The JWT’s agent_id does not match the agent identified by the agent key. |
| 400 | missing_required_fields | One or more required body fields are absent. See missing_fields. |
| 500 | event_capture_failed | An unexpected server-side error occurred while saving the event. |