PipesHub API: Unified API documentation for PipesHub services.
PipesHub is an enterprise-grade platform providing:
- User authentication and management
- Document storage and version control
- Knowledge base management
- Enterprise search and conversational AI
- Third-party integrations via connectors
- System configuration management
- Crawling job scheduling
- Email services
Most endpoints require JWT Bearer token authentication. Some internal endpoints use scoped tokens for service-to-service communication.
All endpoints use the /api/v1 prefix unless otherwise noted.
The SDK can be installed with either npm, pnpm, bun or yarn package managers.
npm add @pipeshub-ai/sdkpnpm add @pipeshub-ai/sdkbun add @pipeshub-ai/sdkyarn add @pipeshub-ai/sdkNote
This package is published with CommonJS and ES Modules (ESM) support.
For supported JavaScript runtimes, please consult RUNTIMES.md.
import { Pipeshub } from "@pipeshub-ai/sdk";
const pipeshub = new Pipeshub();
async function run() {
const result = await pipeshub.userAccount.initAuth({
email: "user@example.com",
});
console.log(result);
}
run();This SDK supports the following security schemes globally:
| Name | Type | Scheme |
|---|---|---|
bearerAuth |
http | HTTP Bearer |
oauth2 |
oauth2 | OAuth2 token |
You can set the security parameters through the security optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
import { Pipeshub } from "@pipeshub-ai/sdk";
const pipeshub = new Pipeshub({
security: {
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
},
});
async function run() {
const result = await pipeshub.userAccount.initAuth({
email: "user@example.com",
});
console.log(result);
}
run();Some operations in this SDK require the security scheme to be specified at the request level. For example:
import { Pipeshub } from "@pipeshub-ai/sdk";
const pipeshub = new Pipeshub();
async function run() {
const result = await pipeshub.userAccount.resetPasswordWithToken({
scopedToken: "<YOUR_BEARER_TOKEN_HERE>",
}, {
password: "H9GEHoL829GXj06",
});
console.log(result);
}
run();Available methods
- listAgentConversations - List agent conversations
- createAgentConversation - Create agent conversation
- streamAgentConversation - Create agent conversation with streaming
- getAgentConversation - Get agent conversation
- deleteAgentConversation - Delete agent conversation
- addAgentMessage - Add message to agent conversation
- streamAgentMessage - Add message with streaming
- regenerateAgentAnswer - Regenerate agent response
- listAgentTemplates - List agent templates
- createAgentTemplate - Create agent template
- getAgentTemplate - Get agent template
- updateAgentTemplate - Update agent template
- deleteAgentTemplate - Delete agent template
- listAgents - List agents
- createAgent - Create agent
- listAgentTools - List available tools
- getAgent - Get agent
- updateAgent - Update agent
- deleteAgent - Delete agent
- getAgentPermissions - Get agent permissions
- updateAgentPermissions - Update agent permissions
- shareAgent - Share agent
- unshareAgent - Unshare an agent
- getModelsByType - Get models by type
- getAvailableModelsByType - Get available models for selection
- addAIModelProvider - Add new AI model provider
- updateAIModelProvider - Update AI model provider
- deleteAIModelProvider - Delete AI model provider
- setDefaultAIModel - Set default AI model
- setAzureAdAuthConfig - Configure Azure AD authentication
- getAzureAdAuthConfig - Get Azure AD configuration
- setMicrosoftAuthConfig - Configure Microsoft authentication
- getMicrosoftAuthConfig - Get Microsoft authentication configuration
- setGoogleAuthConfig - Configure Google authentication
- getGoogleAuthConfig - Get Google authentication configuration
- setSsoAuthConfig - Configure SAML SSO authentication
- getSsoAuthConfig - Get SAML SSO configuration
- setOAuthConfig - Configure generic OAuth provider
- getGenericOAuthConfig - Get generic OAuth configuration
- getSlackBotConfigs - Get Slack bot configurations
- createSlackBotConfig - Create Slack bot configuration
- updateSlackBotConfig - Update Slack bot configuration
- deleteSlackBotConfig - Delete Slack bot configuration
- setMetricsCollectionPushInterval - Set metrics push interval
- setMetricsCollectionRemoteServer - Set metrics remote server URL
- getAIModelsConfig - Get AI models configuration
- createAIModelsConfig - Create AI models configuration
- getAIModelsProviders - Get AI model providers
- reindexRecord - Reindex single record
- reindexRecordGroup - Reindex record group
- resyncConnector - Resync connector
- getConnectorStats - Get connector statistics
- getConnectorConfig - Get connector configuration
- updateConnectorConfig - Update connector configuration
- updateConnectorAuthConfig - Update authentication configuration
- updateConnectorFiltersSyncConfig - Update filters and sync configuration
- toggleConnector - Toggle connector sync or agent
- getConnectorFilters - Get filter options
- saveConnectorFilters - Save filter selections
- getFilterFieldOptions - Get dynamic filter options
- listConnectorInstances - List connector instances
- createConnectorInstance - Create connector instance
- listActiveConnectors - List active connector instances
- listInactiveConnectors - List inactive connector instances
- listConfiguredConnectors - List configured connector instances
- listActiveAgentConnectors - List active agent connectors
- getConnectorInstance - Get connector instance
- deleteConnectorInstance - Delete connector instance
- updateConnectorName - Update connector instance name
- getOAuthAuthorizationUrl - Get OAuth authorization URL
- handleOAuthCallback - OAuth callback handler
getTokenFromCode- Exchange Google authorization code for tokens⚠️ Deprecated
- getConnectorRegistry - List available connector types
- getConnectorSchema - Get connector configuration schema
- createConversation - Create a new AI conversation
- streamChat - Create conversation with streaming response
- getAllConversations - List all conversations
- getArchivedConversations - List archived conversations
- getConversationById - Get conversation by ID
- deleteConversationById - Delete conversation
- addMessage - Add message to conversation
- addMessageStream - Add message with streaming response
- shareConversation - Share conversation with users
- updateConversationTitle - Update conversation title
- archiveConversation - Archive conversation
- unarchiveConversation - Unarchive conversation
- regenerateAnswer - Regenerate AI response
- updateMessageFeedback - Submit feedback on AI response
- unshareConversationById - Unshare a conversation
- scheduleCrawlingJob - Schedule a crawling job
- getCrawlingJobStatus - Get crawling job status
- removeCrawlingJob - Remove a crawling job
- getAllCrawlingJobStatus - Get all crawling job statuses
- removeAllCrawlingJob - Remove all crawling jobs
- pauseCrawlingJob - Pause a crawling job
- resumeCrawlingJob - Resume a crawling job
- getQueueStats - Get queue statistics
- downloadDocument - Download document
- createRootFolder - Create root folder
- getFolderContents - Get folder contents
- updateFolder - Update folder
- deleteFolder - Delete folder
- getFolderChildren - Get folder children (alias for folder contents)
- createSubfolder - Create subfolder
- createKnowledgeBase - Create a new knowledge base
- listKnowledgeBases - List all knowledge bases
- getKnowledgeBase - Get knowledge base by ID
- updateKnowledgeBase - Update knowledge base
- deleteKnowledgeBase - Delete knowledge base
- reindexFailedRecords - Reindex failed records for connector
- moveRecord - Move record to another location
- getKnowledgeHubRootNodes - Get knowledge hub root nodes
- getKnowledgeHubChildNodes - Get knowledge hub child nodes
- getMetricsCollection - Get metrics collection configuration
- toggleMetricsCollection - Enable or disable metrics collection
- exchangeOAuthCode - Exchange OAuth authorization code for tokens
- listOAuthApps - List OAuth apps
- createOAuthApp - Create OAuth app
- listOAuthScopes - List available scopes
- getOAuthApp - Get OAuth app details
- updateOAuthApp - Update OAuth app
- deleteOAuthApp - Delete OAuth app
- regenerateOAuthAppSecret - Regenerate client secret
- suspendOAuthApp - Suspend OAuth app
- activateOAuthApp - Activate suspended OAuth app
- listOAuthAppTokens - List app tokens
- revokeAllOAuthAppTokens - Revoke all app tokens
- listToolsetOAuthConfigs - List OAuth configs by toolset type
- updateToolsetOAuthConfig - Update OAuth config
- deleteToolsetOAuthConfig - Delete OAuth config
- getOAuthRegistry - List OAuth-capable connector types
- getOAuthConnectorType - Get OAuth connector type details
- listOAuthConfigs - List OAuth configurations
- listOAuthConfigsByType - List OAuth configs for connector type
- createOAuthConfig - Create OAuth configuration
- getOAuthConfig - Get OAuth configuration
- updateOAuthConfig - Update OAuth configuration
- deleteOAuthConfig - Delete OAuth configuration
- oauthAuthorize - Initiate OAuth authorization flow
- oauthAuthorizeConsent - Submit authorization consent
- oauthToken - Exchange authorization code for tokens
- oauthRevoke - Revoke an access or refresh token
- oauthIntrospect - Introspect a token
- oauthUserInfo - Get authenticated user information
- openidConfiguration - OpenID Connect Discovery
- jwks - JSON Web Key Set
- getAuthMethods - Get organization authentication methods
- updateAuthMethod - Update organization authentication methods
- setUpAuthConfig - Set up auth configuration
- checkOrgExists - Check if organization exists
- createOrganization - Create organization
- getCurrentOrganization - Get current organization
- updateOrganization - Update organization
- deleteOrganization - Delete organization
- uploadOrganizationLogo - Upload organization logo
- getOrganizationLogo - Get organization logo
- deleteOrganizationLogo - Delete organization logo
- getOnboardingStatus - Get onboarding status
- updateOnboardingStatus - Update onboarding status
- createKBPermission - Grant permissions
- listKBPermissions - List permissions
- updateKBPermissions - Update permissions
- deleteKBPermissions - Remove permissions
- setPlatformSettings - Update platform settings
- getPlatformSettings - Get platform settings
- getAvailableFeatureFlags - Get available feature flags
- setCustomSystemPrompt - Update custom system prompt
- getCustomSystemPrompt - Get custom system prompt
- setFrontendPublicUrl - Set frontend public URL
- getFrontendPublicUrl - Get frontend public URL
- setConnectorPublicUrl - Set connector public URL
- getConnectorPublicUrl - Get connector public URL
- getAllRecords - Get all records across knowledge bases
- getKBRecords - Get records for a knowledge base
- getKBChildren - Get KB children (alias for records)
- getRecordById - Get record by ID
- updateRecord - Update record
- deleteRecord - Delete record
- streamRecordBuffer - Stream record content
- signInViaSAML - Initiate SAML sign-in flow
- samlSignInCallback - SAML sign-in callback
- search - Perform semantic search
- searchHistory - Get search history
- deleteAllSearchHistory - Clear all search history
- getSearchById - Get search by ID
- deleteSearchById - Delete search by ID
- shareSearch - Share a search
- unshareSearch - Unshare a search
- archiveSearch - Archive a search
- unarchiveSearch - Unarchive a search
- createSMTPConfig - Create or update SMTP configuration
- getSMTPConfig - Get SMTP configuration
- getStorageConfig - Get current storage configuration
- createTeam - Create a team
- listTeams - List teams
- getTeamById - Get team by ID
- updateTeam - Update team
- deleteTeam - Delete team
- getUserTeams - Get current user's teams
- getTeamUsers - Get users in team
- addUsersToTeam - Add users to team
- removeUserFromTeam - Remove user from team
- updateTeamUsersPermissions - Update team users permissions
- getUserCreatedTeams - Get user created teams
- getToolsetConfig - Get toolset configuration
saveToolsetConfig- Save toolset configuration⚠️ Deprecated- updateToolsetConfig - Update toolset configuration
- deleteToolsetConfig - Delete toolset configuration
- createToolset - Create toolset instance
- listConfiguredToolsets - List configured toolsets
- checkToolsetStatus - Check toolset status
- reauthenticateToolset - Reauthenticate toolset
- getMyToolsets - List my toolsets with auth status
- getToolsetInstances - List toolset instances
- createToolsetInstance - Create toolset instance
- getToolsetInstance - Get toolset instance
- updateToolsetInstance - Update toolset instance
- deleteToolsetInstance - Delete toolset instance
- authenticateToolsetInstance - Authenticate toolset instance
- removeToolsetCredentials - Remove toolset credentials
- reauthenticateToolsetInstance - Mark instance for reauthentication
- getToolsetInstanceStatus - Get instance authentication status
- getToolsetOAuthUrl - Get OAuth authorization URL
- handleToolsetOAuthCallback - Handle OAuth callback
- getInstanceOAuthAuthorizationUrl - Get OAuth authorization URL for instance
- listToolsetRegistry - List available toolsets
- getToolsetSchema - Get toolset schema
- uploadRecordsToKB - Upload files to knowledge base
- uploadRecordsToFolder - Upload files to folder
- getUploadLimits - Get upload limits
- initAuth - Initialize authentication session
- authenticate - Authenticate user with credentials
- generateLoginOtp - Generate and send OTP for login
- forgotPassword - Request password reset email
- resetPasswordWithToken - Reset password with email token
- refreshToken - Refresh access token
- logout - Logout current session
- resetPassword - Reset password
- createUserGroup - Create user group
- getAllUserGroups - Get all user groups
- getUserGroupById - Get user group by ID
- updateUserGroup - Update user group
- deleteUserGroup - Delete user group
- addUsersToGroup - Add users to group
- removeUsersFromGroup - Remove users from group
- getGroupsForUser - Get groups for a user
- getUsersInGroup - Get users in group
- getGroupStatistics - Get group statistics
- getAllUsers - Get all users
- createUser - Create a new user
- getUserById - Get user by ID
- updateUser - Update user
- deleteUser - Delete user
- getUserEmailById - Get user email by ID
- updateEmail - Update user email
- uploadUserDisplayPicture - Upload display picture
- getUserDisplayPicture - Get display picture
- removeUserDisplayPicture - Remove display picture
- bulkInviteUsers - Bulk invite users
- resendUserInvite - Resend user invite
- listUsersGraph - List users (paginated with graph data)
- unblockUser - Unblock a user in organization
- getAllUsersWithGroups - Get all users with groups
- getUsersByIds - Get users by IDs
- updateFullName - Update user full name
- updateFirstName - Update user first name
- updateLastName - Update user last name
- updateDesignation - Update user designation
- adminCheck - Check if user is admin
- getUserTeamsViaUsers - Get user teams
All the methods listed above are available as standalone functions. These functions are ideal for use in applications running in the browser, serverless runtimes or other environments where application bundle size is a primary concern. When using a bundler to build your application, all unused functionality will be either excluded from the final bundle or tree-shaken away.
To read more about standalone functions, check FUNCTIONS.md.
Available standalone functions
agentConversationsAddAgentMessage- Add message to agent conversationagentConversationsCreateAgentConversation- Create agent conversationagentConversationsDeleteAgentConversation- Delete agent conversationagentConversationsGetAgentConversation- Get agent conversationagentConversationsListAgentConversations- List agent conversationsagentConversationsRegenerateAgentAnswer- Regenerate agent responseagentConversationsStreamAgentConversation- Create agent conversation with streamingagentConversationsStreamAgentMessage- Add message with streamingagentsCreateAgent- Create agentagentsDeleteAgent- Delete agentagentsGetAgent- Get agentagentsGetAgentPermissions- Get agent permissionsagentsListAgents- List agentsagentsListAgentTools- List available toolsagentsShareAgent- Share agentagentsUnshareAgent- Unshare an agentagentsUpdateAgent- Update agentagentsUpdateAgentPermissions- Update agent permissionsagentTemplatesCreateAgentTemplate- Create agent templateagentTemplatesDeleteAgentTemplate- Delete agent templateagentTemplatesGetAgentTemplate- Get agent templateagentTemplatesListAgentTemplates- List agent templatesagentTemplatesUpdateAgentTemplate- Update agent templateaiModelsProvidersAddAIModelProvider- Add new AI model provideraiModelsProvidersDeleteAIModelProvider- Delete AI model provideraiModelsProvidersGetAvailableModelsByType- Get available models for selectionaiModelsProvidersGetModelsByType- Get models by typeaiModelsProvidersSetDefaultAIModel- Set default AI modelaiModelsProvidersUpdateAIModelProvider- Update AI model providerauthenticationConfigurationGetAzureAdAuthConfig- Get Azure AD configurationauthenticationConfigurationGetGenericOAuthConfig- Get generic OAuth configurationauthenticationConfigurationGetGoogleAuthConfig- Get Google authentication configurationauthenticationConfigurationGetMicrosoftAuthConfig- Get Microsoft authentication configurationauthenticationConfigurationGetSsoAuthConfig- Get SAML SSO configurationauthenticationConfigurationSetAzureAdAuthConfig- Configure Azure AD authenticationauthenticationConfigurationSetGoogleAuthConfig- Configure Google authenticationauthenticationConfigurationSetMicrosoftAuthConfig- Configure Microsoft authenticationauthenticationConfigurationSetOAuthConfig- Configure generic OAuth providerauthenticationConfigurationSetSsoAuthConfig- Configure SAML SSO authenticationconfigurationManagerCreateAIModelsConfig- Create AI models configurationconfigurationManagerCreateSlackBotConfig- Create Slack bot configurationconfigurationManagerDeleteSlackBotConfig- Delete Slack bot configurationconfigurationManagerGetAIModelsConfig- Get AI models configurationconfigurationManagerGetAIModelsProviders- Get AI model providersconfigurationManagerGetSlackBotConfigs- Get Slack bot configurationsconfigurationManagerSetMetricsCollectionPushInterval- Set metrics push intervalconfigurationManagerSetMetricsCollectionRemoteServer- Set metrics remote server URLconfigurationManagerUpdateSlackBotConfig- Update Slack bot configurationconnectorConfigurationGetConnectorConfig- Get connector configurationconnectorConfigurationUpdateConnectorAuthConfig- Update authentication configurationconnectorConfigurationUpdateConnectorConfig- Update connector configurationconnectorConfigurationUpdateConnectorFiltersSyncConfig- Update filters and sync configurationconnectorControlToggleConnector- Toggle connector sync or agentconnectorFiltersGetConnectorFilters- Get filter optionsconnectorFiltersGetFilterFieldOptions- Get dynamic filter optionsconnectorFiltersSaveConnectorFilters- Save filter selectionsconnectorGetConnectorStats- Get connector statisticsconnectorInstancesCreateConnectorInstance- Create connector instanceconnectorInstancesDeleteConnectorInstance- Delete connector instanceconnectorInstancesGetConnectorInstance- Get connector instanceconnectorInstancesListActiveAgentConnectors- List active agent connectorsconnectorInstancesListActiveConnectors- List active connector instancesconnectorInstancesListConfiguredConnectors- List configured connector instancesconnectorInstancesListConnectorInstances- List connector instancesconnectorInstancesListInactiveConnectors- List inactive connector instancesconnectorInstancesUpdateConnectorName- Update connector instance nameconnectorOAuthGetOAuthAuthorizationUrl- Get OAuth authorization URLconnectorOAuthHandleOAuthCallback- OAuth callback handlerconnectorRegistryGetConnectorRegistry- List available connector typesconnectorRegistryGetConnectorSchema- Get connector configuration schemaconnectorReindexRecord- Reindex single recordconnectorReindexRecordGroup- Reindex record groupconnectorResyncConnector- Resync connectorconversationsAddMessage- Add message to conversationconversationsAddMessageStream- Add message with streaming responseconversationsArchiveConversation- Archive conversationconversationsCreateConversation- Create a new AI conversationconversationsDeleteConversationById- Delete conversationconversationsGetAllConversations- List all conversationsconversationsGetArchivedConversations- List archived conversationsconversationsGetConversationById- Get conversation by IDconversationsRegenerateAnswer- Regenerate AI responseconversationsShareConversation- Share conversation with usersconversationsStreamChat- Create conversation with streaming responseconversationsUnarchiveConversation- Unarchive conversationconversationsUnshareConversationById- Unshare a conversationconversationsUpdateConversationTitle- Update conversation titleconversationsUpdateMessageFeedback- Submit feedback on AI responsecrawlingJobsGetAllCrawlingJobStatus- Get all crawling job statusescrawlingJobsGetCrawlingJobStatus- Get crawling job statuscrawlingJobsGetQueueStats- Get queue statisticscrawlingJobsPauseCrawlingJob- Pause a crawling jobcrawlingJobsRemoveAllCrawlingJob- Remove all crawling jobscrawlingJobsRemoveCrawlingJob- Remove a crawling jobcrawlingJobsResumeCrawlingJob- Resume a crawling jobcrawlingJobsScheduleCrawlingJob- Schedule a crawling jobdocumentManagementDownloadDocument- Download documentfoldersCreateRootFolder- Create root folderfoldersCreateSubfolder- Create subfolderfoldersDeleteFolder- Delete folderfoldersGetFolderChildren- Get folder children (alias for folder contents)foldersGetFolderContents- Get folder contentsfoldersUpdateFolder- Update folderknowledgeBasesCreateKnowledgeBase- Create a new knowledge baseknowledgeBasesDeleteKnowledgeBase- Delete knowledge baseknowledgeBasesGetKnowledgeBase- Get knowledge base by IDknowledgeBasesGetKnowledgeHubChildNodes- Get knowledge hub child nodesknowledgeBasesGetKnowledgeHubRootNodes- Get knowledge hub root nodesknowledgeBasesListKnowledgeBases- List all knowledge basesknowledgeBasesMoveRecord- Move record to another locationknowledgeBasesReindexFailedRecords- Reindex failed records for connectorknowledgeBasesUpdateKnowledgeBase- Update knowledge basemetricsCollectionGetMetricsCollection- Get metrics collection configurationmetricsCollectionToggleMetricsCollection- Enable or disable metrics collectionoAuthAppsActivateOAuthApp- Activate suspended OAuth appoAuthAppsCreateOAuthApp- Create OAuth appoAuthAppsDeleteOAuthApp- Delete OAuth appoAuthAppsGetOAuthApp- Get OAuth app detailsoAuthAppsListOAuthApps- List OAuth appsoAuthAppsListOAuthAppTokens- List app tokensoAuthAppsListOAuthScopes- List available scopesoAuthAppsRegenerateOAuthAppSecret- Regenerate client secretoAuthAppsRevokeAllOAuthAppTokens- Revoke all app tokensoAuthAppsSuspendOAuthApp- Suspend OAuth appoAuthAppsUpdateOAuthApp- Update OAuth appoAuthConfigurationCreateOAuthConfig- Create OAuth configurationoAuthConfigurationDeleteOAuthConfig- Delete OAuth configurationoAuthConfigurationDeleteToolsetOAuthConfig- Delete OAuth configoAuthConfigurationGetOAuthConfig- Get OAuth configurationoAuthConfigurationGetOAuthConnectorType- Get OAuth connector type detailsoAuthConfigurationGetOAuthRegistry- List OAuth-capable connector typesoAuthConfigurationListOAuthConfigs- List OAuth configurationsoAuthConfigurationListOAuthConfigsByType- List OAuth configs for connector typeoAuthConfigurationListToolsetOAuthConfigs- List OAuth configs by toolset typeoAuthConfigurationUpdateOAuthConfig- Update OAuth configurationoAuthConfigurationUpdateToolsetOAuthConfig- Update OAuth configoAuthExchangeOAuthCode- Exchange OAuth authorization code for tokensoAuthProviderOauthAuthorize- Initiate OAuth authorization flowoAuthProviderOauthAuthorizeConsent- Submit authorization consentoAuthProviderOauthIntrospect- Introspect a tokenoAuthProviderOauthRevoke- Revoke an access or refresh tokenoAuthProviderOauthToken- Exchange authorization code for tokensopenIDConnectJwks- JSON Web Key SetopenIDConnectOauthUserInfo- Get authenticated user informationopenIDConnectOpenidConfiguration- OpenID Connect DiscoveryorganizationAuthConfigGetAuthMethods- Get organization authentication methodsorganizationAuthConfigSetUpAuthConfig- Set up auth configurationorganizationAuthConfigUpdateAuthMethod- Update organization authentication methodsorganizationsCheckOrgExists- Check if organization existsorganizationsCreateOrganization- Create organizationorganizationsDeleteOrganization- Delete organizationorganizationsDeleteOrganizationLogo- Delete organization logoorganizationsGetCurrentOrganization- Get current organizationorganizationsGetOnboardingStatus- Get onboarding statusorganizationsGetOrganizationLogo- Get organization logoorganizationsUpdateOnboardingStatus- Update onboarding statusorganizationsUpdateOrganization- Update organizationorganizationsUploadOrganizationLogo- Upload organization logopermissionsCreateKBPermission- Grant permissionspermissionsDeleteKBPermissions- Remove permissionspermissionsListKBPermissions- List permissionspermissionsUpdateKBPermissions- Update permissionsplatformSettingsGetAvailableFeatureFlags- Get available feature flagsplatformSettingsGetCustomSystemPrompt- Get custom system promptplatformSettingsGetPlatformSettings- Get platform settingsplatformSettingsSetCustomSystemPrompt- Update custom system promptplatformSettingsSetPlatformSettings- Update platform settingspublicURLsGetConnectorPublicUrl- Get connector public URLpublicURLsGetFrontendPublicUrl- Get frontend public URLpublicURLsSetConnectorPublicUrl- Set connector public URLpublicURLsSetFrontendPublicUrl- Set frontend public URLrecordsDeleteRecord- Delete recordrecordsGetAllRecords- Get all records across knowledge basesrecordsGetKBChildren- Get KB children (alias for records)recordsGetKBRecords- Get records for a knowledge baserecordsGetRecordById- Get record by IDrecordsStreamRecordBuffer- Stream record contentrecordsUpdateRecord- Update recordsamlSAMLSignInCallback- SAML sign-in callbacksamlSignInViaSAML- Initiate SAML sign-in flowsemanticSearchArchiveSearch- Archive a searchsemanticSearchDeleteAllSearchHistory- Clear all search historysemanticSearchDeleteSearchById- Delete search by IDsemanticSearchGetSearchById- Get search by IDsemanticSearchSearch- Perform semantic searchsemanticSearchSearchHistory- Get search historysemanticSearchShareSearch- Share a searchsemanticSearchUnarchiveSearch- Unarchive a searchsemanticSearchUnshareSearch- Unshare a searchsmtpConfigurationCreateSMTPConfig- Create or update SMTP configurationsmtpConfigurationGetSMTPConfig- Get SMTP configurationstorageConfigurationGetStorageConfig- Get current storage configurationteamsAddUsersToTeam- Add users to teamteamsCreateTeam- Create a teamteamsDeleteTeam- Delete teamteamsGetTeamById- Get team by IDteamsGetTeamUsers- Get users in teamteamsGetUserCreatedTeams- Get user created teamsteamsGetUserTeams- Get current user's teamsteamsListTeams- List teamsteamsRemoveUserFromTeam- Remove user from teamteamsUpdateTeam- Update teamteamsUpdateTeamUsersPermissions- Update team users permissionstoolsetConfigurationDeleteToolsetConfig- Delete toolset configurationtoolsetConfigurationGetToolsetConfig- Get toolset configurationtoolsetConfigurationUpdateToolsetConfig- Update toolset configurationtoolsetInstancesAuthenticateToolsetInstance- Authenticate toolset instancetoolsetInstancesCheckToolsetStatus- Check toolset statustoolsetInstancesCreateToolset- Create toolset instancetoolsetInstancesCreateToolsetInstance- Create toolset instancetoolsetInstancesDeleteToolsetInstance- Delete toolset instancetoolsetInstancesGetMyToolsets- List my toolsets with auth statustoolsetInstancesGetToolsetInstance- Get toolset instancetoolsetInstancesGetToolsetInstances- List toolset instancestoolsetInstancesGetToolsetInstanceStatus- Get instance authentication statustoolsetInstancesListConfiguredToolsets- List configured toolsetstoolsetInstancesReauthenticateToolset- Reauthenticate toolsettoolsetInstancesReauthenticateToolsetInstance- Mark instance for reauthenticationtoolsetInstancesRemoveToolsetCredentials- Remove toolset credentialstoolsetInstancesUpdateToolsetInstance- Update toolset instancetoolsetOAuthGetInstanceOAuthAuthorizationUrl- Get OAuth authorization URL for instancetoolsetOAuthGetToolsetOAuthUrl- Get OAuth authorization URLtoolsetOAuthHandleToolsetOAuthCallback- Handle OAuth callbacktoolsetRegistryGetToolsetSchema- Get toolset schematoolsetRegistryListToolsetRegistry- List available toolsetsuploadGetUploadLimits- Get upload limitsuploadUploadRecordsToFolder- Upload files to folderuploadUploadRecordsToKB- Upload files to knowledge baseuserAccountAuthenticate- Authenticate user with credentialsuserAccountForgotPassword- Request password reset emailuserAccountGenerateLoginOtp- Generate and send OTP for loginuserAccountInitAuth- Initialize authentication sessionuserAccountLogout- Logout current sessionuserAccountRefreshToken- Refresh access tokenuserAccountResetPassword- Reset passworduserAccountResetPasswordWithToken- Reset password with email tokenuserGroupsAddUsersToGroup- Add users to groupuserGroupsCreateUserGroup- Create user groupuserGroupsDeleteUserGroup- Delete user groupuserGroupsGetAllUserGroups- Get all user groupsuserGroupsGetGroupsForUser- Get groups for a useruserGroupsGetGroupStatistics- Get group statisticsuserGroupsGetUserGroupById- Get user group by IDuserGroupsGetUsersInGroup- Get users in groupuserGroupsRemoveUsersFromGroup- Remove users from groupuserGroupsUpdateUserGroup- Update user groupusersAdminCheck- Check if user is adminusersBulkInviteUsers- Bulk invite usersusersCreateUser- Create a new userusersDeleteUser- Delete userusersGetAllUsers- Get all usersusersGetAllUsersWithGroups- Get all users with groupsusersGetUserById- Get user by IDusersGetUserDisplayPicture- Get display pictureusersGetUserEmailById- Get user email by IDusersGetUsersByIds- Get users by IDsusersGetUserTeamsViaUsers- Get user teamsusersListUsersGraph- List users (paginated with graph data)usersRemoveUserDisplayPicture- Remove display pictureusersResendUserInvite- Resend user inviteusersUnblockUser- Unblock a user in organizationusersUpdateDesignation- Update user designationusersUpdateEmail- Update user emailusersUpdateFirstName- Update user first nameusersUpdateFullName- Update user full nameusersUpdateLastName- Update user last nameusersUpdateUser- Update userusersUploadUserDisplayPicture- Upload display picture- Exchange Google authorization code for tokensconnectorOAuthGetTokenFromCode⚠️ Deprecated- Save toolset configurationtoolsetConfigurationSaveToolsetConfig⚠️ Deprecated
Server-sent events are used to stream content from certain
operations. These operations will expose the stream as an async iterable that
can be consumed using a for await...of loop. The loop will
terminate when the server no longer has any events to send and closes the
underlying connection.
import { Pipeshub } from "@pipeshub-ai/sdk";
const pipeshub = new Pipeshub({
security: {
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
},
});
async function run() {
const result = await pipeshub.conversations.streamChat({
query: "What are the key findings from our Q4 financial report?",
recordIds: [
"507f1f77bcf86cd799439011",
"507f1f77bcf86cd799439012",
],
modelKey: "gpt-4-turbo",
modelName: "GPT-4 Turbo",
chatMode: "balanced",
});
for await (const event of result) {
console.log(event);
}
}
run();Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
Tip
Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
- Node.js v20+: Since v20, Node.js comes with a native
openAsBlobfunction innode:fs. - Bun: The native
Bun.filefunction produces a file handle that can be used for streaming file uploads. - Browsers: All supported browsers return an instance to a
Filewhen reading the value from an<input type="file">element. - Node.js v18: A file stream can be created using the
fileFromhelper fromfetch-blob/from.js.
import { Pipeshub } from "@pipeshub-ai/sdk";
import { openAsBlob } from "node:fs";
const pipeshub = new Pipeshub({
security: {
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
},
});
async function run() {
const result = await pipeshub.users.uploadUserDisplayPicture({
file: await openAsBlob("example.file"),
});
console.log(result);
}
run();Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
import { Pipeshub } from "@pipeshub-ai/sdk";
const pipeshub = new Pipeshub();
async function run() {
const result = await pipeshub.userAccount.initAuth({
email: "user@example.com",
}, {
retries: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
});
console.log(result);
}
run();If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
import { Pipeshub } from "@pipeshub-ai/sdk";
const pipeshub = new Pipeshub({
retryConfig: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
});
async function run() {
const result = await pipeshub.userAccount.initAuth({
email: "user@example.com",
});
console.log(result);
}
run();PipeshubError is the base class for all HTTP error responses. It has the following properties:
| Property | Type | Description |
|---|---|---|
error.message |
string |
Error message |
error.statusCode |
number |
HTTP response status code eg 404 |
error.headers |
Headers |
HTTP response headers |
error.body |
string |
HTTP body. Can be empty string if no body is returned. |
error.rawResponse |
Response |
Raw HTTP response |
error.data$ |
Optional. Some errors may contain structured data. See Error Classes. |
import { Pipeshub } from "@pipeshub-ai/sdk";
import * as errors from "@pipeshub-ai/sdk/models/errors";
const pipeshub = new Pipeshub();
async function run() {
try {
const result = await pipeshub.userAccount.initAuth({
email: "user@example.com",
});
console.log(result);
} catch (error) {
// The base class for HTTP error responses
if (error instanceof errors.PipeshubError) {
console.log(error.message);
console.log(error.statusCode);
console.log(error.body);
console.log(error.headers);
// Depending on the method different errors may be thrown
if (error instanceof errors.AuthError) {
console.log(error.data$.error); // string
console.log(error.data$.message); // string
console.log(error.data$.code); // string
console.log(error.data$.statusCode); // number
}
}
}
}
run();Primary error:
PipeshubError: The base class for HTTP error responses.
Less common errors (11)
Network errors:
ConnectionError: HTTP client was unable to make a request to a server.RequestTimeoutError: HTTP request timed out due to an AbortSignal signal.RequestAbortedError: HTTP request was aborted by the client.InvalidRequestError: Any input used to create a request is invalid.UnexpectedClientError: Unrecognised or unexpected error.
Inherit from PipeshubError:
AuthError: Authentication error response with details for debugging and user feedback.
Common Error Codes:
INVALID_CREDENTIALS- Wrong password or OTPACCOUNT_BLOCKED- Account locked after 5 failed attemptsSESSION_EXPIRED- Session token has expiredOTP_EXPIRED- OTP code has expired (10 min validity)USER_NOT_FOUND- Email not registeredINVALID_TOKEN- JWT token is invalid or malformedMETHOD_NOT_ALLOWED- Auth method not enabled for org
OAuthErrorResponse: OAuth 2.0 Error Response (RFC 6749 Section 5.2). Standard error format for OAuth endpoints. Applicable to 5 of 270 methods.*ResetPasswordBadRequestError: Invalid current password or weak new password. Status code400. Applicable to 1 of 270 methods.*SamlSignInCallbackBadRequestError: Invalid SAML response. Status code400. Applicable to 1 of 270 methods.*UnauthorizedError: SAML authentication failed. Status code401. Applicable to 1 of 270 methods.*ResponseValidationError: Type mismatch between the data returned from the server and the structure expected by the SDK. Seeerror.rawValuefor the raw value anderror.pretty()for a nicely formatted multi-line string.
* Check the method documentation to see if the error is applicable.
The default server https://{instance_url}/api/v1 contains variables and is set to https://https://app.pipeshub.com/api/v1 by default. To override default values, the following parameters are available when initializing the SDK client instance:
| Variable | Parameter | Default | Description |
|---|---|---|---|
instance_url |
instanceUrl: string |
"https://app.pipeshub.com" |
Base server URL (without /api/v1) |
import { Pipeshub } from "@pipeshub-ai/sdk";
const pipeshub = new Pipeshub({
serverIdx: 0,
instanceUrl: "https://app.pipeshub.com",
});
async function run() {
const result = await pipeshub.userAccount.initAuth({
email: "user@example.com",
});
console.log(result);
}
run();The default server can be overridden globally by passing a URL to the serverURL: string optional parameter when initializing the SDK client instance. For example:
import { Pipeshub } from "@pipeshub-ai/sdk";
const pipeshub = new Pipeshub({
serverURL: "https://https://app.pipeshub.com/api/v1",
});
async function run() {
const result = await pipeshub.userAccount.initAuth({
email: "user@example.com",
});
console.log(result);
}
run();The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example:
import { Pipeshub } from "@pipeshub-ai/sdk";
const pipeshub = new Pipeshub();
async function run() {
const result = await pipeshub.openIDConnect.openidConfiguration({
serverURL: "",
});
console.log(result);
}
run();The TypeScript SDK makes API calls using an HTTPClient that wraps the native
Fetch API. This
client is a thin wrapper around fetch and provides the ability to attach hooks
around the request lifecycle that can be used to modify the request or handle
errors and response.
The HTTPClient constructor takes an optional fetcher argument that can be
used to integrate a third-party HTTP client or when writing tests to mock out
the HTTP client and feed in fixtures.
The following example shows how to:
- route requests through a proxy server using undici's ProxyAgent
- use the
"beforeRequest"hook to add a custom header and a timeout to requests - use the
"requestError"hook to log errors
import { Pipeshub } from "@pipeshub-ai/sdk";
import { ProxyAgent } from "undici";
import { HTTPClient } from "@pipeshub-ai/sdk/lib/http";
const dispatcher = new ProxyAgent("http://proxy.example.com:8080");
const httpClient = new HTTPClient({
// 'fetcher' takes a function that has the same signature as native 'fetch'.
fetcher: (input, init) =>
// 'dispatcher' is specific to undici and not part of the standard Fetch API.
fetch(input, { ...init, dispatcher } as RequestInit),
});
httpClient.addHook("beforeRequest", (request) => {
const nextRequest = new Request(request, {
signal: request.signal || AbortSignal.timeout(5000)
});
nextRequest.headers.set("x-custom-header", "custom value");
return nextRequest;
});
httpClient.addHook("requestError", (error, request) => {
console.group("Request Error");
console.log("Reason:", `${error}`);
console.log("Endpoint:", `${request.method} ${request.url}`);
console.groupEnd();
});
const sdk = new Pipeshub({ httpClient: httpClient });You can setup your SDK to emit debug logs for SDK requests and responses.
You can pass a logger that matches console's interface as an SDK option.
Warning
Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
import { Pipeshub } from "@pipeshub-ai/sdk";
const sdk = new Pipeshub({ debugLogger: console });