Re-enqueue Labels Programatically

Please see our reviewing workflow guide to learn more about why you would re-enqueue a label.

To programmatically re-enqueue a label you just need to call the deleteLabels mutation and pass in the id of the label you wish you delete.

Deleting the label

GraphQL Query

mutation{
deleteLabels(
labelIds:["<YOUR_LABEL_ID_TO_REENQUEUE>"]
){
id
deleted
}
}

In Python

# Two things to run this script
# 1. run "pip install graphqlclient"
# 2. Fill in <API-KEY-HERE> (https://app.labelbox.com/settings/apikey)

import json
from graphqlclient import GraphQLClient
client = GraphQLClient('https://api.labelbox.com/graphql')
client.inject_token('Bearer <API-KEY-HERE>')

def delete_labels(label_id_list):
res = client.execute('''
mutation DeleteLabels($label_id_list: [ID!]!) {
deleteLabels(
labelIds: $label_id_list
){
id
deleted
}
}
''', {"label_id_list": label_id_list})
data = json.loads(res)['data']
return data

if __name__ == "__main__":
# Add you label_ids here
delete_labels([])


How did we do?