Sources
Update Source
Updates an existing source. The full source object must be provided; this is a replace, not a patch.
The request body is a source object without the id field. If an id is sent anyway it is silently ignored (stripped before validation — never a 400); the path parameter alone identifies the source. Granularity fields (materializedViews[].minGranularity and metadataMaterializedViews.granularity) accept the same short format the API returns (e.g. 5m, 15s, 1h, 1d).
put/api/v2/sources/{id}
Path parameters
idstring required
Source ID
Request body
Example request
{
"id": "507f1f77bcf86cd799439011",
"name": "Logs",
"section": "Billing",
"kind": "log",
"connection": "507f1f77bcf86cd799439012",
"from": {
"databaseName": "otel",
"tableName": "otel_logs"
},
"querySettings": [
{
"setting": "max_threads",
"value": "4"
}
],
"defaultTableSelectExpression": "Timestamp, ServiceName, SeverityText, Body",
"timestampValueExpression": "Timestamp",
"serviceNameExpression": "ServiceName",
"severityTextExpression": "SeverityText",
"bodyExpression": "Body",
"eventAttributesExpression": "LogAttributes",
"resourceAttributesExpression": "ResourceAttributes",
"displayedTimestampValueExpression": "TimestampTime",
"metricSourceId": "507f1f77bcf86cd799439013",
"traceSourceId": "507f1f77bcf86cd799439014",
"traceIdExpression": "TraceId",
"spanIdExpression": "SpanId",
"implicitColumnExpression": "Body",
"knownColumnsListExpression": "Timestamp, Body, ServiceName",
"useTextIndexForImplicitColumn": "auto",
"highlightedTraceAttributeExpressions": [
{
"sqlExpression": "SpanAttributes['http.status_code']",
"luceneExpression": "http.status_code",
"alias": "HTTP Status Code"
}
],
"highlightedRowAttributeExpressions": [
{
"sqlExpression": "SpanAttributes['http.status_code']",
"luceneExpression": "http.status_code",
"alias": "HTTP Status Code"
}
],
"materializedViews": [
{
"databaseName": "otel",
"tableName": "otel_logs_mv_5m",
"dimensionColumns": "ServiceName, SeverityText",
"minGranularity": "5m",
"minDate": "2025-01-01T00:00:00Z",
"timestampColumn": "Timestamp",
"aggregatedColumns": [
{
"sourceColumn": "Duration",
"aggFn": "sum",
"mvColumn": "sum__Duration"
}
]
}
],
"metadataMaterializedViews": {
"keyRollupTable": "otel_logs_key_rollup_15m",
"kvRollupTable": "otel_logs_kv_rollup_15m",
"granularity": "15m"
}
}Response
Successfully updated source
Example response
{
"data": {
"id": "507f1f77bcf86cd799439011",
"name": "Logs",
"section": "Billing",
"kind": "log",
"connection": "507f1f77bcf86cd799439012",
"from": {
"databaseName": "otel",
"tableName": "otel_logs"
},
"querySettings": [
{
"setting": "max_threads",
"value": "4"
}
],
"defaultTableSelectExpression": "Timestamp, ServiceName, SeverityText, Body",
"timestampValueExpression": "Timestamp",
"serviceNameExpression": "ServiceName",
"severityTextExpression": "SeverityText",
"bodyExpression": "Body",
"eventAttributesExpression": "LogAttributes",
"resourceAttributesExpression": "ResourceAttributes",
"displayedTimestampValueExpression": "TimestampTime",
"metricSourceId": "507f1f77bcf86cd799439013",
"traceSourceId": "507f1f77bcf86cd799439014",
"traceIdExpression": "TraceId",
"spanIdExpression": "SpanId",
"implicitColumnExpression": "Body",
"knownColumnsListExpression": "Timestamp, Body, ServiceName",
"useTextIndexForImplicitColumn": "auto",
"highlightedTraceAttributeExpressions": [
{
"sqlExpression": "SpanAttributes['http.status_code']",
"luceneExpression": "http.status_code",
"alias": "HTTP Status Code"
}
],
"highlightedRowAttributeExpressions": [
{
"sqlExpression": "SpanAttributes['http.status_code']",
"luceneExpression": "http.status_code",
"alias": "HTTP Status Code"
}
],
"materializedViews": [
{
"databaseName": "otel",
"tableName": "otel_logs_mv_5m",
"dimensionColumns": "ServiceName, SeverityText",
"minGranularity": "5m",
"minDate": "2025-01-01T00:00:00Z",
"timestampColumn": "Timestamp",
"aggregatedColumns": [
{
"sourceColumn": "Duration",
"aggFn": "sum",
"mvColumn": "sum__Duration"
}
]
}
],
"metadataMaterializedViews": {
"keyRollupTable": "otel_logs_key_rollup_15m",
"kvRollupTable": "otel_logs_kv_rollup_15m",
"granularity": "15m"
}
}
}