Check the Lock Status of a Workspace
API Endpoint: check_workspace_lock
Checks the Lock status of a workspace
Important
An API Key is required for ALL private workspace activities
The API Key name component can be added to your header using any of the following ways, “X-CKAN-API-Key”, “EDX-API-Key”, or “Authorization”.
Attention
Add the
"User-Agent":
parameter within theheaders
of the API requestSet
"User-Agent":
to the value"EDX-USER"
Workspace Lock Key Features
A workspace can be lock and unlocked within the EDX UI and via API script
Locking a Workspace
- ONLY the following roles can lock a workspace
System Administrator
Workspace Administrator
Unlocking a Workspace
- ONLY the following roles can unlock a workspace
System Administrator
Workspace Administrator who locked the workspace
Feature Functionaility in a Locked Workspace
When a user locks a workspace, functionality within the workspace is limited
The user who locks the workspace will have no restrictions of features within a workspace
Note
If the Lock Restriction
field in the tables below are True
, the feature is restricted when a workspace is locked
Parameters for Workspace Lock
Feature Name |
Lock Restriction |
---|---|
|
True |
|
True |
|
True |
|
True |
|
True |
|
False |
|
False |
|
False |
|
True |
|
True |
|
True |
|
True |
|
True |
|
True |
|
True |
|
True |
Feature Name |
Lock Restriction |
---|---|
|
True |
|
False |
|
False |
|
True |
|
True |
|
False |
|
True |
|
True |
|
True |
|
True |
|
True |
|
True |
|
True |
Feature Name |
Lock Restriction |
---|---|
|
True |
|
False |
|
False |
|
False |
|
False |
|
False |
|
True |
|
True |
|
True |
|
True |
Parameter Definitions
Parameter Name |
Description |
Required Fields |
---|---|---|
|
ID associated with the workspace |
Required |
|
API key associated with the the user |
Required |
|
Boolean grabbed from database table to identify if workspace is locked |
N/A |
Example: Check the Lock Status of a Workspace
Attention
Add the
"User-Agent":
parameter within theheaders
of the API requestSet
"User-Agent":
to the value"EDX-USER"
Note
- The
is_locked
output parameter’s value is gathered from the workspace lock database table If
is_locked
value isTrue
, the workspace is lockedIf
is_locked
value isFalse
, the workspace is unlocked
import requests
headers = {
'EDX-API-Key': 'INSERT-API-KEY-HERE',
'User-Agent': 'EDX-USER',
'Content-Type': 'application/json',
'Accept':'application/json'
}
data = {
'workspace_id': 'workspace-id-or-url-name'
}
url = 'https://edx.netl.doe.gov/api/3/action/check_workspace_lock'
r = requests.post(
url, # URL to API endpoint
headers=headers, # Headers dictionary
json=data, # Dictionary of data params
)
r_json = r.json()
print (r.json())
{'help': '/api/3/action/help_show?name=check_workspace_lock', 'success': True,
'result': {'is_locked': True, 'locked_by': 'EDX Administrator (edxadministrator@edx.com)', 'date_locked': '2025-05-12 12:32'}}
{'help': '/api/3/action/help_show?name=check_workspace_lock', 'success': True,
'result': {'is_locked': False, 'unlocked_by': 'EDX Administrator (edxadministrator@edx.com)', 'date_unlocked': '2025-05-12 12:32'}}