(workspaces)
REST APIs for managing Workspaces (speakeasy tenancy)
- create - Create a workspace
- createToken - Create a token for a particular workspace
- deleteToken - Delete a token for a particular workspace
- getByID - Get workspace
- get - Get workspace by context
- getFeatureFlags - Get workspace feature flags
- getSettings - Get workspace settings
- getTeam - Get team members for a particular workspace
- getTokens - Get tokens for a particular workspace
- getAll - Get workspaces for a user
- grantAccess - Grant a user access to a particular workspace
- revokeAccess - Revoke a user's access to a particular workspace
- setFeatureFlags - Set workspace feature flags
- update - Update workspace details
- updateSettings - Update workspace settings
Creates a workspace
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
use Speakeasy\SpeakeasyClientSDK\Utils;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Shared\Workspace(
createdAt: Utils\Utils::parseDateTime('2024-06-17T07:14:55.338Z'),
id: '<id>',
name: '<value>',
organizationId: '<id>',
slug: '<value>',
updatedAt: Utils\Utils::parseDateTime('2024-11-30T17:06:07.804Z'),
verified: false,
);
$response = $sdk->workspaces->create(
request: $request
);
if ($response->workspace !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Shared\Workspace | ✔️ | The request object to use for the request. |
?Operations\CreateWorkspaceResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Create a token for a particular workspace
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
use Speakeasy\SpeakeasyClientSDK\Utils;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\CreateWorkspaceTokenRequest(
workspaceToken: new Shared\WorkspaceToken(
alg: '<value>',
createdAt: Utils\Utils::parseDateTime('2023-08-16T02:33:00.784Z'),
id: '<id>',
key: '<key>',
name: '<value>',
workspaceId: '<id>',
),
workspaceId: '<id>',
);
$response = $sdk->workspaces->createToken(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\CreateWorkspaceTokenRequest | ✔️ | The request object to use for the request. |
?Operations\CreateWorkspaceTokenResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Delete a token for a particular workspace
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\DeleteWorkspaceTokenRequest(
tokenID: '<id>',
workspaceId: '<id>',
);
$response = $sdk->workspaces->deleteToken(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\DeleteWorkspaceTokenRequest | ✔️ | The request object to use for the request. |
?Operations\DeleteWorkspaceTokenResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Get information about a particular workspace.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\GetWorkspaceRequest(
workspaceId: '<id>',
);
$response = $sdk->workspaces->getByID(
request: $request
);
if ($response->workspace !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetWorkspaceRequest | ✔️ | The request object to use for the request. |
?Operations\GetWorkspaceResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Get information about a particular workspace by context.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$response = $sdk->workspaces->get(
);
if ($response->workspaceAndOrganization !== null) {
// handle response
}
?Operations\GetWorkspaceByContextResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Get workspace feature flags
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\GetWorkspaceFeatureFlagsRequest(
workspaceId: '<id>',
);
$response = $sdk->workspaces->getFeatureFlags(
request: $request
);
if ($response->workspaceFeatureFlagResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetWorkspaceFeatureFlagsRequest | ✔️ | The request object to use for the request. |
?Operations\GetWorkspaceFeatureFlagsResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 5XX | application/json |
Errorors\SDKException | 4XX | */* |
Get settings about a particular workspace.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\GetWorkspaceSettingsRequest(
workspaceId: '<id>',
);
$response = $sdk->workspaces->getSettings(
request: $request
);
if ($response->workspaceSettings !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetWorkspaceSettingsRequest | ✔️ | The request object to use for the request. |
?Operations\GetWorkspaceSettingsResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Get team members for a particular workspace
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\GetWorkspaceTeamRequest(
workspaceId: '<id>',
);
$response = $sdk->workspaces->getTeam(
request: $request
);
if ($response->workspaceTeamResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetWorkspaceTeamRequest | ✔️ | The request object to use for the request. |
?Operations\GetWorkspaceTeamResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Get tokens for a particular workspace
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\GetWorkspaceTokensRequest(
workspaceId: '<id>',
);
$response = $sdk->workspaces->getTokens(
request: $request
);
if ($response->classes !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetWorkspaceTokensRequest | ✔️ | The request object to use for the request. |
?Operations\GetWorkspaceTokensResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Returns a list of workspaces a user has access too
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$response = $sdk->workspaces->getAll(
);
if ($response->workspaces !== null) {
// handle response
}
?Operations\GetWorkspacesResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Grant a user access to a particular workspace
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\GrantUserAccessToWorkspaceRequest(
email: '[email protected]',
workspaceId: '<id>',
);
$response = $sdk->workspaces->grantAccess(
request: $request
);
if ($response->workspaceInviteResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GrantUserAccessToWorkspaceRequest | ✔️ | The request object to use for the request. |
?Operations\GrantUserAccessToWorkspaceResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Revoke a user's access to a particular workspace
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\RevokeUserAccessToWorkspaceRequest(
userId: '<id>',
workspaceId: '<id>',
);
$response = $sdk->workspaces->revokeAccess(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\RevokeUserAccessToWorkspaceRequest | ✔️ | The request object to use for the request. |
?Operations\RevokeUserAccessToWorkspaceResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Set workspace feature flags
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Shared\WorkspaceFeatureFlagRequest(
featureFlags: [
Shared\WorkspaceFeatureFlag::SkipSchemaRegistry,
],
);
$response = $sdk->workspaces->setFeatureFlags(
request: $request
);
if ($response->workspaceFeatureFlagResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Shared\WorkspaceFeatureFlagRequest | ✔️ | The request object to use for the request. |
?Operations\SetWorkspaceFeatureFlagsResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 5XX | application/json |
Errorors\SDKException | 4XX | */* |
Update information about a particular workspace.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
use Speakeasy\SpeakeasyClientSDK\Utils;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\UpdateWorkspaceDetailsRequest(
workspace: new Shared\Workspace(
createdAt: Utils\Utils::parseDateTime('2025-07-28T19:04:48.565Z'),
id: '<id>',
name: '<value>',
organizationId: '<id>',
slug: '<value>',
updatedAt: Utils\Utils::parseDateTime('2024-10-16T10:52:42.015Z'),
verified: false,
),
workspaceId: '<id>',
);
$response = $sdk->workspaces->update(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\UpdateWorkspaceDetailsRequest | ✔️ | The request object to use for the request. |
?Operations\UpdateWorkspaceDetailsResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Update settings about a particular workspace.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
use Speakeasy\SpeakeasyClientSDK\Utils;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\UpdateWorkspaceSettingsRequest(
workspaceSettings: new Shared\WorkspaceSettings(
createdAt: Utils\Utils::parseDateTime('2023-07-05T11:43:28.305Z'),
updatedAt: Utils\Utils::parseDateTime('2024-05-14T05:39:21.874Z'),
webhookUrl: 'https://grown-pharmacopoeia.net',
workspaceId: '<id>',
),
workspaceId: '<id>',
);
$response = $sdk->workspaces->updateSettings(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\UpdateWorkspaceSettingsRequest | ✔️ | The request object to use for the request. |
?Operations\UpdateWorkspaceSettingsResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |