# Episodes_SampleEpisodeSeries

`GET /v1/accounts/{account}/datasets/{dataset}/episodes/{episode}:sampleSeries`

The episode's joint series: each state and action channel sampled evenly
over the take's current content: the joints drawer's charts, and the
arm's motion the camera lag drawer sets each camera's offset against.
Its window says where those samples sit in the episode's recording.
A handheld take resolved at its TCP also has the hands' TCP poses, when
streams names TCP.
A take in no published version yet answers unpublished, with no
channels; FAILED_PRECONDITION means the published content cannot be
sampled (a column type it cannot read, say).

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

## Parameters

- `account` (path, string, required): The account id.
- `dataset` (path, string, required): The dataset id.
- `episode` (path, string, required): The episode id.
- `maxPoints` (query, integer (int32)): Samples to return at most, 2 to 2000; 400 when unset. A take with fewer
  frames returns every frame. The first and last frame are always samples.
- `streams` (query, array of string (enum)): The vectors to sample, each at most once; STATE and ACTION when empty
  (TCP only when named). A take whose action cannot be read still answers
  for its state alone, and one with no TCP (not a handheld take resolved at
  its TCP) answers for the rest without it.

  ```yaml
  type: array
  items:
    enum:
      - STREAM_UNSPECIFIED
      - STATE
      - ACTION
      - TCP
      - MOTION
    type: string
    format: enum
  ```
- `version` (query, string): Read as this version froze it: a tag, `stable`, `v0` or a
  digest prefix; empty or `head` reads the episode as it is now. As
  GetEpisodeRequest.version: the series of the member that version holds.

## Responses

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

## Schemas

```yaml
qualia.v1.SampleEpisodeSeriesResponse:
  type: object
  properties:
    timeSeconds:
      type: array
      items:
        type: number
        format: double
      description: |-
        Seconds from the first frame sampled, one per sample: a sample's second
        of the episode's recording is this plus window_start_seconds.
    channels:
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.SampleEpisodeSeriesResponse_Channel"
      description: Every channel the recording carries, on time_seconds.
    fps:
      type: number
      description: The recording's frames per second.
      format: double
    frameCount:
      type: string
      description: "Frames sampled: the take's, or what its applied trim keeps."
    unpublished:
      type: boolean
      description: |-
        True when the take is in no published version yet (a split child
        before its publish): it has no channels to sample.
    windowStartSeconds:
      type: number
      description: |-
        Where the first frame sampled sits in the episode's recording, in
        seconds of the recording (the clock its trim, subtasks and markers are
        in), on that frame: 0 until a trim is applied, the trim's start once one
        is; a split's piece is a recording of its own, so 0. Unset with
        unpublished.
      format: double
    windowEndSeconds:
      type: number
      description: |-
        Where the frames sampled end in the recording, in the same seconds: the
        end of the last one (window_start_seconds plus frame_count / fps).
        Unset with unpublished.
      format: double
    takeIdentity:
      readOnly: true
      type: string
      description: |-
        The data identity of the take these frames are read from: an
        opaque token over its data file, frame span and fps as its upload's
        current publication holds them. A pose repair never changes it; a
        re-ingest that re-grids the take does. Send it back with each
        Datasets.RepairPoses add, which is refused when it no longer matches
        (ABORTED when that is the request's only problem). A split piece reads
        its take's. Set only by SampleEpisodeSeries reading
        the upload's current version (no `version`, not a branch); empty for a
        take no publication holds.
    repairIdentity:
      readOnly: true
      type: string
      description: |-
        The repairs of the take these frames are read from: an opaque
        token over every pose and jaw repair entry its upload's current
        publication holds for that take, on every hand and target. A STEP is
        measured on the take with its earlier steps applied, so every
        Datasets.RepairPoses STEP add sends it back, and is refused ABORTED when
        the take's repairs changed since this read. Set when take_identity is.
    repairs:
      readOnly: true
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.SampleEpisodeSeriesResponse_Repair"
      description: |-
        What the take's pose file lists: each person entry applied
        to it, in key order, then ingest's fills, filled or undone, then the
        lost-tracking runs it left unfilled. Empty for a take with no
        pose file, when STATE and TCP are not read, and when its
        list cannot be read.
        BatchSampleEpisodeSeries lists them too, without `author`.
  description: Response for Episodes.SampleEpisodeSeries.
qualia.v1.SampleEpisodeSeriesResponse_Channel:
  type: object
  properties:
    stream:
      enum:
        - STREAM_UNSPECIFIED
        - STATE
        - ACTION
        - TCP
        - MOTION
      type: string
      description: Which vector.
      format: enum
    key:
      type: string
      description: |-
        Its positional key, "state[3]" or "action[3]"; the dataset's robot
        interface names the positions. A TCP channel is named, "left.tcp.x".
    values:
      type: array
      items:
        type: number
        format: double
      description: One value per sample; 0 where valid is false.
    valid:
      type: array
      items:
        type: boolean
      description: "Per sample: false where the recording holds no finite value."
  description: "One channel: one component of the state or the action vector."
qualia.v1.SampleEpisodeSeriesResponse_Repair:
  type: object
  properties:
    hand:
      readOnly: true
      enum:
        - SIDE_UNSPECIFIED
        - SIDE_LEFT
        - SIDE_RIGHT
      type: string
      description: LEFT or RIGHT.
      format: enum
    kind:
      readOnly: true
      enum:
        - KIND_UNSPECIFIED
        - INTERPOLATE
        - UNDO_FILL
        - STEP
        - FILL
        - UNFILLED
      type: string
      description: What it is.
      format: enum
    target:
      readOnly: true
      enum:
        - TARGET_UNSPECIFIED
        - POSITION
        - ROTATION
        - JAW
      type: string
      description: What it edits.
      format: enum
    startFrame:
      readOnly: true
      type: string
      description: |-
        Its frames [start_frame, end_frame) in this episode's recording, as
        window_start_seconds counts them: what a PoseRepair remove of it names
        on this episode (a step's are [from, from + 1)). A split piece lists
        only the entries on its own frames, never its take's other pieces'.
    endFrame:
      readOnly: true
      type: string
      description: The end of the frames, exclusive.
    shift:
      readOnly: true
      type: array
      items:
        type: number
        format: double
      description: A POSITION step's shift in metres, x, y and z; empty otherwise.
    turn:
      readOnly: true
      type: array
      items:
        type: number
        format: double
      description: A ROTATION step's turn, a rotation vector in radians; empty otherwise.
    undone:
      readOnly: true
      type: boolean
      description: "A FILL that a person's UNDO_FILL skips: the recorded values show."
    author:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.Actor"
      description: |-
        Who made a person's entry. Set only when take_identity is, and never
        on a FILL or UNFILLED.
  description: |-
    One repair the take's pose file lists: a person's entry as
    it was applied, or a fill ingest made.
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.
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.
```
