(auth)
REST APIs for managing Authentication
- getWorkspaceAccess - Get access allowances for a particular workspace
- validateApiKey - Validate the current api key.
Checks if generation is permitted for a particular run of the CLI
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
async function run() {
const sdk = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
workspaceID: "<value>",
});
const res = await sdk.auth.getWorkspaceAccess({});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetWorkspaceAccessRequest | ✔️ | The request object to use for the request. |
retries |
utils.RetryConfig | ➖ | Configuration to override the default retry behavior of the client. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetWorkspaceAccessResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Validate the current api key.
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
async function run() {
const sdk = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
workspaceID: "<value>",
});
const res = await sdk.auth.validateApiKey();
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.ValidateApiKeyResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |