/projects/{project_id}/branches/{branch_id}/logs/fields/{field_name}/valuesList branch log field valuesLists the distinct values observed for a low-cardinality log field in the requested time range. Call the log fields endpoint first to learn which field_name values this branch supports; a field that branch has never emitted is rejected with unknown_field.
Give the window either as since or as an explicit start_time; supplying both is rejected. If neither is given, the previous six hours are used. The maximum supported time range is seven days.
Note: This endpoint is currently in Private Beta.
Parameters
project_idstringpathrequiredThe Neon project ID
branch_idstringpathrequiredThe Neon branch ID
field_namestringpathrequiredThe log field whose distinct values should be returned. Must be one of the names returned by the log fields endpoint for this branch.
sincestringqueryLength of the lookup window, ending at `end_time` or at the current time when `end_time` is omitted. Mutually exclusive with `start_time`. Defaults to six hours.
start_timestring · date-timequeryInclusive beginning of the lookup window. Mutually exclusive with `since`.
end_timestring · date-timequeryExclusive end of the lookup window. Defaults to the current time.
sourcestringqueryOnly consider records emitted by this Neon service.
limitintegerqueryMaximum number of distinct values to return. The response sets `is_truncated` when this bound, or the server's own scan cap, cut the list short.
Responses
is_truncatedbooleanrequiredTrue when more distinct values exist than were returned, because either the requested `limit` or the server's own scan cap was reached. A caller that filters on a partial list is choosing from an arbitrary subset, so narrow `since` or `source` and ask again when this is `true`.
valuesarray of stringrequiredShow child attributes
{
"is_truncated": true,
"values": [
"string"
]
}codestringrequiredmessagestringrequiredreasonstringrequiredMachine-readable reason why the request was rejected: - `time_range_too_large`: the requested window spans more than seven days. - `invalid_time_range`: `end_time` is not after `start_time`. - `conflicting_time_range`: both `since` and `start_time` were supplied. - `invalid_cursor`: the supplied `cursor` is malformed, expired, or was issued for a different query. - `unknown_field`: the requested `field_name` is not one of the fields the log fields endpoint reports for this branch. - `invalid_logql`: the supplied `logql` expression does not parse, or uses a construct this endpoint does not accept. - `conflicting_filters`: `logql` was supplied alongside one or more structured filters. Use one or the other.
{
"code": "LOGS_INVALID_QUERY",
"message": "string",
"reason": "conflicting_filters"
}codestringrequiredmessagestringrequiredreasonstringrequiredMachine-readable reason why logs cannot be read: - `branch_not_found`: the project or branch does not exist, or the caller does not have access to it. - `telemetry_not_enabled`: the branch exists but is not collecting telemetry, so it has no logs to serve.
{
"code": "LOGS_NOT_AVAILABLE",
"message": "string",
"reason": "branch_not_found"
}codestringrequiredmessagestringrequiredError message
request_idstringUnique identifier for the request, useful for debugging. You can set this value manually by including an `X-Request-ID` header in the request. If not provided, the value will be generated automatically.
{
"code": "",
"message": "string",
"request_id": "string"
}