API keys of disabled accounts
API keys are tied to user accounts. If a user account is disabled, all API keys associated with that account are also disabled.Create a new API key
To create a new API key:- On the Labelbox home page, click Create API key.
-
On the Create new API key prompt:
- Enter a descriptive name.
- Add a validity time period. The max value is 6 months.
- Select a role for the scope of access permissions.
- Your new key is displayed in the API key created prompt. Use the Copy button to copy the key to the clipboard. It’s strongly recommended to save your new key in a safe location.
- Click Done to close the prompt. After closing the prompt, you won’t be able to retrieve the key.
View and delete API keys
Use the Workplace Settings > API keys tab to view and delete existing API keys. To delete an API key, locate the key you wish to delete and select … > Delete. Once an API key is deleted, it can no longer authenticate API requests. Any app, script, or service using the key loses access to Labelbox. To minimize disruptions, we recommend not deleting keys until you’ve created and replaced them with new ones.Guidelines and best practices
For each active Labelbox account:- API keys access to your Labelbox account and data. Treat API keys like passwords and other credentials.
- The value of an API key can only be retrieved once from the API key created prompt when the key is first created.
- If you lose the value of your API key (or cannot determine how it’s being used), delete it and create a new one.
Client
The Labelbox Client is essential for all SDK workflows. It connects to a Labelbox server with your authentication API key and provides functions for querying and creating data assets.Instantiate Labelbox Client
Use the API key to connect to the Labelbox client:Manage API keys from the SDK
Create an API key
To create a new API key, provide the following:name
: a descriptive nameuser
: an existing user email addressrole
: an existing role (one ofclient.get_roles()
)validity
andtime_unit
: the duration of the API key using an integer (validity
) and aTimeUnit
enum (time_unit
). Validtime_unit
values includeTimeUnit.SECOND
,TimeUnit.MINUTE
,TimeUnit.HOUR
,TimeUnit.DAY
, andTimeUnit.WEEK
.
- minimum `{“validity”:1, time_unit: TimeUnit.MINUTE}
- maximum `{“validity”:25, time_unit: TimeUnit.WEEK}