Get Workspace
Retrieve workspace details including RBAC status and configuration.
Endpoint
GET /v1/workspaces/{workspaceId}Authentication
Requires API key authentication with a valid access token.
Request
curl -X GET \
'https://api.sharely.ai/v1/workspaces/{workspaceId}' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'organizationid: your-organization-id'Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string (UUID) | Yes | The unique identifier of the workspace |
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token with access token |
organizationid | string (UUID) | Yes | Your organization ID |
Content-Type | string | Yes | Must be application/json |
Response
Success Response (200 OK)
{
"id": "264393d7-6379-453a-9535-e2452e972fdc",
"name": "My Workspace",
"organizationId": "org-uuid",
"rbacStatus": "ACTIVE",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-11-14T15:45:00Z",
"settings": {
"defaultLanguage": "en",
"features": ["rbac", "multilingual"]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Workspace unique identifier |
name | string | Workspace name |
organizationId | string (UUID) | Parent organization ID |
rbacStatus | string | RBAC mode: ACTIVE or INACTIVE |
createdAt | string (ISO 8601) | Workspace creation timestamp |
updatedAt | string (ISO 8601) | Last update timestamp |
settings | object | Workspace configuration settings |
Error Responses
401 Unauthorized
{
"error": "Unauthorized",
"message": "Invalid or missing access token"
}403 Forbidden
{
"error": "Forbidden",
"message": "Insufficient permissions for this workspace"
}404 Not Found
{
"error": "Not Found",
"message": "Workspace not found"
}Example Usage
Node.js
const fetch = require('node-fetch');
async function getWorkspace(workspaceId, accessToken, organizationId) {
const response = await fetch(
`https://api.sharely.ai/v1/workspaces/${workspaceId}`,
{
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'organizationid': organizationId
}
}
);
if (!response.ok) {
throw new Error(`Failed to get workspace: ${response.status}`);
}
return await response.json();
}Python
import requests
def get_workspace(workspace_id, access_token, organization_id):
response = requests.get(
f'https://api.sharely.ai/v1/workspaces/{workspace_id}',
headers={
'Authorization': f'Bearer {access_token}',
'Content-Type': 'application/json',
'organizationid': organization_id
}
)
response.raise_for_status()
return response.json()Related Endpoints
- Update RBAC Status - Enable/disable RBAC
- Check Background Jobs - Monitor async operations