# Episodes_GetEpisodeDraft

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

The take's draft, through any dataset that reads the take. NOT_FOUND
when it has none.

- 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.
- `dataset` (path, string, required): The dataset id.
- `episode` (path, string, required): The episode id.

## Responses

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

## Schemas

```yaml
qualia.v1.EpisodeDraft:
  required:
    - drawing
  type: object
  properties:
    name:
      type: string
      description: accounts/{account}/datasets/{dataset}/episodes/{episode}/draft
    drawing:
      allOf:
        - $ref: "#/components/schemas/qualia.v1.EpisodeDraft_Drawing"
      description: What a version published from it holds.
    baseRevision:
      type: integer
      description: The Episode.revision the drawing began on.
      format: int32
    base:
      allOf:
        - $ref: "#/components/schemas/qualia.v1.EpisodeDraft_Drawing"
      description: |-
        The editor as read when drawing began (the take's trim and subtasks then),
        so a return can tell what moved under the drawing.
    baseSplit:
      type: string
      description: "Reserved for re-splits: the split take's pieces the drawing began on."
    state:
      readOnly: true
      enum:
        - STATE_UNSPECIFIED
        - OPEN
      type: string
      description: Always OPEN.
      format: enum
    createActor:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.Actor"
      description: "Who drew it first: a person, or an API key acting for none."
    updateActor:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.Actor"
      description: "Who last changed the drawing: a person, or an API key acting for none."
    createTime:
      readOnly: true
      type: string
      description: When it was first saved.
      format: date-time
    updateTime:
      readOnly: true
      type: string
      description: When it was last saved.
      format: date-time
    etag:
      type: string
      description: |-
        Changes with every save of the draft. Sent back on UpdateEpisodeDraft
        and DeleteEpisodeDraft, and as UpdateEpisodesRequest.Edit's
        `expected_draft_etag`.
  description: |-
    An edit of a take drawn and not yet in a version: one per take, read the same
    through every dataset that reads the take. It is never applied to the
    dataset: head keeps the take as recorded, and only a version made from a
    Publish preview holds the edit. Written by whoever holds the take's edit
    lease (Episode.lease), or, while no other person holds one, by any caller
    with write access, a person or an API key. It stays when its author's
    lease ends, for whoever edits the take next, and through a re-ingest of
    the take.

    Served by qds-api.
qualia.v1.EpisodeDraft_Drawing:
  type: object
  properties:
    pieces:
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.EpisodeDraft_Piece"
      description: |-
        The take as pieces, in time order and not overlapping, within the
        recording; at most 512 kept. Stored end to end over the recording:
        what lies between the pieces sent is stored as dropped pieces.
    subtasks:
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.Episode_Subtask"
      description: Subtask spans, bounded as UpdateEpisodes bounds Episode.subtasks.
  description: The editor at one moment.
qualia.v1.EpisodeDraft_Piece:
  type: object
  properties:
    startSeconds:
      type: number
      description: Start, in seconds from the start of the recording.
      format: double
    endSeconds:
      type: number
      description: End, in seconds.
      format: double
    keep:
      type: boolean
      description: |-
        Whether the stretch is kept: one kept piece is a trim, two or more a
        split.
    tags:
      type: array
      items:
        type: string
      description: |-
        Tags the episode this piece becomes carries (a marker split's labels),
        beside the take's own. Kept only on a kept piece; at most 64, each
        non-empty, without surrounding whitespace, at most 1024 bytes.
  description: A stretch of the take as drawn.
qualia.v1.Episode_Subtask:
  type: object
  properties:
    startSeconds:
      type: number
      description: Start, in seconds from the start of the recording.
      format: double
    endSeconds:
      type: number
      description: End, in seconds.
      format: double
    label:
      type: string
      description: The subtask's one name (also one of the episode's tags).
    review:
      enum:
        - REVIEW_UNSPECIFIED
        - PROPOSED
        - ACCEPTED
        - REJECTED
      type: string
      description: Proposed, accepted or rejected.
      format: enum
    origin:
      enum:
        - ORIGIN_UNSPECIFIED
        - HUMAN
        - MODEL
        - HEURISTIC
      type: string
      description: Who proposed it.
      format: enum
  description: One subtask span.
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.
```
