Get a user
const url = 'http://localhost:8080/api/v1/projects/example/users/example';const options = {method: 'GET', headers: {cookie: 'cetra_session=<cetra_session>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:8080/api/v1/projects/example/users/example \ --cookie cetra_session=<cetra_session>Evaluation, playground and assistant traces (environment = cetra-eval, environment = cetra-playground or environment = cetra-assistant) and experiment traces are excluded unless include_eval or include_experiments is set. Sessions are the user’s 100 most recent.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Project UUID, URL-encoded org-slug/project-slug, or current.
End-user id.
Query Parameters
Section titled “Query Parameters”RFC 3339 timestamp or epoch milliseconds.
Inclusive range start. RFC 3339 or epoch milliseconds.
RFC 3339 timestamp or epoch milliseconds.
Exclusive range end. RFC 3339 or epoch milliseconds.
Include traces from the reserved environments (cetra-eval, cetra-playground, cetra-assistant). Default false. Spec 05 § Default exclusions.
Include experiment traces. Default false. Spec 05 § Default exclusions.
Responses
Section titled “Responses”The user and recent sessions.
User summary plus the most recent sessions.
Spec 09 § Response shapes.
object
The user’s most recent sessions. At most [MAX_USER_SESSIONS].
One row of the session list.
Spec 01 § Session and spec 09 § Observability data.
object
Sum of trace costs, USD. Omitted when every trace omitted the field.
end_time - start_time, nanoseconds.
Latest trace end, nanoseconds since the Unix epoch. JSON is RFC 3339.
Sum of the traces’ error_count.
Number of the session’s traces whose status is error.
input_preview of the session’s earliest-starting trace. Omitted when there is none.
output_preview of the session’s latest-starting trace. Omitted when there is none.
Latest score of each name attached to this session.
The latest score of one name on a trace or session row.
Spec 09 § Response shapes.
object
Score name.
Score id.
Who wrote the score.
Score value.
A finite number.
object
A finite number.
True or false. Stored numerically as 1 or 0.
object
True or false. Stored numerically as 1 or 0.
A label and an optional numeric mapping.
object
A label and an optional numeric mapping.
object
Category label. Stored in value_str.
Optional numeric mapping. Stored in value_num. Omitted from JSON when absent.
Free text.
object
Free text.
Session id.
Earliest trace start, nanoseconds since the Unix epoch. JSON is RFC 3339.
Sorted distinct union of the session’s trace tags.
Sum of trace token totals. Omitted when every trace omitted the field.
Number of traces in the session.
End-user id.
User row.
object
Trace counts in 24 equal buckets: the request’s [from, to), or without one
[first_seen, last_seen] of the returned rows.
Sum of trace costs, USD. Omitted when every trace omitted the field.
Sum of the traces’ error_count.
Traces whose status is error.
Earliest trace start, nanoseconds since the Unix epoch. JSON is RFC 3339.
Latest trace end, nanoseconds since the Unix epoch. JSON is RFC 3339.
user.* keys of the latest trace’s metadata, without the prefix. Omitted when empty.
object
Average of each numeric and boolean score name over the user’s traces.
Average of one score name over a user’s traces (spec 09 § Observability data).
object
Mean value_num; for booleans the share of true.
Number of scores averaged.
numeric or boolean.
Score name.
Number of sessions.
Sum of trace token totals. Omitted when every trace omitted the field.
Number of traces.
End-user id.
Example
{ "sessions": [ { "scores": [ { "source": "api", "value": { "data_type": "numeric" } } ] } ], "user": { "scores": [ { "data_type": "numeric" } ] }}The request is malformed or a filter is invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}No credentials, or the credentials are invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The resource does not exist.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The query took longer than its time limit, needed more memory or temporary disk space than allowed, a filter deletion matched more than 100,000 traces, or the owner cannot be that user (code owner_not_allowed).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}Too many requests.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The server is busy or a dependency is unavailable. Retry later.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}