Skip to content

Episodes_LinkTaskLabels

POST
/v1/accounts/{account}/datasets/{dataset}/episodes:linkTaskLabels
curl --request POST \
--url https://junction-api.qualiastudios.dev/v1/accounts/example/datasets/example/episodes:linkTaskLabels \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "parent": "example", "linkedTask": "example", "labels": [ "example" ], "validateOnly": true }'

Links the unlinked episodes, uploads and merged datasets of the caller’s workspace whose free-text task label is a task’s name (a merged dataset by its own labels.task, and never an upload a merge took, which keeps its Task, though its episodes are linked). Publishing a task links its exact matches on its own; this call previews them (validate_only) beside the near misses, labels that differ from the name only in case, spacing or punctuation, and links the labels the caller picks. A link already set, to this task or another, is never changed, and labels stay as they are. Each upload or merged dataset it links anything in records one TASK_ASSIGNED.

account
required
string

The account id.

dataset
required
string

The dataset id.

Media type application/json

Request for Episodes.LinkTaskLabels.

object
parent
required

Accounts/{account}/datasets/-: every upload of the account in the caller’s workspace.

string
linkedTask
required

Accounts/{account}/tasks/{task}: the task to link to. A task of the parent’s account; NOT_FOUND otherwise.

string
labels

The labels to link, each exactly as a match reports it: the task’s name or a near miss of it, at most 100. Empty links the exact matches only, as publishing does. A label that is neither is INVALID_ARGUMENT.

Array<string>
validateOnly

Report what the call would link and write nothing.

boolean
Example generated
{
"parent": "example",
"linkedTask": "example",
"labels": [
"example"
],
"validateOnly": true
}

OK

Media type application/json

Response for Episodes.LinkTaskLabels.

object
matches

Every label that matches the task’s name, as it stood before the call: exact ones first, then by episode count.

Array<object>

Unlinked episodes, uploads and merged datasets that carry one label.

object
label

The label as stored.

string
exact

Whether it is the task’s name, surrounding whitespace aside. Other matches are near misses.

boolean
episodeCount

Unlinked episodes whose task label it is.

integer format: int32
datasetCount

Unlinked uploads and merged datasets whose task label it is.

integer format: int32
linkedEpisodeCount

Episodes linked (with validate_only, that would be).

integer format: int32
linkedDatasetCount

Uploads and merged datasets linked (with validate_only, that would be).

integer format: int32
Example generated
{
"matches": [
{
"label": "example",
"exact": true,
"episodeCount": 1,
"datasetCount": 1
}
],
"linkedEpisodeCount": 1,
"linkedDatasetCount": 1
}

Default error response

Media type application/json
One of:
API error

A refusal from the API itself.

object
code
required

The gRPC code name in upper case, e.g. NOT_FOUND.

string
message
required
string
retryable
required

Whether the same call may succeed if retried.

boolean
details
required

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.

Array<object>
object
Example generated
{
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
]
}