(organizations)
REST APIs for managing Organizations (speakeasy L1 Tenancy construct)
- createFreeTrial - Create a free trial for an organization
- create - Create an organization
- get - Get organization
- getUsage - Get billing usage summary for a particular organization
- getAll - Get organizations for a user
Creates a free trial for an organization
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->organizations->createFreeTrial(
);
if ($response->statusCode === 200) {
// handle response
}
?Operations\CreateFreeTrialResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Creates an organization
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\Organization(
accountType: Shared\AccountType::ScaleUp,
createdAt: Utils\Utils::parseDateTime('2024-11-30T17:06:07.804Z'),
id: '<id>',
name: '<value>',
slug: '<value>',
ssoActivated: false,
telemetryDisabled: false,
updatedAt: Utils\Utils::parseDateTime('2024-04-02T12:48:32.253Z'),
);
$response = $sdk->organizations->create(
request: $request
);
if ($response->organization !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Shared\Organization | ✔️ | The request object to use for the request. |
?Operations\CreateOrganizationResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Get information about a particular organization.
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\GetOrganizationRequest(
organizationID: '<id>',
);
$response = $sdk->organizations->get(
request: $request
);
if ($response->organization !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetOrganizationRequest | ✔️ | The request object to use for the request. |
?Operations\GetOrganizationResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Returns a billing usage summary by target languages for a particular organization
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->organizations->getUsage(
);
if ($response->organizationUsageResponse !== null) {
// handle response
}
?Operations\GetOrganizationUsageResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Returns a list of organizations 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->organizations->getAll(
);
if ($response->organizations !== null) {
// handle response
}
?Operations\GetOrganizationsResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |