npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@liblab/sdk

v0.1.499

Published

Liblab

Readme

Liblab Typescript SDK 0.1.499

The Typescript SDK for Liblab.

  • API version: 0.1.499
  • SDK version: 0.1.499

Table of Contents

Installation

npm install sdk

Authentication

To see whether an endpoint needs a specific type of authentication check the endpoint's documentation.

Access Token

The Liblab API uses access tokens as a form of authentication. You can set the access token when initializing the SDK through the constructor:

const sdk = new Liblab('YOUR_ACCESS_TOKEN')

Or through the setAccessToken method:

const sdk = new Liblab()
sdk.setAccessToken('YOUR_ACCESS_TOKEN')

You can also set it for each service individually:

const sdk = new Liblab()
sdk.build.setAccessToken('YOUR_ACCESS_TOKEN')

Sample Usage

Here is a simple program demonstrating usage of this SDK. It can also be found in the examples/src/index.ts file in this directory.

When running the sample make sure to use npm install to install all the dependencies.

import { Liblab } from '@liblab/sdk';


const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  try {
    const result = await sdk.build
      .getBuildStatuses();
    console.log(result);
  } catch (err) {
    const error = err as Error;
    console.error(error.message);
  }
})();

Environments

Here is the list of all available environments:

DEFAULT = 'https://api-dev.liblab.com',
PRODUCTION = 'https://api.liblab.com',
STAGING = 'https://api-staging.liblab.com',
DEVELOPMENT = 'https://api-dev.liblab.com'

How to set the environment:

const sdk = new Liblab();
sdk.setEnvironment(Environment.DEFAULT);

Liblab Services

A list of all services and services methods.

Build

| Method | Description | | :------------------------------------------ | :---------- | | createBuild | | | getBuilds | | | createSimpleBuild | | | createBuildArtifact | | | getBuildStatuses | | | getById | | | removeById | | | tag | | | untag | | | approveBuild | | | unApproveBuild | |

Api

| Method | Description | | :------------------------------------------------------ | :---------- | | getApiBuilds | | | getApiBuildTags | | | getApiSdks | | | getApiDocs | | | createApi | | | getApis | | | searchApis | | | getApiById | | | updateApi | | | getApiMembers | | | removeApi | | | getApiByOrgSlugAndApiSlug | |

Org

| Method | Description | | :---------------------------------- | :---------- | | createOrg | | | getOrgs | | | searchOrgs | | | getOrgById | | | updateOrg | | | removeOrg | | | getApisByOrg | | | getOrgJobs | | | getDocsByOrg | | | getBuildByOrg | | | getOrgApiBuilds | | | getOrgArtifacts | |

OrgMember

| Method | Description | | :-------------------------------------- | :---------- | | createMember | | | getByOrgId | | | updateMember | | | removeMember | | | leaveOrg | | | enableAllMembers | | | disableAllMembers | |

Artifact

| Method | Description | | :------------------------------------------ | :---------- | | createArtifact | | | getArtifacts | | | getArtifactStatuses | | | getArtifactLogs | | | getArtifactById | | | removeArtifact | |

Sdk

| Method | Description | | :------------------------ | :---------- | | createSdk | | | findSdks | | | getSdkById | | | removeSdk | |

Doc

| Method | Description | | :---------------------------------------------------------------------- | :---------- | | getApprovedByOrgSlugAndApiSlug | | | getAllApprovedByOrgSlugAndApiSlug | | | createDoc | | | findDocs | | | approve | | | unapprove | | | getDocById | | | removeDoc | | | updateDoc | | | getDownloadUrl | |

HubSpot

| Method | Description | | :-------------------------------- | :---------- | | sendShadowForm | |

OrgSubscriptions

| Method | Description | | :-------------------------------------------------------------------------------- | :---------- | | getActiveSubscription | | | cancelActiveSubscription | | | getActiveSubscriptionStatus | | | getSubscriptionPaymentMethodUpdateLink | | | getCheckoutLink | |

OrgMcpSubscriptions

| Method | Description | | :---------------------------------------------- | :---------- | | getMcpSubscription | | | updateMcpSubscription | |

Subscriptions

| Method | Description | | :---------------------------------------------------- | :---------- | | getSubscriptionsOverview | |

PaymentProvider

| Method | Description | | :------------------------------------------------------ | :---------- | | stripeWebhook | | | syncStripeSubscriptions | | | createStripePortalSession | |

User

| Method | Description | | :-------------------------------------------------- | :---------- | | getCurrentUser | | | createUser | | | getUsers | | | getUserById | | | updateUser | | | removeUser | | | updateEmailSubscription | | | getUserOrgs | | | getUserApis | |

McpServer

| Method | Description | | :-------------------------------------------------------------- | :---------- | | createMcpServerDeployment | | | getMcpServerDeployments | | | getMcpServerDeploymentMetrics | | | orgHadPreviousMcpDeployments | | | getMcpServerDeploymentById | | | updateMcpServerDeployment | | | deleteMcpServerDeployment | | | getMcpServerPauseStatus | | | setMcpServerPauseStatus | | | setMcpCustomHostname | | | deleteMcpCustomHostname | | | verifyMcpCustomHostname | |

Snippets

| Method | Description | | :-------------------------------------------- | :---------- | | getSnippetsByBuildId | |

Integration

| Method | Description | | :------------------------------------------------------------------ | :---------- | | createIntegrationBuild | | | createPostmanIntegrationBuild | | | createPostmanServiceWorkerToken | | | getPostmanServiceWorkerTokens | | | createIntegrationCredentials | | | getIntegrationCredentials | | | updateIntegrationCredentials | | | deleteIntegrationCredentials | |

Workflows

| Method | Description | | :---------------------------------- | :---------- | | uploadWorkflows | |

SpecValidation

| Method | Description | | :-------------------------------------- | :---------- | | validateSpec | | | getSpecValidation | |

Token

| Method | Description | | :---------------------------------------- | :---------- | | createToken | | | findTokensByUserId | | | getTokenById | | | removeToken | |

Invitation

| Method | Description | | :---------------------------------------- | :---------- | | createOrgInvite | | | redeemInvite | | | declineInvite | | | cancelInvite | | | getReceivedInvites | | | getSentInvites | | | searchInvites | | | getInviteByCode | |

Auth0

| Method | Description | | :-------------------------------------------------------- | :---------- | | resetPasswordAuth0 | | | passwordlessVerifyPassword | | | passwordlessSetupPassword | |

Plan

| Method | Description | | :---------------------------------- | :---------- | | getEnabledPlans | |

Invoice

| Method | Description | | :-------------------------------- | :---------- | | getOrgInvoices | |

HealthCheck

| Method | Description | | :-------------------------------------------------------- | :---------- | | healthCheckControllerCheck | |

Tags

| Method | Description | | :---------------- | :---------- | | create | | | search | |

Ai

| Method | Description | | :-------------------------------- | :-------------- | | queryDocuments | Query documents |

Feedback

| Method | Description | | :---------------------------- | :---------- | | sendFeedback | |

UserEvent

| Method | Description | | :-------------------------------------------------- | :---------- | | getUserEvents | | | exportUserEventsToCsv | | | trackUserPublishPrEvent | |

ThirdPartyApplications

| Method | Description | | :---------------------------------------------------------------------------------------- | :---------- | | thirdPartyApplicationsControllerCreate | | | thirdPartyApplicationsControllerGetAll | | | thirdPartyApplicationsControllerGetByOrgId | | | thirdPartyApplicationsControllerDeleteById | |

SpecFixer

| Method | Description | | :------------------ | :---------- | | fixSpec | |

All Methods

createBuild

  • HTTP Method: POST
  • Endpoint: /builds

Required Parameters

| input | object | Request body. |

Return Type

BuildResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {};
  const result = await sdk.build.createBuild(input);
  console.log(result);
})();

getBuilds

  • HTTP Method: GET
  • Endpoint: /builds

Required Parameters

| Name | Type | Description | | :------ | :----- | :---------- | | offset | number | | | limit | number | | | orgId | number | | | apiSlug | string | |

Return Type

PaginatedBuildResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.getBuilds(42, 10, 1, 'my-api');
  console.log(result);
})();

createSimpleBuild

  • HTTP Method: POST
  • Endpoint: /builds/simple

Required Parameters

| input | object | Request body. |

Return Type

BuildResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    apiId: 1,
    authentication: {},
    baseUrl: 'https://api-dev.liblab.com',
    docs: ['enhancedApiSpec', 'snippets', 'api'],
    languages: ['typescript'],
    liblabVersion: '2',
    sdkName: 'liblab',
    sdkVersion: '1.0.0',
  };
  const result = await sdk.build.createSimpleBuild(input);
  console.log(result);
})();

createBuildArtifact

  • HTTP Method: POST
  • Endpoint: /builds/{id}/artifact

Required Parameters

| Name | Type | Description | | :---- | :----- | :------------ | | id | number | | | input | object | Request body. |

Return Type

BuildResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {};
  const result = await sdk.build.createBuildArtifact(input, -78121726.23106393);
  console.log(result);
})();

getBuildStatuses

  • HTTP Method: GET
  • Endpoint: /builds/statuses

Return Type

GetBuildStatusesResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.getBuildStatuses();
  console.log(result);
})();

getById

  • HTTP Method: GET
  • Endpoint: /builds/{id}

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

GetBuildByIdResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.getById(28934759.900535136);
  console.log(result);
})();

removeById

  • HTTP Method: DELETE
  • Endpoint: /builds/{buildId}/{apiSlug}/{orgId}

Required Parameters

| Name | Type | Description | | :------ | :----- | :---------- | | buildId | number | | | apiSlug | string | | | orgId | number | |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.removeById(-26796701.109798834, 'apiSlug', -23796043.434081852);
  console.log(result);
})();

tag

  • HTTP Method: POST
  • Endpoint: /builds/{buildId}/tag/{tagId}

Required Parameters

| Name | Type | Description | | :------ | :----- | :---------- | | buildId | number | | | tagId | number | |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.tag(-69686100.35669544, -2713507.809237331);
  console.log(result);
})();

untag

  • HTTP Method: POST
  • Endpoint: /builds/{buildId}/untag/{tagId}

Required Parameters

| Name | Type | Description | | :------ | :----- | :---------- | | buildId | number | | | tagId | number | |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.untag(21625036.177896068, -9712276.912692055);
  console.log(result);
})();

approveBuild

  • HTTP Method: PATCH
  • Endpoint: /builds/{buildId}/approve

Required Parameters

| Name | Type | Description | | :------ | :----- | :---------- | | buildId | number | |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.approveBuild(98591544.29773653);
  console.log(result);
})();

unApproveBuild

  • HTTP Method: PATCH
  • Endpoint: /builds/{buildId}/unapprove

Required Parameters

| Name | Type | Description | | :------ | :----- | :---------- | | buildId | number | |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.unApproveBuild(-44411163.54278383);
  console.log(result);
})();

getApiBuilds

  • HTTP Method: GET
  • Endpoint: /apis/{id}/builds

Required Parameters

| Name | Type | Description | | :----- | :----- | :---------- | | id | number | | | offset | number | | | limit | number | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :----------- | :------------------------------------------- | :---------- | | sortBy | SortBy | | | direction | Direction | | | statuses | string[] | | | tags | number[] | | | createdByIds | number[] | |

Return Type

PaginatedBuildResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiBuilds(104909.5033967495, 42, 10, {
    sortBy: 'status',
    direction: 'asc',
    statuses: ['FAILURE'],
    tags: [1],
    createdByIds: [1],
  });
  console.log(result);
})();

getApiBuildTags

  • HTTP Method: GET
  • Endpoint: /apis/{id}/builds/tags

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

GetApiBuildTagsResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiBuildTags(60617137.93982947);
  console.log(result);
})();

getApiSdks

  • HTTP Method: GET
  • Endpoint: /apis/{id}/sdks

Required Parameters

| Name | Type | Description | | :----- | :----- | :---------- | | id | number | | | offset | number | | | limit | number | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :----------- | :------------------------------------------- | :---------- | | statuses | string[] | | | tags | number[] | | | createdByIds | number[] | | | languages | string[] | | | sortBy | ApiSortBy | | | direction | Direction | |

Return Type

PaginatedSdkResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiSdks(-54521931.00827518, 42, 10, {
    statuses: ['FAIL'],
    tags: [1],
    createdByIds: [1],
    languages: ['JAVA'],
    sortBy: 'createdAt',
    direction: 'asc',
  });
  console.log(result);
})();

getApiDocs

  • HTTP Method: GET
  • Endpoint: /apis/{id}/docs

Required Parameters

| Name | Type | Description | | :----- | :----- | :---------- | | id | number | | | offset | number | | | limit | number | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :----------- | :------------------------------------------- | :---------- | | sortBy | ApiSortBy | | | direction | Direction | | | statuses | string[] | | | tags | number[] | | | createdByIds | number[] | |

Return Type

PaginatedDocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiDocs(92022323.83281216, 42, 10, {
    sortBy: 'createdAt',
    direction: 'asc',
    statuses: ['FAIL'],
    tags: [1],
    createdByIds: [1],
  });
  console.log(result);
})();

createApi

  • HTTP Method: POST
  • Endpoint: /apis

Required Parameters

| input | object | Request body. |

Return Type

ApiResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {};
  const result = await sdk.api.createApi(input);
  console.log(result);
})();

getApis

  • HTTP Method: GET
  • Endpoint: /apis

Required Parameters

| Name | Type | Description | | :---- | :----- | :---------- | | orgId | number | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :------ | :----- | :---------- | | apiSlug | string | |

Return Type

GetApisResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApis(1, { apiSlug: 'my-api' });
  console.log(result);
})();

searchApis

  • HTTP Method: GET
  • Endpoint: /apis/search

Required Parameters

| Name | Type | Description | | :----- | :----- | :---------- | | offset | number | | | limit | number | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :-------- | :------------------------------------------------- | :---------- | | name | string | | | sortBy | ApiSortBy | | | orgId | number | | | direction | ApiDirection | | | orgIds | number[] | |

Return Type

ApisSearchPaginatedResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.searchApis(42, 10, {
    name: 'alpaca',
    sortBy: 'createdAt',
    orgId: 1,
    direction: 'asc',
    orgIds: [1],
  });
  console.log(result);
})();

getApiById

  • HTTP Method: GET
  • Endpoint: /apis/{id}

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

ApiResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiById(65184548.17721003);
  console.log(result);
})();

updateApi

  • HTTP Method: PATCH
  • Endpoint: /apis/{id}

Required Parameters

| Name | Type | Description | | :---- | :----- | :------------ | | id | number | | | input | object | Request body. |

Return Type

ApiResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { name: 'My api name', version: '1.0.1' };
  const result = await sdk.api.updateApi(input, 65624426.02952179);
  console.log(result);
})();

getApiMembers

  • HTTP Method: GET
  • Endpoint: /apis/{id}/members

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

GetApiMembersResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiMembers(-34910251.958310924);
  console.log(result);
})();

removeApi

  • HTTP Method: DELETE
  • Endpoint: /apis/delete/{apiSlug}/{orgId}

Required Parameters

| Name | Type | Description | | :------ | :----- | :---------- | | apiSlug | string | | | orgId | number | |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.removeApi('apiSlug', 36332635.412119925);
  console.log(result);
})();

getApiByOrgSlugAndApiSlug

  • HTTP Method: GET
  • Endpoint: /apis/{orgSlug}/{apiSlug}

Required Parameters

| Name | Type | Description | | :------ | :----- | :---------- | | orgSlug | string | | | apiSlug | string | |

Return Type

GetApiByOrgSlugAndApiSlugResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiByOrgSlugAndApiSlug('orgSlug', 'apiSlug');
  console.log(result);
})();

createOrg

  • HTTP Method: POST
  • Endpoint: /orgs

Required Parameters

| input | object | Request body. |

Return Type

OrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    description: 'Example Org Description',
    domain: 'business.com',
    logoUrl: 'https://liblab.com/images/logo.png',
    name: 'Example Org',
    website: 'https://example.com',
  };
  const result = await sdk.org.createOrg(input);
  console.log(result);
})();

getOrgs

  • HTTP Method: GET
  • Endpoint: /orgs

Required Parameters

| Name | Type | Description | | :----- | :----- | :---------- | | offset | number | | | limit | number | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :-------- | :------------------------------------------- | :---------- | | direction | Direction | | | sortBy | OrgSortBy | |

Return Type

AdminPaginatedOrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getOrgs(42, 10, { direction: 'asc', sortBy: 'status' });
  console.log(result);
})();

searchOrgs

  • HTTP Method: GET
  • Endpoint: /orgs/search

Required Parameters

| Name | Type | Description | | :----- | :----- | :---------- | | offset | number | | | limit | number | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :------ | :----- | :---------- | | website | string | | | domain | string | | | name | string | |

Return Type

AdminPaginatedOrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.searchOrgs(42, 10, {
    website: 'https://liblab.com',
    domain: 'liblab.com',
    name: 'liblab',
  });
  console.log(result);
})();

getOrgById

  • HTTP Method: GET
  • Endpoint: /orgs/{id}

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

GetOrgByIdResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getOrgById(5055133.758084372);
  console.log(result);
})();

updateOrg

  • HTTP Method: PATCH
  • Endpoint: /orgs/{id}

Required Parameters

| Name | Type | Description | | :---- | :----- | :------------ | | id | number | | | input | object | Request body. |

Return Type

OrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    description: 'Example Org Description',
    domain: 'example.com',
    isAllowedForBeta: true,
    logoUrl: 'https://liblab.com/images/logo.png',
    name: 'Example Org',
    remainingCredits: 19,
    website: 'https://example.com',
  };
  const result = await sdk.org.updateOrg(input, 74183722.44069493);
  console.log(result);
})();

removeOrg

  • HTTP Method: DELETE
  • Endpoint: /orgs/{id}

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.removeOrg(29484797.30473128);
  console.log(result);
})();

getApisByOrg

  • HTTP Method: GET
  • Endpoint: /orgs/{id}/apis

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

GetApisByOrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getApisByOrg(90300358.1671145);
  console.log(result);
})();

getOrgJobs

  • HTTP Method: GET
  • Endpoint: /orgs/{id}/jobs

Required Parameters

| Name | Type | Description | | :----- | :----- | :---------- | | id | number | | | offset | number | | | limit | number | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :----------- | :------------------------------------------- | :---------- | | sortBy | OrgSortBy | | | direction | Direction | | | statuses | string[] | | | createdByIds | number[] | | | apiSlug | string | | | apiVersion | string | | | buildType | string[] | |

Return Type

PaginatedOrgJobsResponseWithTotalCount

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getOrgJobs(256439.15729390085, 42, 10, {
    sortBy: 'status',
    direction: 'asc',
    statuses: ['FAILURE'],
    createdByIds: [1],
    apiSlug: 'my-api',
    apiVersion: '1.0.0',
    buildType: ['SDK', 'DOC'],
  });
  console.log(result);
})();

getDocsByOrg

  • HTTP Method: GET
  • Endpoint: /orgs/{id}/docs

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

GetDocsByOrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getDocsByOrg(-32938643.7227936);
  console.log(result);
})();

getBuildByOrg

  • HTTP Method: GET
  • Endpoint: /orgs/{id}/builds

Required Parameters

| Name | Type | Description | | :----- | :----- | :---------- | | id | number | | | offset | number | | | limit | number | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :----------- | :------------------------------------------- | :---------- | | sortBy | OrgSortBy | | | direction | Direction | | | statuses | string[] | | | tags | number[] | | | createdByIds | number[] | | | apiSlug | string | | | apiVersion | string | |

Return Type

PaginatedOrgBuildsWithJobsResponseWithTotalCount

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getBuildByOrg(-67762136.76150067, 42, 10, {
    sortBy: 'status',
    direction: 'asc',
    statuses: ['FAILURE'],
    tags: [1],
    createdByIds: [1],
    apiSlug: 'my-api',
    apiVersion: '1.0.0',
  });
  console.log(result);
})();

getOrgApiBuilds

  • HTTP Method: GET
  • Endpoint: /orgs/{id}/api-builds

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

GetOrgApiBuildsResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getOrgApiBuilds(82970657.07409507);
  console.log(result);
})();

getOrgArtifacts

  • HTTP Method: GET
  • Endpoint: /orgs/{id}/artifacts

Required Parameters

| Name | Type | Description | | :----- | :----- | :---------- | | id | number | | | offset | number | | | limit | number | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :------------ | :--------------------------------------------------- | :---------- | | sortBy | OrgSortBy | | | direction | OrgDirection | | | artifactTypes | ArtifactTypes | | | statuses | OrgStatuses | | | createdByIds | number[] | |

Return Type

PaginatedOrgArtifactsResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getOrgArtifacts(19039710.90757732, 42, 10, {
    sortBy: 'status',
    direction: 'asc',
    artifactTypes: ['SDK'],
    statuses: ['IN_PROGRESS'],
    createdByIds: [1],
  });
  console.log(result);
})();

createMember

  • HTTP Method: POST
  • Endpoint: /orgs/{orgId}/members

Required Parameters

| Name | Type | Description | | :---- | :----- | :------------ | | orgId | number | | | input | object | Request body. |

Return Type

OrgMemberResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { role: 'MEMBER', userId: 1 };
  const result = await sdk.orgMember.createMember(input, 38281872.23550409);
  console.log(result);
})();

getByOrgId

  • HTTP Method: GET
  • Endpoint: /orgs/{orgId}/members

Required Parameters

| Name | Type | Description | | :----- | :----- | :---------- | | orgId | number | | | offset | number | | | limit | number | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :-------- | :------------------------------------------------------- | :---------- | | email | string | | | firstName | string | | | lastName | string | | | sortBy | OrgMemberSortBy | | | direction | Direction | |

Return Type

PaginatedOrgMemberResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgMember.getByOrgId(-62166207.84238667, 42, 10, {
    email: '[email protected]',
    firstName: 'John',
    lastName: 'Doe',
    sortBy: 'createdAt',
    direction: 'asc',
  });
  console.log(result);
})();

updateMember

  • HTTP Method: PATCH
  • Endpoint: /orgs/{orgId}/members/{userId}

Required Parameters

| Name | Type | Description | | :----- | :----- | :------------ | | userId | number | | | orgId | number | | | input | object | Request body. |

Return Type

OrgMemberResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { orgId: 1, role: 'MEMBER' };
  const result = await sdk.orgMember.updateMember(input, 45963300.29407638, -1724930.9730228633);
  console.log(result);
})();

removeMember

  • HTTP Method: DELETE
  • Endpoint: /orgs/{orgId}/members/{userId}

Required Parameters

| Name | Type | Description | | :----- | :----- | :---------- | | userId | number | | | orgId | number | |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgMember.removeMember(83533672.79767746, 61993940.96509114);
  console.log(result);
})();

leaveOrg

  • HTTP Method: DELETE
  • Endpoint: /orgs/{orgId}/leave

Required Parameters

| Name | Type | Description | | :---- | :----- | :---------- | | orgId | number | |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgMember.leaveOrg(-26163685.76827748);
  console.log(result);
})();

enableAllMembers

  • HTTP Method: PATCH
  • Endpoint: /orgs/{orgId}/enable

Required Parameters

| Name | Type | Description | | :---- | :----- | :---------- | | orgId | number | |

Return Type

UpdateManyOrgMembersResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgMember.enableAllMembers(-6452920.437261239);
  console.log(result);
})();

disableAllMembers

  • HTTP Method: PATCH
  • Endpoint: /orgs/{orgId}/disable

Required Parameters

| Name | Type | Description | | :---- | :----- | :---------- | | orgId | number | |

Return Type

UpdateManyOrgMembersResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgMember.disableAllMembers(-61197111.701100186);
  console.log(result);
})();

createArtifact

  • HTTP Method: POST
  • Endpoint: /artifacts

Required Parameters

| input | object | Request body. |

Return Type

ArtifactResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    artifactType: 'DOC',
    bucketKey: 'bucketKey',
    bucketName: 'bucketName',
    buildId: 1,
    status: 'SUCCESS',
  };
  const result = await sdk.artifact.createArtifact(input);
  console.log(result);
})();

getArtifacts

  • HTTP Method: GET
  • Endpoint: /artifacts

Required Parameters

| Name | Type | Description | | :------ | :----- | :---------- | | buildId | number | |

Return Type

GetArtifactsResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.artifact.getArtifacts(1);
  console.log(result);
})();

getArtifactStatuses

  • HTTP Method: GET
  • Endpoint: /artifacts/statuses

Return Type

GetArtifactStatusesResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.artifact.getArtifactStatuses();
  console.log(result);
})();

getArtifactLogs

  • HTTP Method: GET
  • Endpoint: /artifacts/{id}/logs

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

GetArtifactLogsResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.artifact.getArtifactLogs(55206867.98036581);
  console.log(result);
})();

getArtifactById

  • HTTP Method: GET
  • Endpoint: /artifacts/{id}

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

ArtifactResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.artifact.getArtifactById(32195725.25222762);
  console.log(result);
})();

removeArtifact

  • HTTP Method: DELETE
  • Endpoint: /artifacts/{id}

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.artifact.removeArtifact(76056231.44405401);
  console.log(result);
})();

createSdk

  • HTTP Method: POST
  • Endpoint: /sdks

Required Parameters

| input | object | Request body. |

Return Type

SdkResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    artifactId: 1,
    fileLocation: 'https://my-file.location',
    language: 'JAVA',
    version: '1.0.0',
  };
  const result = await sdk.sdk.createSdk(input);
  console.log(result);
})();

findSdks

  • HTTP Method: GET
  • Endpoint: /sdks

Required Parameters

| Name | Type | Description | | :----- | :----- | :---------- | | offset | number | | | limit | number | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :--------- | :------------------------------------------- | :---------- | | artifactId | number | | | sortBy | SdkSortBy | | | direction | Direction | | | languages | string[] | |

Return Type

PaginatedSdkResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.sdk.findSdks(42, 10, {
    artifactId: 1,
    sortBy: 'version',
    direction: 'asc',
    languages: ['TYPESCRIPT'],
  });
  console.log(result);
})();

getSdkById

  • HTTP Method: GET
  • Endpoint: /sdks/{id}

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

SdkResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.sdk.getSdkById(25581214.653234825);
  console.log(result);
})();

removeSdk

  • HTTP Method: DELETE
  • Endpoint: /sdks/{id}

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.sdk.removeSdk(-11418004.284944862);
  console.log(result);
})();

getApprovedByOrgSlugAndApiSlug

  • HTTP Method: GET
  • Endpoint: /docs/approved

Required Parameters

| Name | Type | Description | | :------ | :----- | :---------- | | orgSlug | string | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :--------- | :----- | :---------- | | apiSlug | string | | | apiVersion | string | |

Return Type

DocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.getApprovedByOrgSlugAndApiSlug('orgSlug', {
    apiSlug: 'apiSlug',
    apiVersion: 'apiVersion',
  });
  console.log(result);
})();

getAllApprovedByOrgSlugAndApiSlug

  • HTTP Method: GET
  • Endpoint: /docs/approved/all

Required Parameters

| Name | Type | Description | | :------ | :----- | :---------- | | orgSlug | string | |

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

| Name | Type | Description | | :--------- | :----- | :---------- | | apiSlug | string | | | apiVersion | string | |

Return Type

GetAllApprovedByOrgSlugAndApiSlugResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.getAllApprovedByOrgSlugAndApiSlug('orgSlug', {
    apiSlug: 'apiSlug',
    apiVersion: 'apiVersion',
  });
  console.log(result);
})();

createDoc

  • HTTP Method: POST
  • Endpoint: /docs

Required Parameters

| input | object | Request body. |

Return Type

DocCreatedResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    apiId: -64923906.584890686,
    artifactId: 1,
    fileLocation: 'https://example.com',
    previewSlug: 'previewSlug',
    version: '1.0.0',
  };
  const result = await sdk.doc.createDoc(input);
  console.log(result);
})();

findDocs

  • HTTP Method: GET
  • Endpoint: /docs

Required Parameters

| Name | Type | Description | | :--------- | :----- | :---------- | | offset | number | | | limit | number | | | artifactId | number | |

Return Type

PaginatedDocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.findDocs(42, 10, 1);
  console.log(result);
})();

approve

  • HTTP Method: POST
  • Endpoint: /docs/{previewSlug}/approve

Required Parameters

| Name | Type | Description | | :---------- | :----- | :---------- | | previewSlug | string | |

Return Type

DocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.approve('previewSlug');
  console.log(result);
})();

unapprove

  • HTTP Method: POST
  • Endpoint: /docs/{previewSlug}/unapprove

Required Parameters

| Name | Type | Description | | :---------- | :----- | :---------- | | previewSlug | string | |

Return Type

DocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.unapprove('previewSlug');
  console.log(result);
})();

getDocById

  • HTTP Method: GET
  • Endpoint: /docs/{id}

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

DocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.getDocById(-33229612.471661694);
  console.log(result);
})();

removeDoc

  • HTTP Method: DELETE
  • Endpoint: /docs/{id}

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.removeDoc(-24038357.756537467);
  console.log(result);
})();

updateDoc

  • HTTP Method: PUT
  • Endpoint: /docs/{id}

Required Parameters

| Name | Type | Description | | :---- | :----- | :------------ | | id | number | | | input | object | Request body. |

Return Type

DocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { fileLocation: 'https://example.com', version: '1.0.0' };
  const result = await sdk.doc.updateDoc(input, -48898366.69830183);
  console.log(result);
})();

getDownloadUrl

  • HTTP Method: GET
  • Endpoint: /docs/{id}/getDownloadUrl

Required Parameters

| Name | Type | Description | | :--- | :----- | :---------- | | id | number | |

Return Type

DocDownloadResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.getDownloadUrl(-45281734.471104816);
  console.log(result);
})();

sendShadowForm

  • HTTP Method: POST
  • Endpoint: /hubspot/shadow-form

Required Parameters

| input | object | Request body. |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { fields: [{ name: 'test-name', value: 'test-field' }] };
  const result = await sdk.hubSpot.sendShadowForm(input);
  console.log(result);
})();

getActiveSubscription

  • HTTP Method: GET
  • Endpoint: /orgs/{orgId}/subscriptions/active

Required Parameters

| Name | Type | Description | | :---- | :----- | :---------- | | orgId | number | |

Return Type

SubscriptionResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgSubscriptions.getActiveSubscription(-71779870.69072866);
  console.log(result);
})();

cancelActiveSubscription

  • HTTP Method: POST
  • Endpoint: /orgs/{orgId}/subscriptions/active/cancel

Required Parameters

| Name | Type | Description | | :---- | :----- | :---------- | | orgId | number | |

Return Type

SubscriptionResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgSubscriptions.cancelActiveSubscription(-14341615.16899079);
  console.log(result);
})();

getActiveSubscriptionStatus

  • HTTP Method: GET
  • Endpoint: /orgs/{orgId}/subscriptions/active/state

Required Parameters

| Name | Type | Description | | :---- | :----- | :---------- | | orgId | number | |

Return Type

GetActiveSubscriptionStatusResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgSubscriptions.getActiveSubscriptionStatus(-89544480.58736615);
  console.log(result);
})();

getSubscriptionPaymentMethodUpdateLink

  • HTTP Method: GET
  • Endpoint: /orgs/{orgId}/subscriptions/{subscriptionId}/payment-methods/update-link

Required Parameters

| Name | Type | Description | | :------------- | :----- | :---------- | | orgId | number | | | subscriptionId | number | |

Return Type

CheckoutLinkResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgSubscriptions.getSubscriptionPaymentMethodUpdateLink(
    -93270816.62061384,
    43391077.4494361,
  );
  console.log(result);
})();

getCheckoutLink

  • HTTP Method: GET
  • Endpoint: /orgs/{orgId}/subscriptions/checkout/link

Required Parameters

| Name | Type | Description | | :-------------- | :------------------------------------------------------- | :---------- | | orgId | number | | | planId | number | | | billingInterval | BillingInterval | |

Return Type

CheckoutLinkResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgSubscriptions.getCheckoutLink(-56857549.38173915, 1, 'year');
  console.log(result);
})();

getMcpSubscription

  • HTTP Method: GET
  • Endpoint: /orgs/{orgId}/mcp-subscription

Required Parameters

| Name | Type | Description | | :---- | :----- | :---------- | | orgId | number | |

Return Type

McpSubscriptionResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgMcpSubscriptions.getMcpSubscription(-47425895.55909884);
  console.log(result);
})();

updateMcpSubscription

  • HTTP Method: PATCH
  • Endpoint: /orgs/{orgId}/mcp-subscription

Required Parameters

| Name | Type | Description | | :---- | :----- | :------------ | | orgId | number | | | input | object | Request body. |

Return Type