Liblab Typescript SDK 0.1.348
The Typescript SDK for Liblab.
- API version: 0.1.348
- SDK version: 0.1.348
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
Api
Org
OrgMember
Artifact
Sdk
Doc
HubSpot
OrgSubscriptions
Subscriptions
PaymentProvider
User
Snippets
Workflows
SpecValidation
Token
Invitation
Auth0
Plan
Invoice
HealthCheck
Tags
Ai
Feedback
UserEvent
ThirdPartyApplications
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(
-48386925.91539089,
-83467689.21815374,
-20517490.990856484,
'apiSlug',
);
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, -89677017.40436298);
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(-30008643.62245661);
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(-64706075.79201339, 'apiSlug', 42350286.48352799);
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(92861901.01592246, -63556303.24239061);
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(60858418.57105848, -3723344.9080896527);
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(-64523181.719173774);
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(-43877886.09425485);
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(
31484383.619652823,
-38886746.61167642,
-1371677.2169137448,
{
sortBy: 'status',
direction: 'asc',
statuses: ['FAILURE', 'IN_PROGRESS'],
tags: [-8626125.48545605, -70394819.11999448],
createdByIds: [17079620.605206624, -34341066.679983445],
},
);
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(716358.53869991);
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(
24941975.907570362,
-62140889.516780496,
-54925636.7169505,
{
statuses: ['SUCCESS', 'FAIL'],
tags: [49535182.30134946, 63615067.391241044],
createdByIds: [-66811293.12656276, -62492975.23021147],
languages: ['GO', 'TERRAFORM'],
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(
31621803.475855798,
-54129214.42480019,
-67642981.23480356,
{
sortBy: 'createdAt',
direction: 'asc',
statuses: ['IN_PROGRESS', 'IN_PROGRESS'],
tags: [32488202.860175967, 40906796.654951364],
createdByIds: [6667560.860023692, -40257424.326962665],
},
);
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(-70309999.3115496, { apiSlug: 'apiSlug' });
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'}
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(-92082133.85643336, -88167045.24126485, {
name: 'name',
sortBy: 'createdAt',
orgId: -26210372.69883573,
direction: 'desc',
orgIds: [-83461414.17065853, -19522865.83103144],
});
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(84946957.09766838);
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, -76474573.04110432);
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(877037.5652007461);
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', 2070715.8042277247);
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'}
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(-3376091.2642463446, -11887139.230394766, {
direction: 'asc',
sortBy: 'createdAt',
});
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(-85000180.47908488, -28162619.587194055, {
website: 'website',
domain: 'domain',
name: 'name',
});
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(-92728908.58312981);
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, -42841437.300536);
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(52896139.3351405);
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(-27024463.568368435);
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(
-45621589.2658653,
-49888936.35227107,
-43133433.472068615,
{
sortBy: 'status',
direction: 'asc',
statuses: ['SUCCESS', 'FAILURE'],
createdByIds: [45556307.71373224, 16081598.318076655],
apiSlug: 'apiSlug',
apiVersion: 'apiVersion',
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(-45004048.146811426);
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(
39171442.99663636,
-62993672.94672944,
-42176426.79666151,
{
sortBy: 'createdAt',
direction: 'asc',
statuses: ['IN_PROGRESS', 'IN_PROGRESS'],
tags: [37521539.85345888, -7082617.879255354],
createdByIds: [40995649.84239775, -79303091.49000597],
apiSlug: 'apiSlug',
apiVersion: 'apiVersion',
},
);
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(-94253142.79507613);
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'}
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(
-73031681.8101937,
83103032.3639344,
-50902893.21860788,
{
sortBy: 'status',
direction: 'desc',
artifactTypes: ['DOC', 'SDK'],
statuses: [{ imports: [] }, { imports: [] }],
createdByIds: [-45887338.81306339, 28798468.828723058],
},
);
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, -80403451.92657337);
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'}
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(
-33249051.409236863,
-72879342.44568443,
-53325665.97263134,
{
email: 'email',
firstName: 'firstName',
lastName: 'lastName',
sortBy: 'role',
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, 13738324.48859869, -21999812.47184959);
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(-26435573.732598975, 6675045.700773016);
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(-22808391.933861345);
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(28438813.811140478);
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(-58856297.84265034);
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(-30889993.093074247);
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);
})();
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(92534380.38666943);
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(36001535.10267049);
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'}
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(61284651.42855498, -96417215.92168748, {
artifactId: 67182924.09900704,
sortBy: 'language',
direction: 'asc',
languages: ['GO', '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(51198674.92788148);
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(2312588.9082571864);
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: 53822987.97654554,
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(92093985.39841348, -65682268.06004824, -62566004.89681543);
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(-1054392.2279297113);
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(72873473.26018527);
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, -18361367.467660546);
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(-51794587.769883014);
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(-491580.39827497303);
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(-64821852.75159851);
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(96735111.76798621);
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(
-54826165.82598752,
67838480.02872851,
);
console.log(result);
})();
getCheckoutLink
- HTTP Method: GET
- Endpoint: /orgs/{orgId}/subscriptions/checkout/link
Required Parameters
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(
28006417.757769734,
-35582085.74823949,
'month',
);
console.log(result);
})();
getSubscriptionsOverview
- HTTP Method: GET
- Endpoint: /subscriptions
Return Type
SubscriptionsOverviewResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.subscriptions.getSubscriptionsOverview();
console.log(result);
})();
stripeWebhook
- HTTP Method: POST
- Endpoint: /payment-provider/stripe/webhook
Required Parameters
Name | Type | Description |
---|
stripeSignature | string | |
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.paymentProvider.stripeWebhook('stripe-signature');
console.log(result);
})();
syncStripeSubscriptions
- HTTP Method: POST
- Endpoint: /payment-provider/stripe/subscriptions/sync
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.paymentProvider.syncStripeSubscriptions();
console.log(result);
})();
getCurrentUser
- HTTP Method: GET
- Endpoint: /users/current-user
Return Type
CurrentUserResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.user.getCurrentUser();
console.log(result);
})();
createUser
- HTTP Method: POST
- Endpoint: /users
Required Parameters
| input | object | Request body. |
Return Type
UserResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const input = {
auth0Id: 'auth0|123',
email: 'someone@example.com',
firstName: 'John',
lastName: 'Doe',
password: 'Password123!',
signupMethod: 'DEFAULT',
};
const result = await sdk.user.createUser(input);
console.log(result);
})();
getUsers
- HTTP Method: GET
- Endpoint: /users
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 |
---|
orgId | number | |
email | string | |
firstName | string | |
lastName | string | |
orgIds | number[] | |
sortBy | UserSortBy | |
direction | UserDirection | |
Return Type
UsersResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.user.getUsers(-94688984.02387315, -24154113.776340947, {
orgId: -35295877.77292948,
email: 'email',
firstName: 'firstName',
lastName: 'lastName',
orgIds: [-36284081.27184577, 68803116.04374766],
sortBy: 'createdAt',
direction: 'desc',
});
console.log(result);
})();
getUserById
- HTTP Method: GET
- Endpoint: /users/{id}
Required Parameters
Name | Type | Description |
---|
id | number | |
Return Type
UserResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.user.getUserById(63993014.05699259);
console.log(result);
})();
updateUser
- HTTP Method: PATCH
- Endpoint: /users/{id}
Required Parameters
Name | Type | Description |
---|
id | number | |
input | object | Request body. |
Return Type
UserResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const input = {
auth0Id: 'auth0Id',
email: 'someone@example.com',
firstName: 'John',
isEnabled: true,
isLiblabAdmin: true,
isLiblabFinanceAdmin: false,
lastName: 'Doe',
refreshTokenHash: 'refreshTokenHash',
utmParams: {},
};
const result = await sdk.user.updateUser(input, -80753749.11433251);
console.log(result);
})();
removeUser
- HTTP Method: DELETE
- Endpoint: /users/{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.user.removeUser(54174360.63688478);
console.log(result);
})();
updateEmailSubscription
- HTTP Method: PATCH
- Endpoint: /users/emails/subscriptions
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 = { isSubscribedToEmails: true };
const result = await sdk.user.updateEmailSubscription(input);
console.log(result);
})();
getUserOrgs
- HTTP Method: GET
- Endpoint: /users/orgs
Required Parameters
Name | Type | Description |
---|
offset | number | |
limit | number | |
Return Type
PaginatedOrgResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.user.getUserOrgs(-61477043.03944672, -44059512.927683175);
console.log(result);
})();
getUserApis
- HTTP Method: GET
- Endpoint: /users/apis
Return Type
GetUserApisResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.user.getUserApis();
console.log(result);
})();
getSnippetsByBuildId
- HTTP Method: GET
- Endpoint: /snippets/{id}
Required Parameters
Name | Type | Description |
---|
id | number | |
Return Type
SnippetsResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.snippets.getSnippetsByBuildId(-67908344.4724809);
console.log(result);
})();
uploadWorkflows
- HTTP Method: POST
- Endpoint: /workflows
Required Parameters
| input | object | Request body. |
Return Type
CreateWorkflowsResponse
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.workflows.uploadWorkflows(input);
console.log(result);
})();
validateSpec
- HTTP Method: POST
- Endpoint: /spec-validations
Required Parameters
| input | object | Request body. |
Return Type
SpecValidationResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const input = { apiId: 1 };
const result = await sdk.specValidation.validateSpec(input);
console.log(result);
})();
getSpecValidation
- HTTP Method: GET
- Endpoint: /spec-validations/{id}
Required Parameters
Name | Type | Description |
---|
id | number | |
Return Type
SpecValidationResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.specValidation.getSpecValidation(-51637325.085906215);
console.log(result);
})();
createToken
- HTTP Method: POST
- Endpoint: /auth/tokens
Required Parameters
| input | object | Request body. |
Return Type
CreateTokenResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const input = {
expiresAt: '2025-01-01T01:01:01.0Z',
name: 'My token',
scope: ['API', 'DOC', 'SDK', 'BUILD', 'ARTIFACT', 'ORG'],
};
const result = await sdk.token.createToken(input);
console.log(result);
})();
findTokensByUserId
- HTTP Method: GET
- Endpoint: /auth/tokens
Required Parameters
Name | Type | Description |
---|
userId | number | |
Return Type
FindTokensByUserIdResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.token.findTokensByUserId(-15843069.618789852);
console.log(result);
})();
getTokenById
- HTTP Method: GET
- Endpoint: /auth/tokens/{id}
Required Parameters
Name | Type | Description |
---|
id | number | |
Return Type
GetTokenResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.token.getTokenById(-40625301.07742392);
console.log(result);
})();
removeToken
- HTTP Method: DELETE
- Endpoint: /auth/tokens/{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.token.removeToken(41069683.19669604);
console.log(result);
})();
createOrgInvite
- HTTP Method: POST
- Endpoint: /invitations/org/{orgId}/invite
Required Parameters
Name | Type | Description |
---|
orgId | number | |
input | object | Request body. |
Return Type
InvitationResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const input = { email: 'harry@liblab.com' };
const result = await sdk.invitation.createOrgInvite(input, -19738588.312565282);
console.log(result);
})();
redeemInvite
- HTTP Method: PATCH
- Endpoint: /invitations/{inviteCode}/redeem
Required Parameters
Name | Type | Description |
---|
inviteCode | string | |
Return Type
InvitationResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.invitation.redeemInvite('inviteCode');
console.log(result);
})();
declineInvite
- HTTP Method: PATCH
- Endpoint: /invitations/{inviteCode}/decline
Required Parameters
Name | Type | Description |
---|
inviteCode | string | |
Return Type
InvitationResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.invitation.declineInvite('inviteCode');
console.log(result);
})();
getReceivedInvites
- HTTP Method: GET
- Endpoint: /invitations/received
Required Parameters
Name | Type | Description |
---|
offset | number | |
limit | number | |
Return Type
PaginatedOrgInvitesResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.invitation.getReceivedInvites(94420007.89217219, -86510671.73961887);
console.log(result);
})();
getSentInvites
- HTTP Method: GET
- Endpoint: /invitations/sent
Required Parameters
Name | Type | Description |
---|
offset | number | |
limit | number | |
Return Type
PaginatedOrgInvitesResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.invitation.getSentInvites(-73305583.70139788, -48861422.55376362);
console.log(result);
})();
searchInvites
- HTTP Method: GET
- Endpoint: /invitations/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'}
Return Type
PaginatedOrgInvitesResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.invitation.searchInvites(-61127076.94967759, -71930449.09504612, {
orgName: 'orgName',
status: 'EXPIRED',
sortBy: 'createdAt',
direction: 'desc',
});
console.log(result);
})();
getInviteByCode
- HTTP Method: GET
- Endpoint: /invitations/{inviteCode}
Required Parameters
Name | Type | Description |
---|
inviteCode | string | |
Return Type
InvitationResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.invitation.getInviteByCode('inviteCode');
console.log(result);
})();
resetPasswordAuth0
- HTTP Method: POST
- Endpoint: /auth0/reset-password
Return Type
Auth0ResetPasswordResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.auth0.resetPasswordAuth0();
console.log(result);
})();
passwordlessVerifyPassword
- HTTP Method: POST
- Endpoint: /auth0/passwordless/verify-password
Return Type
VerifyPasswordResponseDto
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.auth0.passwordlessVerifyPassword();
console.log(result);
})();
passwordlessSetupPassword
- HTTP Method: POST
- Endpoint: /auth0/passwordless/setup-password
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 = { password: 'P@ssw0rd123' };
const result = await sdk.auth0.passwordlessSetupPassword(input);
console.log(result);
})();
getEnabledPlans
- HTTP Method: GET
- Endpoint: /plans/enabled
Return Type
GetEnabledPlansResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.plan.getEnabledPlans();
console.log(result);
})();
getOrgInvoices
- HTTP Method: GET
- Endpoint: /orgs/{orgId}/invoices
Required Parameters
Name | Type | Description |
---|
orgId | number | |
Return Type
OrgInvoicesResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.invoice.getOrgInvoices(17201000.494546607);
console.log(result);
})();
healthCheckControllerCheck
- HTTP Method: GET
- Endpoint: /health-check
Return Type
HealthCheckResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.healthCheck.healthCheckControllerCheck();
console.log(result);
})();
create
- HTTP Method: POST
- Endpoint: /tags
Required Parameters
| input | object | Request body. |
Return Type
TagResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const input = { name: 'tag' };
const result = await sdk.tags.create(input);
console.log(result);
})();
search
- HTTP Method: GET
- Endpoint: /tags
Required Parameters
Name | Type | Description |
---|
offset | number | |
limit | number | |
searchQuery | string | |
Return Type
SearchResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.tags.search(-33675066.82034214, -32755242.901153892, 'searchQuery');
console.log(result);
})();
queryDocuments
Query documents
- HTTP Method: GET
- Endpoint: /ai/chat
Required Parameters
Name | Type | Description |
---|
orgId | number | |
apiSlug | string | |
apiVersion | string | |
sdkLanguage | string | |
q | string | |
Return Type
ChatResponseDto
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.ai.queryDocuments(
328289.77993908525,
'apiSlug',
'apiVersion',
'sdkLanguage',
'q',
);
console.log(result);
})();
sendFeedback
- HTTP Method: POST
- Endpoint: /feedback
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 = { message: 'message', title: 'title' };
const result = await sdk.feedback.sendFeedback(input);
console.log(result);
})();
getUserEvents
- HTTP Method: GET
- Endpoint: /user-events
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'}
Return Type
PaginatedUserEventsResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.userEvent.getUserEvents(61150047.37343371, -28548419.886424944, {
email: 'email',
orgId: 98415554.06715551,
sortBy: 'timestamp',
direction: 'desc',
orgIds: [72329444.82638818, -67371223.1153584],
eventIds: [-76360239.0553236, -52386036.01074842],
});
console.log(result);
})();
exportUserEventsToCsv
- HTTP Method: GET
- Endpoint: /user-events/export-to-csv
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 | |
orgId | number | |
filename | string | |
orgIds | number[] | |
eventIds | number[] | |
Return Type
ExportUserEventsToCsvResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.userEvent.exportUserEventsToCsv({
email: 'email',
orgId: 83082146.2820167,
filename: 'filename',
orgIds: [-35288979.63887361, -28428045.32322067],
eventIds: [11210334.454771772, 69689202.59156519],
});
console.log(result);
})();
trackUserPublishPrEvent
- HTTP Method: POST
- Endpoint: /user-events/track-user-publish-pr-event
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 = { language: 'typescript', sdk: 'My SDK', success: true };
const result = await sdk.userEvent.trackUserPublishPrEvent(input);
console.log(result);
})();
thirdPartyApplicationsControllerCreate
- HTTP Method: POST
- Endpoint: /third-party-applications
Required Parameters
| input | object | Request body. |
Return Type
ThirdPartyApplicationResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const input = {
callbackUrls: ['http://localhost:3000/api/auth/callback'],
logoUrl: 'https://liblab.com/img/logo.svg',
name: 'third-party application',
orgId: 1,
};
const result = await sdk.thirdPartyApplications.thirdPartyApplicationsControllerCreate(input);
console.log(result);
})();
thirdPartyApplicationsControllerGetAll
- HTTP Method: GET
- Endpoint: /third-party-applications
Return Type
ThirdPartyApplicationsControllerGetAllResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.thirdPartyApplications.thirdPartyApplicationsControllerGetAll();
console.log(result);
})();
thirdPartyApplicationsControllerGetByOrgId
- HTTP Method: GET
- Endpoint: /third-party-applications/{id}
Required Parameters
Name | Type | Description |
---|
id | number | |
Return Type
ThirdPartyApplicationsControllerGetByOrgIdResponse
Example Usage Code Snippet
import { Liblab } from '@liblab/sdk';
const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });
(async () => {
const result = await sdk.thirdPartyApplications.thirdPartyApplicationsControllerGetByOrgId(
33179720.888879776,
);
console.log(result);
})();
thirdPartyApplicationsControllerDeleteById
- HTTP Method: DELETE
- Endpoint: /third-party-applications/{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.thirdPartyApplications.thirdPartyApplicationsControllerDeleteById(
-84998762.29604416,
);
console.log(result);
})();
License
License: MIT. See license in LICENSE.