Labelbox

Data Import

In order to import data you will need the following IDs...

  • Your User ID
  • Your Organization ID
  • A Project ID

Use this query to collect those IDs

Run this query

query {
  user {
    id
    projects {
    	id
    	name
    }
  }
}

You can create a new dataset with this query. Then save the ID for the datarow query below.

Run this query

mutation {
  createDataset(
    data:{
      name: "<INSERT_NAME_HERE>",
      projects: {
        connect: [{id: "<INSERT_PROJECT_ID_HERE>"}]
      }
    }
  ) {
    id
  }
}

A datarow represents a single piece of data that needs to be labeled. For example if you have a CSV with 100 rows you will have 100 datarows.

The Labelbox API is rate limited at 300 requests per minute. We recommend sending datarow import requests one after another and not in batch.

Run this query

mutation {
  createDataRow(
    data: {
      rowData: "<DATA_THAT_NEEDS_TO_BE_LABELED>",
      dataset: {
        connect: {
          id: "<DATASET_ID_HERE>"
        }
      },
    }
  ) {
    id
  }
}

Lastly, after you've imported you'll need to rebuild the queue.

Run this query

mutation {
  updateProject(
    where: { id: "<PROJECT_ID>" }
    data: { queueIsBuilding: true },
  ) {
    id
  }
}