# Events_ListEvents_Account

`GET /v1/accounts/{account}/events`

Lists events, newest first, optionally grouped into sessions.

- Base URL: `https://junction-api.qualiastudios.dev`
- Authentication: an API key in the `X-API-Key` header

## Parameters

- `account` (path, string, required): The account id.
- `pageSize` (query, integer (int32)): At most this many events, or sessions when grouping; 0 means 100, the
  maximum is 500. TEAM_ACTIVITY defaults to 50, maximum 100.
  A page may hold fewer and still have a next one.
- `pageToken` (query, string): From a previous response's next_page_token, with the same parent,
  filter and grouping. Pages follow the record's sequence, so events
  recorded after the first page never shift a later one.
- `filter` (query, string): AIP-160 filter: comparisons joined by AND (or a space); OR and NOT are
  refused. Fields:

  - `subject`: a resource name; the event's subject, or one of its
    `related` (`subject = "accounts/a/datasets/d"`).
  - `subject.name`, `subject.type`: the subject only.
  - `parent`: the parent's name.
  - `actor.user`, `actor.api_key`, `actor.agent`, `actor.kind` (PERSON,
    SYSTEM, ...).
  - `action` (`"qds.EPISODES_RULED"`), `service` (`"qds"`), `operation`.
  - `create_time`, with `= < <= > >=` and an RFC 3339 time.
  - `sequence`, with `= < <= > >=`.

  With view TEAM_ACTIVITY only, each with `=` and at most once:

  - `verb`: the summary's verb (`verb = EDIT`, `verb = PROPOSE_SUBTASKS`,
    `verb = ADD_INTEGRATION_KEY`). Activity reads qds and platform records.
  - `actor`: the summary's actor kind (PERSON, API_KEY, SERVICE, MODEL,
    SYSTEM, UNKNOWN). Unlike `actor.kind`, the stored kind, a row a key
    wrote is API_KEY and a check's proposals are SYSTEM.
  - `workspace`: a workspace id, quoted; an organization's list only.
  - `text`: case-insensitive substring of the subject's recorded label, on
    any subject type (the summary shows it only for datasets); 3 to 256
    characters.

  Strings are quoted. `=` is exact.
- `grouping` (query, string (enum)): How to group. Unset lists each event. One of: `GROUPING_UNSPECIFIED`, `SESSIONS`.
- `view` (query, string (enum)): Optional representation. Page tokens bind the view and its policy version. One of: `VIEW_UNSPECIFIED`, `TEAM_ACTIVITY`.

## Responses

- `200` OK: `application/json` `qualia.v1.ListEventsResponse`
- `default` Default error response: `application/json` `google.rpc.Status`

## Schemas

```yaml
qualia.v1.ListEventsResponse:
  type: object
  properties:
    events:
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.Event"
      description: One page of events, newest first. Empty when grouping.
    nextPageToken:
      type: string
      description: Empty on the last page.
    sessions:
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.EventSession"
      description: One page of sessions, newest first; set only when grouping is SESSIONS.
    activity:
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.ActivitySummary"
      description: Bounded intentional actions, newest first. Only set for TEAM_ACTIVITY.
    activityCursor:
      type: string
      description: |-
        TEAM_ACTIVITY snapshot cursor. Open its separate SSE subscription after
        the first page's cursor, then merge by ActivitySummary.event. Use only
        the first page's cursor; later pages do not replace the live cursor.
    activityViewVersion:
      type: string
      description: The classifier/projection version bound into Activity page tokens.
  description: Response for Events.ListEvents.
qualia.v1.Event:
  type: object
  properties:
    id:
      readOnly: true
      type: string
      description: |-
        The event's id (a UUID). The relay copies a row under this id, so a
        replayed copy is a no-op.
    sequence:
      readOnly: true
      type: string
      description: |-
        Its place in the record: one global sequence, strictly increasing, in
        the order rows were copied. A service's own table numbers its rows
        separately (`source_sequence`).
    createTime:
      readOnly: true
      type: string
      description: When the change was committed.
      format: date-time
    organization:
      readOnly: true
      type: string
      description: The organization (account) id it happened in.
    workspace:
      readOnly: true
      type: string
      description: The workspace id it happened in; empty when `origin` is ORGANIZATION.
    service:
      readOnly: true
      type: string
      description: |-
        The service that committed it: "qds", "platform", "fleet", "training",
        "pipeline", "tasks" or "events". The prefix of `action`.
    actor:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.Actor"
      description: |-
        Who did it. `api_key` is set when a person acted through a key; actor
        kind SYSTEM, RULE or MODEL for changes nobody made by hand.
    action:
      readOnly: true
      type: string
      description: |-
        What happened: `<service>.<TYPE>`, e.g. "qds.EPISODES_RULED". TYPE is a
        value name of the service's `Event.Type`.
    subject:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.Subject"
      description: What it happened to, e.g. a dataset.
    parent:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.Subject"
      description: |-
        What the subject lives in, when that matters for filtering (a dataset's
        episode, a run's op); unset otherwise.
    related:
      readOnly: true
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.Subject"
      description: |-
        Other things the one change touched, e.g. the episodes a ruling covered,
        or the second entity of a two-entity action.
    summary:
      readOnly: true
      type: string
      description: One plain line, e.g. "rejected 12 episodes".
    payload:
      readOnly: true
      type: object
      description: |-
        The service's payload message for `action`, as protojson. Never holds a
        secret value.

        A Struct, not a Value: protojson renders a message as a JSON object, so
        a scalar or list here would be a writer bug the type now refuses. Not an
        Any: an Any needs the service's descriptors to read, and readers here
        never have them.
    payloadType:
      readOnly: true
      type: string
      description: |-
        The payload's full message name, e.g.
        "qds.workflow.v1.Event.EpisodesRuled"; empty when there is no payload.
    requestId:
      readOnly: true
      type: string
      description: The request that made the change, for joining with its logs and trace.
    undoable:
      readOnly: true
      type: boolean
      description: Whether the owning service can undo it.
    undoes:
      readOnly: true
      type: string
      description: The id of the event this one undid; empty unless it is an undo.
    operation:
      readOnly: true
      type: string
      description: |-
        The running work it belongs to, when it does (Status.operation). Every
        OPERATION_* event sets it.
    sourceSequence:
      readOnly: true
      type: string
      description: |-
        The source row's `sequence` in its service's events table (`service`
        names the table). Status orders an operation's transitions by it, never
        by `sequence`, which is only the order rows reached the record.
    name:
      type: string
      description: |-
        accounts/{account}/workspaces/{workspace}/events/{event} for an event of
        a workspace; accounts/{account}/events/{event} for one of the
        organization itself. `{event}` is `id`. Every event of an organization
        can also be read by its organization path.
    origin:
      readOnly: true
      enum:
        - ORIGIN_UNSPECIFIED
        - WORKSPACE
        - ORGANIZATION
      type: string
      description: Whether a workspace or the organization itself made the change.
      format: enum
    activityLink:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.ActivityLink"
      description: Explicit request correlation. Absent on historical uncorrelated records.
  description: |-
    One thing that happened: a row of the audit trail.

    Every service writes its own events table (`qds.events`, `platform.events`,
    `fleet.events`, `training.events`, `pipeline.events`, `tasks.events`) in
    the transaction that makes the change, with these fields as columns.
    events-api copies the rows into one record and serves them; status (see
    Status) is read from the same rows. events-api writes `events.events` for
    what its retention job did (`events.v1.Event`).

    Each service types its actions in its own proto (`qds.workflow.v1.Event`,
    `platform.v1.Event`, `fleet.v1.Event`, `training.v1.Event`,
    `pipeline.v1.Event`, `tasks.v1.Event`, `events.v1.Event`): `action` is the
    service name and the type's value name, and `payload` is the matching
    payload message as protojson, rendered by the writer. Nothing downstream decodes a service
    proto.

    Served by events-api (Events), read from the record.
qualia.v1.Actor:
  type: object
  properties:
    kind:
      readOnly: true
      enum:
        - KIND_UNSPECIFIED
        - PERSON
        - VALIDATION
        - RULE
        - MODEL
        - OPERATOR
        - SYSTEM
      type: string
      description: What kind of actor it is.
      format: enum
    user:
      readOnly: true
      type: string
      description: The person's user id when `kind` is PERSON; empty otherwise.
    displayName:
      readOnly: true
      type: string
      description: The person's display name at the time, for rendering without a lookup.
    agent:
      readOnly: true
      type: string
      description: |-
        The rule code, or for a MODEL the Qualia model tier (e.g. "qualia-vlm";
        "qualia" for any other model), when not a person.
    run:
      readOnly: true
      type: string
      description: The run a model or rule finding came from, when it has one.
    apiKey:
      readOnly: true
      type: string
      description: |-
        The API key's id when a person acted through one; empty for a session.
        Never the key itself.
    attribution:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.Attribution"
      description: |-
        Signed identity evidence recorded with the change, kept apart from the
        principal above. Unset on older records and wherever none was signed.
  description: Who did something. Every decision, issue and reply names one.
qualia.v1.Attribution:
  type: object
  properties:
    authentication:
      readOnly: true
      enum:
        - AUTHENTICATION_UNSPECIFIED
        - SESSION
        - API_KEY
        - SERVICE
      type: string
      description: How the principal authenticated.
      format: enum
    initiator:
      readOnly: true
      type: string
      description: |-
        The user id of a person verified as starting the work: the person of a
        session, or the person a trusted service's signed job record names.
        Empty when nobody was verified.
    initiatorDisplayName:
      readOnly: true
      type: string
      description: The initiator's display name at the time, never their email.
    credentialCreator:
      readOnly: true
      type: string
      description: The user id of the key's creator at the time. Not who used the key.
    credentialOwner:
      readOnly: true
      enum:
        - CREDENTIAL_OWNER_UNSPECIFIED
        - PERSON
        - SPACE
      type: string
      description: Who owned the key at the time.
      format: enum
    credentialOwnerSpace:
      readOnly: true
      type: string
      description: |-
        The owning space's id (a workspace or the organization) when
        `credential_owner` is SPACE.
  description: |-
    How a change was authenticated and who verifiably started it.
    Only the trusted mesh signs it. It never authorizes anything, and a key's
    creator or owner is never the person who used the key.
qualia.v1.Subject:
  type: object
  properties:
    type:
      readOnly: true
      type: string
      description: What kind of thing, e.g. "dataset", "episode", "robot", "workspace".
    name:
      readOnly: true
      type: string
      description: Its resource name or id, e.g. "accounts/a/datasets/d".
    label:
      readOnly: true
      type: string
      description: What a person called it at the time, e.g. "Pick and place, v2".
  description: |-
    A thing an event or a status points at. Labels are captured when the event
    is written, so a renamed or deleted thing still reads as it was.
qualia.v1.ActivityLink:
  type: object
  properties:
    root:
      readOnly: true
      type: string
      description: Canonical root event UUID, scoped to the event's account.
    role:
      readOnly: true
      enum:
        - ROLE_UNSPECIFIED
        - ROOT
        - EFFECT
      type: string
      description: Whether this event is the root or a derived effect.
      format: enum
  description: Proven request identity, independent of trace IDs and operation transitions.
qualia.v1.EventSession:
  type: object
  properties:
    latest:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.Event"
      description: Its newest event, the one to show.
    eventCount:
      readOnly: true
      type: integer
      description: How many events it holds, `latest` included.
      format: int32
    startTime:
      readOnly: true
      type: string
      description: |-
        The earliest create_time among its events. Record order does not
        follow create_time, so this need not be the oldest event's.
      format: date-time
    endTime:
      readOnly: true
      type: string
      description: The latest create_time among its events.
      format: date-time
    events:
      readOnly: true
      type: array
      items:
        type: string
      description: |-
        The names of its events, newest first: the first 100. For all of them,
        list with `subject.name`, the actor and `sequence` between
        `first_sequence` and `latest.sequence`.
    firstSequence:
      readOnly: true
      type: string
      description: The record sequence of its oldest event.
  description: |-
    Repeated work by one actor on one thing, shown as one line.

    Walking a list newest first, an event joins the session before it when it
    has the same actor (kind, user, API key and agent) and the same subject
    (type and name), and was created within 30 minutes of the event that
    joined it last. Anything else in between, as the filter left the list,
    ends the session. A session holds at most 1000 events; the next one starts
    a new session. Sessions never span pages.
qualia.v1.ActivitySummary:
  type: object
  properties:
    event:
      type: string
      description: |-
        Canonical raw event reference, also the detail lookup key. Consumers
        deduplicate by this field; request_id is not an action identity.
    uid:
      type: string
      description: The canonical event UUID, preserved unchanged.
    sequence:
      type: string
      description: Global record sequence, used by both list ordering and SSE resume.
    createTime:
      type: string
      description: Recorded action time.
      format: date-time
    verb:
      enum:
        - VERB_UNSPECIFIED
        - KEEP
        - REJECT
        - RESET
        - RESTORE
        - EDIT
        - ACCEPT_SUGGESTIONS
        - REJECT_SUGGESTIONS
        - SPLIT
        - UNSPLIT
        - REQUEST_REINGEST
        - EDIT_DATASET
        - ISSUE_RAISED
        - ISSUE_EDITED
        - ISSUE_CONVERTED
        - ISSUE_WITHDRAWN
        - DISMISS_ISSUES
        - REOPEN_ISSUES
        - REPLY_ADDED
        - REPLY_EDITED
        - REPLY_DELETED
        - UNDO
        - REQUEST_CHECKS
        - PROPOSE_SUBTASKS
        - ADD_INTEGRATION_KEY
        - REMOVE_INTEGRATION_KEY
        - COPY_DATASET
        - MOVE_DATASET
        - COPY_DATASET_STARTED
        - COPY_DATASET_FAILED
        - UPLOAD_DATASET
      type: string
      description: What the action did, independent of subsequent execution outcomes.
      format: enum
    changedCount:
      type: string
      description: |-
        Actual changed episodes, or distinct accepted episodes for a checks
        request, or distinct episodes with published proposals at run termination.
        Absent means unknown; child operations are never this count.
    changedFields:
      type: array
      items:
        type: string
      description: At most fifteen allowlisted field names, without values.
    actor:
      allOf:
        - $ref: "#/components/schemas/qualia.v1.ActivityActor"
      description: Recorded identity evidence only. No historical owner lookup.
    dataset:
      type: string
      description: Canonical dataset reference when valid.
    datasetLabel:
      readOnly: true
      type: string
      description: |-
        Dataset label recorded on the raw event's subject, at most 256 characters.
        Empty when no label was recorded or dataset is absent. Not its name today.
    subjectType:
      readOnly: true
      type: string
      description: |-
        The raw event's subject type (`dataset`, `episode`, `secret`, ...), at
        most 64 characters.
    subjectLabel:
      readOnly: true
      type: string
      description: |-
        The label recorded on the raw event's subject, of any type, at most 256
        characters; empty when none was recorded. Not its name today.
    transfer:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.ActivityTransfer"
      description: |-
        COPY_DATASET, MOVE_DATASET, COPY_DATASET_STARTED and COPY_DATASET_FAILED:
        where the dataset came from and went, as recorded. Absent for every other
        verb.
  description: |-
    Bounded summary of one recorded intentional action. No synthetic grouping.
    Historical merged reviews remain separate events. Only the recorded subject
    label is included as text; no payload, reason, related targets, config or
    revision content is sent.
qualia.v1.ActivityActor:
  type: object
  properties:
    kind:
      enum:
        - KIND_UNSPECIFIED
        - PERSON
        - API_KEY
        - UNKNOWN
        - SERVICE
        - SYSTEM
        - MODEL
      type: string
      description: Evidence category.
      format: enum
    user:
      type: string
      description: Recorded UUID only, absent whenever a credential was recorded.
    credential:
      type: string
      description: Credential UUID only, never its value, label, creator or owner.
    authentication:
      enum:
        - AUTHENTICATION_UNSPECIFIED
        - SESSION
        - API_KEY
        - SERVICE
      type: string
      description: |-
        Signed authentication method. Unspecified means not recorded; a key or a
        session never implies the client (UI, SDK) that used it.
      format: enum
    initiator:
      type: string
      description: Verified initiating person's UUID, when recorded. Never a key's creator.
    credentialOwner:
      enum:
        - CREDENTIAL_OWNER_UNSPECIFIED
        - PERSON
        - SPACE
      type: string
      description: Who owned the recorded key at the time, when recorded.
      format: enum
    service:
      type: string
      description: The executing service, `service:<name>`, for a SERVICE principal.
  description: Minimal recorded principal. No key owner is asserted to be the operator.
qualia.v1.ActivityTransfer:
  type: object
  properties:
    source:
      allOf:
        - $ref: "#/components/schemas/qualia.v1.ActivityTransfer_End"
      description: Where the dataset came from.
    target:
      allOf:
        - $ref: "#/components/schemas/qualia.v1.ActivityTransfer_End"
      description: "Where it went: the copy, or the moved dataset."
    version:
      type: string
      description: The version tag copied; empty for the current version and for a move.
    episodeCount:
      type: string
      description: Episodes the copy holds, or the moved dataset.
    bytesShared:
      type: string
      description: "Bytes of content the copy references: what a byte copy would write."
    bytesWritten:
      type: string
      description: Bytes the transfer wrote to blob storage (0 inside one organization).
    robotsCleared:
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.TransferRobot"
      description: Robots cleared by this transfer. Another organization's name is omitted.
    robotsRestored:
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.TransferRobot"
      description: Robots restored by a move back.
    robotsNotRestored:
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.TransferRobot"
      description: Previous robots that could not be restored.
    referenceRanges:
      allOf:
        - $ref: "#/components/schemas/qualia.v1.ReferenceRangeSwitch"
      description: Reference ranges left behind and found by a move.
  description: |-
    A copy or a move as its Activity row names it. One is recorded in each
    workspace it touched. An end in another organization than the row's carries
    only its workspace's and organization's names.
qualia.v1.ActivityTransfer_End:
  type: object
  properties:
    dataset:
      type: string
      description: |-
        The dataset at this end, in the row's organization; empty for another
        organization's end.
    datasetLabel:
      type: string
      description: |-
        The dataset's name when it was recorded, at most 256 characters; empty
        with `dataset`.
    workspace:
      type: string
      description: |-
        The workspace, in the row's organization; empty for another
        organization's end.
    workspaceLabel:
      type: string
      description: The workspace's name when it was recorded, at most 256 characters.
    organizationLabel:
      type: string
      description: |-
        The organization's name when it was recorded, at most 256 characters;
        set only for another organization's end.
  description: One end of the transfer.
qualia.v1.TransferRobot:
  type: object
  properties:
    name:
      type: string
      description: accounts/{account}/robots/{robot}.
    displayName:
      type: string
      description: The robot's display name at transfer time.
  description: A robot named by a transfer, including its name before a later deletion.
qualia.v1.ReferenceRangeSwitch:
  type: object
  properties:
    sourceRanges:
      type: string
      description: Ranges in the source workspace, which no longer apply.
    targetRanges:
      type: string
      description: Ranges in the target workspace, which apply from now on.
  description: |-
    Reference ranges belong to a workspace. These count the ranges of the moved
    uploads' interfaces on each side. Both 0 for a mixture, which moves no upload.
google.rpc.Status:
  oneOf:
    - $ref: "#/components/schemas/ApiError"
    - $ref: "#/components/schemas/GatewayError"
  description: "The body of a failed call: one of the two shapes below."
ApiError:
  title: API error
  type: object
  required:
    - code
    - message
    - retryable
    - details
  properties:
    code:
      type: string
      description: The gRPC code name in upper case, e.g. `NOT_FOUND`.
    message:
      type: string
    retryable:
      type: boolean
      description: Whether the same call may succeed if retried.
    details:
      type: array
      items:
        type: object
      description: "Empty, except when a dataset copy or move is refused: then one `google.rpc.ErrorInfo` with the refusal's `reason` code, its `domain` and, in `metadata`, the datasets it names."
  description: A refusal from the API itself.
GatewayError:
  title: Gateway error
  type: object
  required:
    - detail
  properties:
    detail:
      type: string
      description: What went wrong.
  description: A refusal from the gateway before the call reaches the API, for example `401` bad or missing API key, `403` key lacks the scope or environment closed, `413` body too large.
```
