Skip to main content
POST
/
api
/
v1
/
telemetry
/
raw
Ingest raw Langfuse record
import requests

url = "https://api.example.com/api/v1/telemetry/raw"

payload = {
    "user_id": "<string>",
    "session_id": "<string>",
    "trace_id": "<string>",
    "trace_name": "trace",
    "span_id": "<string>",
    "span_name": "span",
    "start_time_unix_nano": 123,
    "end_time_unix_nano": 123,
    "input": "<string>",
    "output": "<string>",
    "level": "INFO",
    "error": False,
    "status_message": "<string>",
    "extra": {}
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "success": false,
  "error": {
    "detail": [
      {
        "loc": [
          "<string>"
        ],
        "msg": "<string>",
        "type": "<string>",
        "input": "<unknown>",
        "ctx": {}
      }
    ]
  }
}

Headers

X-API-Key
string | null

Body

application/json

A single Langfuse telemetry record.

user_id
string | null

The end-user identifier associated with this trace, mapped to the Langfuse trace field user_id.

session_id
string | null

The session identifier grouping multiple traces together, mapped to the Langfuse trace field session_id.

trace_id
string | null

The trace identifier from the OpenTelemetry SpanContext, expressed as a 32-character hex string (e.g. '1c563dcf980b449abb0dcbeaf1784e81') or a UUID.

trace_name
string
default:trace

Name of the trace

span_id
string | null

The span identifier from the OpenTelemetry SpanContext, expressed as a 16-character hex string (e.g. 'ffffffffffffffff').

span_name
string
default:span

Name of the span

start_time_unix_nano
integer | null

Start time in nanoseconds since Unix epoch

end_time_unix_nano
integer | null

End time in nanoseconds since Unix epoch

input
string | null

The input payload for this observation or trace, mapped to the Langfuse fields observation.input and trace.input.

output
string | null

The output payload produced by this observation or trace, mapped to the Langfuse fields observation.output and trace.output.

level
enum<string>
default:INFO

The log level of this observation. Valid values: 'DEBUG', 'INFO', 'WARN', 'ERROR'.

Available options:
DEBUG,
INFO,
WARN,
ERROR
error
boolean
default:false

Indicates whether the observation ended in an error state. True maps to Langfuse status code ERROR; false maps to OK.

status_message
string | null

An optional human-readable message providing additional detail about the observation status, mapped to the Langfuse field observation.status_message.

extra
Extra · object

Extra fields

Response

Successful Response