Skip to content

Episodes_SplitEpisodes

POST
/v1/accounts/{account}/datasets/{dataset}/episodes:split
curl --request POST \
--url https://dev-api.qualiastudios.dev/v1/accounts/example/datasets/example/episodes:split \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "parent": "example", "cutPlan": { "episodes": [ { "episode": "example", "cutSeconds": [ 1 ], "keepWindows": [ { "startSeconds": 1, "endSeconds": 1 } ] } ] }, "markerCuts": { "selection": { "names": { "names": [ "example" ] }, "filter": "example" }, "labels": [ "example" ], "startFirstMarker": true, "endLastMarker": true, "startLabels": [ "example" ], "endLabels": [ "example" ] }, "validateOnly": true }'

Splits episodes at given cuts, around kept windows or at their markers (QUA-2252, QUA-2254): each split is drawn on the episode’s draft (EpisodeDraft), its pieces the windows kept, each tagged with the labels of the markers that closed it, inside the window the draft keeps (else the episode’s trim). No episode is made until a version is published from a Publish preview. An episode whose draft draws a split already is refused (marker cuts skip it); one another person is editing is left as it is and reported in locked.

account
required
string

The account id.

dataset
required
string

The dataset id.

Media type application/json

Request for Episodes.SplitEpisodes.

object
parent
required

Accounts/{account}/datasets/{dataset}: must be the upload.

string
cutPlan

Explicit cuts.

object
episodes

One entry per episode, at most 500.

Array<object>

Where to cut one episode.

object
episode

Accounts/{account}/datasets/{dataset}/episodes/{episode}

string
cutSeconds

Cut points, seconds from the start of the recording. An episode is cut inside the one stretch its draft keeps, else inside its trim: its pieces keep only those frames, and a cut outside them places nothing (QUA-3614).

Array<number>
keepWindows

The windows to keep instead (QUA-3539), seconds from the start of the recording, in time order and not overlapping: each becomes one child, and what lies outside every window is in no child. Two windows that touch are two children. A window may keep frames the episode’s trim cut (kept_trimmed_frame_count says how many). Not with cut_seconds.

Array<object>

The trim window, in seconds from the start of the recording.

object
startSeconds

First second kept.

number format: double
endSeconds

Last second kept.

number format: double
markerCuts

Marker cuts.

object
selection

Episodes to cut.

object
names

Episode names under the request’s parent.

object
names

Accounts/{account}/datasets/{dataset}/episodes/{episode}, at most 10000.

Array<string>
filter

A ListEpisodes filter over the parent (e.g. what the filter bar leaves).

string
labels

Marker labels to cut at; empty means every marker (none when start_labels or end_labels is set).

Array<string>
startFirstMarker

Drop what comes before the first marker.

boolean
endLastMarker

Drop what comes after the last marker.

boolean
startLabels

Start each episode at its first marker among these labels instead, dropping the lead-in. Not with start_first_marker. Without labels, nothing is cut: each episode becomes one child, its narrowed window (QUA-3048).

Array<string>
endLabels

End each episode at its last marker among these labels instead, dropping the run-out. Not with end_last_marker. Without labels, as start_labels.

Array<string>
validateOnly

Report the children without writing them.

boolean
Example generated
{
"parent": "example",
"cutPlan": {
"episodes": [
{
"episode": "example",
"cutSeconds": [
1
],
"keepWindows": [
{
"startSeconds": 1,
"endSeconds": 1
}
]
}
]
},
"markerCuts": {
"selection": {
"names": {
"names": [
"example"
]
},
"filter": "example"
},
"labels": [
"example"
],
"startFirstMarker": true,
"endLastMarker": true,
"startLabels": [
"example"
],
"endLabels": [
"example"
]
},
"validateOnly": true
}

OK

Media type application/json

Response for Episodes.SplitEpisodes.

object
splits

One per parent that was cut.

Array<object>

One parent and what it became.

object
episode

The parent episode.

string
children

Empty: the split is drawn on the parent’s draft (draft), and its pieces are made only when a version is published from it. With validate_only, a name for each piece, which never exists.

Array<string>
droppedLeadFrameCount

Frames of the recording before the first child that no child keeps (the dropped lead-in, with what the episode’s trim cut there).

string
droppedTailFrameCount

Frames of the recording after the last child that no child keeps (the dropped run-out, with what the episode’s trim cut there).

string
droppedBetweenFrameCount

Frames between children that no child keeps (keep_windows apart). (— api-linter: core::0140::prepositions=disabled aip.dev/not-precedent: named beside dropped_lead_frame_count and dropped_tail_frame_count, the stretch between children. —)

string
keptTrimmedFrameCount

Frames the children keep that the episode’s trim had cut: keep_windows may reach past the trim, cut_seconds and marker cuts never do (QUA-3614). 0 for an untrimmed episode.

string
draft

The parent’s draft, drawn with the split: the pieces it keeps, each an episode once a version is published from it. Unset with validate_only.

object
name

Accounts/{account}/datasets/{dataset}/episodes/{episode}/draft

string
drawing
required

What a version published from it holds.

object
pieces

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.

Array<object>

A stretch of the take as drawn.

object
startSeconds

Start, in seconds from the start of the recording.

number format: double
endSeconds

End, in seconds.

number format: double
keep

Whether the stretch is kept: one kept piece is a trim, two or more a split.

boolean
tags

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.

Array<string>
subtasks

Subtask spans, bounded as UpdateEpisodes bounds Episode.subtasks.

Array<object>

One subtask span (QUA-1794).

object
startSeconds

Start, in seconds from the start of the recording.

number format: double
endSeconds

End, in seconds.

number format: double
label

The subtask’s one name (also one of the episode’s tags).

string
review

Proposed, accepted or rejected.

string format: enum
Allowed values: REVIEW_UNSPECIFIED PROPOSED ACCEPTED REJECTED
origin

Who proposed it.

string format: enum
Allowed values: ORIGIN_UNSPECIFIED HUMAN MODEL HEURISTIC
baseRevision

The Episode.revision the drawing began on.

integer format: int32
base

The editor as read when drawing began (the take’s trim and subtasks then), so a return can tell what moved under the drawing.

object
pieces

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.

Array<object>

A stretch of the take as drawn.

object
startSeconds

Start, in seconds from the start of the recording.

number format: double
endSeconds

End, in seconds.

number format: double
keep

Whether the stretch is kept: one kept piece is a trim, two or more a split.

boolean
tags

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.

Array<string>
subtasks

Subtask spans, bounded as UpdateEpisodes bounds Episode.subtasks.

Array<object>

One subtask span (QUA-1794).

object
startSeconds

Start, in seconds from the start of the recording.

number format: double
endSeconds

End, in seconds.

number format: double
label

The subtask’s one name (also one of the episode’s tags).

string
review

Proposed, accepted or rejected.

string format: enum
Allowed values: REVIEW_UNSPECIFIED PROPOSED ACCEPTED REJECTED
origin

Who proposed it.

string format: enum
Allowed values: ORIGIN_UNSPECIFIED HUMAN MODEL HEURISTIC
baseSplit

Reserved for re-splits: the split take’s pieces the drawing began on.

string
state

Always OPEN.

string format: enum
Allowed values: STATE_UNSPECIFIED OPEN
createActor

Who drew it first: a person, or an API key acting for none.

object
kind

What kind of actor it is.

string format: enum
Allowed values: KIND_UNSPECIFIED PERSON VALIDATION RULE MODEL OPERATOR SYSTEM
user

The person’s user id when kind is PERSON; empty otherwise.

string
displayName

The person’s display name at the time, for rendering without a lookup.

string
agent

The rule code, or the model id (e.g. “gemini-robotics-er”), when not a person.

string
run

The run a model or rule finding came from, when it has one.

string
apiKey

The API key’s id when a person acted through one; empty for a session. Never the key itself.

string
attribution

Signed identity evidence recorded with the change, kept apart from the principal above. Unset on older records and wherever none was signed.

object
authentication

How the principal authenticated.

string format: enum
Allowed values: AUTHENTICATION_UNSPECIFIED SESSION API_KEY SERVICE
initiator

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.

string
initiatorDisplayName

The initiator’s display name at the time, never their email.

string
credentialCreator

The user id of the key’s creator at the time. Not who used the key.

string
credentialOwner

Who owned the key at the time.

string format: enum
Allowed values: CREDENTIAL_OWNER_UNSPECIFIED PERSON SPACE
credentialOwnerSpace

The owning space’s id (a workspace or the organization) when credential_owner is SPACE.

string
updateActor

Who last changed the drawing: a person, or an API key acting for none.

object
kind

What kind of actor it is.

string format: enum
Allowed values: KIND_UNSPECIFIED PERSON VALIDATION RULE MODEL OPERATOR SYSTEM
user

The person’s user id when kind is PERSON; empty otherwise.

string
displayName

The person’s display name at the time, for rendering without a lookup.

string
agent

The rule code, or the model id (e.g. “gemini-robotics-er”), when not a person.

string
run

The run a model or rule finding came from, when it has one.

string
apiKey

The API key’s id when a person acted through one; empty for a session. Never the key itself.

string
attribution

Signed identity evidence recorded with the change, kept apart from the principal above. Unset on older records and wherever none was signed.

object
authentication

How the principal authenticated.

string format: enum
Allowed values: AUTHENTICATION_UNSPECIFIED SESSION API_KEY SERVICE
initiator

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.

string
initiatorDisplayName

The initiator’s display name at the time, never their email.

string
credentialCreator

The user id of the key’s creator at the time. Not who used the key.

string
credentialOwner

Who owned the key at the time.

string format: enum
Allowed values: CREDENTIAL_OWNER_UNSPECIFIED PERSON SPACE
credentialOwnerSpace

The owning space’s id (a workspace or the organization) when credential_owner is SPACE.

string
createTime

When it was first saved.

string format: date-time
updateTime

When it was last saved.

string format: date-time
etag

Changes with every save of the draft. Sent back on UpdateEpisodeDraft and DeleteEpisodeDraft, and as UpdateEpisodesRequest.Edit’s expected_draft_etag.

string
pieceCount

How many pieces the split keeps.

integer format: int32
lockedCount

Parents left uncut because another person holds their edit lease.

integer format: int32
locked

The first 100 of them, with their holders.

Array<object>

An episode a write left alone, or refused, because another person holds its edit lease (Episodes.AcquireEpisodeLease). Bulk responses list at most 100 of these beside a count of all of them.

object
episode

Accounts/{account}/datasets/{dataset}/episodes/{episode}, in the scope the write was made in.

string
holderName

The holder’s display name; empty when they have none. (— api-linter: core::0122::name-suffix=disabled aip.dev/not-precedent: a person’s display name, as Episode.Lease calls it. —)

string
skipped

Marker splits left unchanged for a reason other than an edit lease. Includes refusals found while planning and while saving the drawing.

Array<object>

A marker split that could not be drawn. Other selected takes proceed.

object
episode

The parent episode left unchanged.

string
reason

Why no split was drawn, including an already drawn split or no marker.

string
Example
{
"splits": [
{
"draft": {
"drawing": {
"subtasks": [
{
"review": "REVIEW_UNSPECIFIED",
"origin": "ORIGIN_UNSPECIFIED"
}
]
},
"base": {
"subtasks": [
{
"review": "REVIEW_UNSPECIFIED",
"origin": "ORIGIN_UNSPECIFIED"
}
]
},
"state": "STATE_UNSPECIFIED",
"createActor": {
"kind": "KIND_UNSPECIFIED",
"attribution": {
"authentication": "AUTHENTICATION_UNSPECIFIED",
"credentialOwner": "CREDENTIAL_OWNER_UNSPECIFIED"
}
},
"updateActor": {
"kind": "KIND_UNSPECIFIED",
"attribution": {
"authentication": "AUTHENTICATION_UNSPECIFIED",
"credentialOwner": "CREDENTIAL_OWNER_UNSPECIFIED"
}
}
}
}
]
}

Default error response

Media type application/json

The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide.

object
code

The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].

integer format: int32
message

A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.

string
details

A list of messages that carry the error details. There is a common set of message types for APIs to use.

Array<object>

Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.

object
@type

The type of the serialized message.

string
key
additional properties
any
Example generated
{
"code": 1,
"message": "example",
"details": [
{
"@type": "example"
}
]
}