Table of Contents

Getting started

Alex Cota Updated by Alex Cota

Root endpoint

https://api.labelbox.com/graphql

Create API key

  1. Log in to app.labelbox.com.
  2. Click “Account” from the upper-right dropdown menu.
  3. From the API tab, click “Create API Key”.
  4. Copy the API key to your clipboard by clicking the blue icon. The API key will be hidden once you leave this page so make sure to save your API Key somewhere else.

Authentication

Authentication tokens (API Keys) are accepted by our GraphQL API in one of two ways.

  1. Provide as an authorization header [RECOMMENDED]:
# Pass API key as a header to make a graphql query
curl 'https://api.labelbox.com/graphql' \
-H 'Authorization: Bearer <API_KEY_HERE>' \
-H 'content-type: application/json' \
-d '{"query":"[QUERY HERE]"}'

# Pass API key as a header to request a mask for an annotated object
curl 'https://api.labelbox.com/masks/feature/:id' \
-H 'Authorization: Bearer <API_KEY_HERE>'
  1. Provide as a query parameter. We do not recommend sending API keys as a query parameter for GraphQL queries.
# Passing API key as a query parameter to request a mask for an annotated object
curl 'https://api.labelbox.com/masks/feature/:id?token=<API_KEY_HERE>'

Rate limiting

If you hit the rate limit, you’ll get a 429 status code and a retry-after response header that will contain a value for the number of seconds to wait before making a follow-up request.

Was this page helpful?

Intro to the GraphQL API

Data types overview

Contact