Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Auth

(auth)

Overview

REST APIs for managing Authentication

Available Operations

getAccessToken

Get or refresh an access token for the current workspace.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

async function run() {
  const sdk = new Speakeasy({
    workspaceID: "<value>",
  });

  const res = await sdk.auth.getAccessToken({
    workspaceId: "<value>",
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetAccessTokenRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetAccessTokenResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getUser

Get information about the current user.

Example Usage

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.getUser();

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetUserResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getWorkspaceAccess

Checks if generation is permitted for a particular run of the CLI

Example Usage

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();

Parameters

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.

Response

Promise<operations.GetWorkspaceAccessResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

validateApiKey

Validate the current api key.

Example Usage

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();

Parameters

Parameter Type Required Description
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.ValidateApiKeyResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /