(workspaces)
REST APIs for managing Workspaces (speakeasy tenancy)
- create - Create a workspace
- create_token - Create a token for a particular workspace
- delete_token - Delete a token for a particular workspace
- get - Get workspace by context
- get_all - Get workspaces for a user
- get_by_id - Get workspace
- get_feature_flags - Get workspace feature flags
- get_settings - Get workspace settings
- get_team - Get team members for a particular workspace
- get_tokens - Get tokens for a particular workspace
- grant_access - Grant a user access to a particular workspace
- revoke_access - Revoke a user's access to a particular workspace
- update - Update workspace details
- update_settings - Update workspace settings
Creates a workspace
import dateutil.parser
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.create(request={
"created_at": dateutil.parser.isoparse("2024-06-17T07:14:55.338Z"),
"id": "<id>",
"name": "<value>",
"organization_id": "<id>",
"slug": "<value>",
"updated_at": dateutil.parser.isoparse("2024-11-30T17:06:07.804Z"),
"verified": True,
})
assert res.workspace is not None
# Handle response
print(res.workspace)
Parameter | Type | Required | Description |
---|---|---|---|
request |
shared.Workspace | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.CreateWorkspaceResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |
Create a token for a particular workspace
import dateutil.parser
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.create_token(request={
"workspace_token": {
"alg": "<value>",
"created_at": dateutil.parser.isoparse("2023-08-16T02:33:00.784Z"),
"id": "<id>",
"key": "<key>",
"name": "<value>",
"workspace_id": "<id>",
},
"workspace_id": "<id>",
})
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CreateWorkspaceTokenRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.CreateWorkspaceTokenResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |
Delete a token for a particular workspace
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.delete_token(request={
"token_id": "<id>",
"workspace_id": "<id>",
})
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DeleteWorkspaceTokenRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.DeleteWorkspaceTokenResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |
Get information about a particular workspace by context.
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.get()
assert res.workspace_and_organization is not None
# Handle response
print(res.workspace_and_organization)
Parameter | Type | Required | Description |
---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetWorkspaceByContextResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |
Returns a list of workspaces a user has access too
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.get_all()
assert res.workspaces is not None
# Handle response
print(res.workspaces)
Parameter | Type | Required | Description |
---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetWorkspacesResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |
Get information about a particular workspace.
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.get_by_id(request={
"workspace_id": "<id>",
})
assert res.workspace is not None
# Handle response
print(res.workspace)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetWorkspaceRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetWorkspaceResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |
Get workspace feature flags
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.get_feature_flags(request={
"workspace_id": "<id>",
})
assert res.workspace_feature_flag_response is not None
# Handle response
print(res.workspace_feature_flag_response)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetWorkspaceFeatureFlagsRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetWorkspaceFeatureFlagsResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 5XX | application/json |
errors.SDKError | 4XX | */* |
Get settings about a particular workspace.
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.get_settings(request={
"workspace_id": "<id>",
})
assert res.workspace_settings is not None
# Handle response
print(res.workspace_settings)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetWorkspaceSettingsRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetWorkspaceSettingsResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |
Get team members for a particular workspace
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.get_team(request={
"workspace_id": "<id>",
})
assert res.workspace_team_response is not None
# Handle response
print(res.workspace_team_response)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetWorkspaceTeamRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetWorkspaceTeamResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |
Get tokens for a particular workspace
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.get_tokens(request={
"workspace_id": "<id>",
})
assert res.classes is not None
# Handle response
print(res.classes)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetWorkspaceTokensRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetWorkspaceTokensResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |
Grant a user access to a particular workspace
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.grant_access(request={
"email": "[email protected]",
"workspace_id": "<id>",
})
assert res.workspace_invite_response is not None
# Handle response
print(res.workspace_invite_response)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GrantUserAccessToWorkspaceRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GrantUserAccessToWorkspaceResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |
Revoke a user's access to a particular workspace
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.revoke_access(request={
"user_id": "<id>",
"workspace_id": "<id>",
})
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.RevokeUserAccessToWorkspaceRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.RevokeUserAccessToWorkspaceResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |
Update information about a particular workspace.
import dateutil.parser
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.update(request={
"workspace": {
"created_at": dateutil.parser.isoparse("2025-07-28T19:04:48.565Z"),
"id": "<id>",
"name": "<value>",
"organization_id": "<id>",
"slug": "<value>",
"updated_at": dateutil.parser.isoparse("2024-10-16T10:52:42.015Z"),
"verified": True,
},
"workspace_id": "<id>",
})
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.UpdateWorkspaceDetailsRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.UpdateWorkspaceDetailsResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |
Update settings about a particular workspace.
import dateutil.parser
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
with Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as speakeasy:
res = speakeasy.workspaces.update_settings(request={
"workspace_settings": {
"created_at": dateutil.parser.isoparse("2023-07-05T11:43:28.305Z"),
"updated_at": dateutil.parser.isoparse("2024-05-14T05:39:21.874Z"),
"webhook_url": "https://grown-pharmacopoeia.net",
"workspace_id": "<id>",
},
"workspace_id": "<id>",
})
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.UpdateWorkspaceSettingsRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.UpdateWorkspaceSettingsResponse
Error Type | Status Code | Content Type |
---|---|---|
errors.Error | 4XX | application/json |
errors.SDKError | 5XX | */* |