(Workspaces)
REST APIs for managing Workspaces (speakeasy tenancy)
Creates a workspace
using SpeakeasySDK;
using SpeakeasySDK.Models.Shared;
using System;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
Workspace req = new Workspace() {
CreatedAt = System.DateTime.Parse("2024-06-17T07:14:55.338Z"),
Id = "<id>",
Name = "<value>",
OrganizationId = "<id>",
Slug = "<value>",
UpdatedAt = System.DateTime.Parse("2024-11-30T17:06:07.804Z"),
Verified = false,
};
var res = await sdk.Workspaces.CreateAsync(req);
// handle response
Parameter |
Type |
Required |
Description |
request |
Workspace |
✔️ |
The request object to use for the request. |
CreateWorkspaceResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |
Create a token for a particular workspace
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
using System;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
CreateWorkspaceTokenRequest req = new CreateWorkspaceTokenRequest() {
WorkspaceToken = new WorkspaceToken() {
Alg = "<value>",
CreatedAt = System.DateTime.Parse("2023-08-16T02:33:00.784Z"),
Id = "<id>",
Key = "<key>",
Name = "<value>",
WorkspaceId = "<id>",
},
};
var res = await sdk.Workspaces.CreateTokenAsync(req);
// handle response
CreateWorkspaceTokenResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |
Delete a token for a particular workspace
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
DeleteWorkspaceTokenRequest req = new DeleteWorkspaceTokenRequest() {
TokenID = "<id>",
};
var res = await sdk.Workspaces.DeleteTokenAsync(req);
// handle response
DeleteWorkspaceTokenResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |
Get information about a particular workspace by context.
using SpeakeasySDK;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Workspaces.GetAsync();
// handle response
GetWorkspaceByContextResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |
Returns a list of workspaces a user has access too
using SpeakeasySDK;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Workspaces.GetAllAsync();
// handle response
GetWorkspacesResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |
Get information about a particular workspace.
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
GetWorkspaceRequest req = new GetWorkspaceRequest() {};
var res = await sdk.Workspaces.GetByIDAsync(req);
// handle response
Parameter |
Type |
Required |
Description |
request |
GetWorkspaceRequest |
✔️ |
The request object to use for the request. |
GetWorkspaceResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |
Get workspace feature flags
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
GetWorkspaceFeatureFlagsRequest req = new GetWorkspaceFeatureFlagsRequest() {};
var res = await sdk.Workspaces.GetFeatureFlagsAsync(req);
// handle response
GetWorkspaceFeatureFlagsResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
5XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
4XX |
*/* |
Get settings about a particular workspace.
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
GetWorkspaceSettingsRequest req = new GetWorkspaceSettingsRequest() {};
var res = await sdk.Workspaces.GetSettingsAsync(req);
// handle response
GetWorkspaceSettingsResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |
Get team members for a particular workspace
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
GetWorkspaceTeamRequest req = new GetWorkspaceTeamRequest() {};
var res = await sdk.Workspaces.GetTeamAsync(req);
// handle response
GetWorkspaceTeamResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |
Get tokens for a particular workspace
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
GetWorkspaceTokensRequest req = new GetWorkspaceTokensRequest() {};
var res = await sdk.Workspaces.GetTokensAsync(req);
// handle response
GetWorkspaceTokensResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |
Grant a user access to a particular workspace
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
GrantUserAccessToWorkspaceRequest req = new GrantUserAccessToWorkspaceRequest() {
Email = "[email protected]",
};
var res = await sdk.Workspaces.GrantAccessAsync(req);
// handle response
GrantUserAccessToWorkspaceResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |
Revoke a user's access to a particular workspace
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
RevokeUserAccessToWorkspaceRequest req = new RevokeUserAccessToWorkspaceRequest() {
UserId = "<id>",
};
var res = await sdk.Workspaces.RevokeAccessAsync(req);
// handle response
RevokeUserAccessToWorkspaceResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |
Update information about a particular workspace.
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
using System;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
UpdateWorkspaceDetailsRequest req = new UpdateWorkspaceDetailsRequest() {
Workspace = new Workspace() {
CreatedAt = System.DateTime.Parse("2025-07-28T19:04:48.565Z"),
Id = "<id>",
Name = "<value>",
OrganizationId = "<id>",
Slug = "<value>",
UpdatedAt = System.DateTime.Parse("2024-10-16T10:52:42.015Z"),
Verified = false,
},
};
var res = await sdk.Workspaces.UpdateAsync(req);
// handle response
UpdateWorkspaceDetailsResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |
Update settings about a particular workspace.
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
using System;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
UpdateWorkspaceSettingsRequest req = new UpdateWorkspaceSettingsRequest() {
WorkspaceSettings = new WorkspaceSettings() {
CreatedAt = System.DateTime.Parse("2023-07-05T11:43:28.305Z"),
UpdatedAt = System.DateTime.Parse("2024-05-14T05:39:21.874Z"),
WebhookUrl = "https://grown-pharmacopoeia.net",
WorkspaceId = "<id>",
},
};
var res = await sdk.Workspaces.UpdateSettingsAsync(req);
// handle response
UpdateWorkspaceSettingsResponse
Error Type |
Status Code |
Content Type |
SpeakeasySDK.Models.Errors.Error |
4XX |
application/json |
SpeakeasySDK.Models.Errors.SDKException |
5XX |
*/* |