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.
Tip
To finish publishing your SDK to npm and others you must run your first generation action.
The SDK can be installed with either npm, pnpm, bun or yarn package managers.
npm add <UNSET>pnpm add <UNSET>bun add <UNSET>yarn add <UNSET>Note
This package is published with CommonJS and ES Modules (ESM) support.
For supported JavaScript runtimes, please consult RUNTIMES.md.
import { Pipeshub } from "pipeshub";
const pipeshub = new Pipeshub({
serverURL: "https://api.example.com",
});
async function run() {
const result = await pipeshub.userAccount.initializeAuth({
email: "user@example.com",
});
console.log(result);
}
run();This SDK supports the following security scheme globally:
| Name | Type | Scheme | Environment Variable |
|---|---|---|---|
bearerAuth |
http | HTTP Bearer | PIPESHUB_BEARER_AUTH |
To authenticate with the API the bearerAuth parameter must be set when initializing the SDK client instance. For example:
import { Pipeshub } from "pipeshub";
const pipeshub = new Pipeshub({
serverURL: "https://api.example.com",
bearerAuth: process.env["PIPESHUB_BEARER_AUTH"] ?? "",
});
async function run() {
const result = await pipeshub.userAccount.initializeAuth({
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";
const pipeshub = new Pipeshub({
serverURL: "https://api.example.com",
});
async function run() {
const result = await pipeshub.userAccount.resetPasswordWithToken({
scopedToken: process.env["PIPESHUB_SCOPED_TOKEN"] ?? "",
}, {
password: "H9GEHoL829GXj06",
});
console.log(result);
}
run();Available methods
- list - List agent conversations
- start - Create agent conversation
- stream - Create agent conversation with streaming
- get - Get agent conversation
- delete - Delete agent conversation
- addMessage - Add message to agent conversation
- streamMessage - Add message with streaming
- regenerate - Regenerate agent response
- list - List agents
- create - Create agent
- listTools - List available tools
- get - Get agent
- update - Update agent
- delete - Delete agent
- getPermissions - Get agent permissions
- updatePermissions - Update agent permissions
- share - Share agent
- unshare - Revoke agent access
- list - List agent templates
- create - Create agent template
- get - Get agent template
- update - Update agent template
- delete - Delete agent template
- list - Get all AI model providers
- getByType - Get models by type
- getAvailableModelsByType - Get available models for selection
- add - Add new AI model provider
- update - Update AI model provider
- delete - Delete AI model provider
- setDefault - Set default AI model
- getMicrosoft - Get Microsoft authentication configuration
- setAzureAdAuthConfig - Configure Azure AD authentication
- getAzureAd - Get Azure AD configuration
- setGoogleAuthConfig - Configure Google authentication
- getGoogle - Get Google authentication configuration
- setupSso - Configure SAML SSO authentication
- getSsoConfig - Get SAML SSO configuration
- setupOAuth - Configure generic OAuth provider
- getOAuth - Get generic OAuth configuration
- configureMicrosoft - Configure Microsoft authentication
- reindex - Reindex single record
- reindexRecordGroup - Reindex record group
- reindexFailed - Reindex failed connector records
- resync - Resync connector
- getStats - Get connector statistics
- get - Get connector configuration
- update - Update connector configuration
- updateFiltersSync - Update filters and sync configuration
- updateAuth - Update authentication configuration
- getGoogleWorkspaceCredentials - Get Google Workspace credentials status
- toggle - Toggle connector sync or agent
- getOptions - Get filter options
- save - Save filter selections
- getFieldOptions - Get dynamic filter options
- list - List connector instances
- create - Create connector instance
- listActive - List active connector instances
- listInactive - List inactive connector instances
- listConfigured - List configured connector instances
- getActiveAgents - List active agent connectors
- get - Get connector instance
- delete - Delete connector instance
- updateName - Update connector instance name
- getTokenFromCode - Exchange authorization code for tokens (legacy)
- getAuthorizationUrl - Get OAuth authorization URL
- handleCallback - OAuth callback handler
- getAtlassianConfig - Get Atlassian OAuth configuration
- getOneDriveConfig - Get OneDrive configuration
- createGoogleWorkspaceCredentials - Upload Google Workspace credentials
- getGoogleWorkspace - Get Google Workspace OAuth configuration
- setAtlassianConfig - Configure Atlassian OAuth
- getSharePointConfig - Get SharePoint configuration
- setGoogleWorkspaceOauth - Configure Google Workspace OAuth
- configureOneDrive - Configure OneDrive connector
- setSharePointConfig - Configure SharePoint connector
- checkHealth - [Connector Service] Health check
- postDrive - [Connector Service] Google Drive webhook
- internalStreamRecord - [Connector Service] Internal stream record
- convertRecordBuffer - [Connector Service] Convert record buffer
- getStats - [Connector Service] Get connector statistics
- getSignedUrl - [Connector Service] Get signed URL for record
- reindexFailedRecords - [Connector Service] Reindex all failed records
- create - Create a new AI conversation
- stream - Create conversation with streaming response
- list - List all conversations
- listArchived - List archived conversations
- get - Get conversation by ID
- delete - Delete conversation
- addMessage - Add message to conversation
- addMessageStream - Add message with streaming response
- share - Share conversation with users
- unshare - Revoke conversation access
- updateTitle - Update conversation title
- patchArchive - Archive conversation
- unarchive - Unarchive conversation
- regenerateAnswer - Regenerate AI response
- updateMessageFeedback - Submit feedback on AI response
- schedule - Schedule a crawling job
- getStatus - Get crawling job status
- remove - Remove a crawling job
- pause - Pause a crawling job
- resume - Resume a paused crawling job
- list - Get all crawling job statuses
- removeAll - Remove all crawling jobs
- healthCheck - [Docling Service] Health check
- processPdf - [Docling Service] Process PDF document
- parsePdf - [Docling Service] Parse PDF (Phase 1)
- createBlocks - [Docling Service] Create blocks from parse result (Phase 2)
- upload - Upload a new document
- createPlaceholder - Create document placeholder
- getDirectUploadUrl - Get direct upload URL
- send - Send a transactional email
- create - Create root folder
- getContents - Get folder contents
- update - Update folder
- delete - Delete folder
- createSubfolder - Create subfolder
- health - [Indexing Service] Health check
- create - Create a new knowledge base
- list - List all knowledge bases
- get - Get knowledge base by ID
- update - Update knowledge base
- delete - Delete knowledge base
- getRootNodes - Get knowledge hub root nodes
- getHubChildNodes - Get knowledge hub child nodes
- updateSmtp - Reload SMTP configuration
- getConfiguration - Get metrics collection configuration
- setPushInterval - Configure metrics push interval
- setServerUrl - Configure metrics server URL
- toggle - Enable or disable metrics collection
- exchangeCode - Exchange OAuth authorization code for tokens
- list - List OAuth apps
- create - Create OAuth app
- listScopes - List available scopes
- get - Get OAuth app details
- update - Update OAuth app
- delete - Delete OAuth app
- regenerateSecret - Regenerate client secret
- suspend - Suspend OAuth app
- activate - Activate suspended OAuth app
- listTokens - List app tokens
- revokeAllTokens - Revoke all app tokens
- getRegistry - List OAuth-capable connector types
- list - List OAuth configurations
- listConfigsByType - List OAuth configs for connector type
- get - Get OAuth configuration
- update - Update OAuth configuration
- create - Create OAuth configuration
- getConnectorType - Get OAuth connector type details
- deleteConfiguration - Delete OAuth configuration
- authorize - Initiate OAuth authorization flow
- submitConsent - Submit authorization consent
- exchange - Exchange authorization code for tokens
- revokeToken - Revoke an access or refresh token
- introspect - Introspect a token
- getUserInfo - Get authenticated user information
- getConfiguration - OpenID Connect Discovery
- jwks - JSON Web Key Set
- getAuthMethods - Get organization authentication methods
- create - Create organization authentication configuration
- updateMethod - Update organization authentication methods
- checkExists - Check if organization exists
- create - Create organization
- getCurrent - Get current organization
- update - Update organization
- delete - Delete organization
- uploadLogo - Upload organization logo
- getLogo - Get organization logo
- deleteLogo - Delete organization logo
- getOnboardingStatus - Get onboarding status
- updateOnboardingStatus - Update onboarding status
- grant - Grant permissions
- list - List permissions
- update - Update permissions
- remove - Remove permissions
- update - Update platform settings
- get - Get platform settings
- getFeatureFlags - Get available feature flags
- updateSystemPrompt - Update custom system prompt
- getCustomSystemPrompt - Get custom system prompt
- setFrontendUrl - Set frontend public URL
- getFrontend - Get frontend public URL
- setConnector - Set connector public URL
- getConnector - Get connector public URL
- search - [Query Service] Semantic search
- chat - [Query Service] Chat with knowledge base
- chatStream - [Query Service] Streaming chat with knowledge base
- healthCheck - [Query Service] AI model health check
- listTools - [Query Service] List available agent tools
- getHealth - [Query Service] Health check
- getStats - Get queue statistics
- get - Get all records across knowledge bases
- list - Get records for a knowledge base
- getById - Get record by ID
- update - Update record
- delete - Delete record
- streamContent - Stream record content
- move - Move a record to another folder
- signIn - Initiate SAML sign-in flow
- callback - SAML authentication callback
- updateAppConfig - Reload SAML application configuration (Internal)
- postSearch - Perform semantic search
- getHistory - Get search history
- deleteAllHistory - Clear all search history
- getById - Get search by ID
- delete - Delete search
- patchShare - Share search results
- unshare - Revoke search access
- archive - Archive search
- unarchive - Unarchive search
- createOrUpdate - Create or update SMTP configuration
- get - Get SMTP configuration
- configureLocal - Configure Local Storage
- createS3StorageConfig - Configure AWS S3 Storage
- createAzureBlob - Configure Azure Blob Storage
- get - Get current storage configuration
- create - Create a team
- list - List teams
- get - Get team by ID
- update - Update team
- delete - Delete team
- getUsers - Get team members
- addUsers - Add users to team
- removeUsers - Remove users from team
- updatePermissions - Update user role in team
- getUser - Get current user's teams
- getCreatedByUser - Get teams created by current user
- files - Upload files to knowledge base
- toFolder - Upload files to folder
- getLimits - Get upload limits
- initializeAuth - Initialize authentication session
- authenticate - Authenticate user with credentials
- generateLoginOtp - Generate and send OTP for login
- resetPassword - Reset password (authenticated user)
- forgotPassword - Request password reset email
- resetPasswordWithToken - Reset password with email token
- checkPasswordStatus - Check if user has password set (Internal)
- refresh - Refresh access token
- logout - Logout current session
- create - Create user group
- list - Get all user groups
- getById - Get user group by ID
- update - Update user group
- delete - Delete user group
- addUsers - Add users to group
- removeUsers - Remove users from group
- getUsers - Get users in a group
- getUserGroups - Get groups for a user
- getStats - Get user group statistics
- get - Get all users
- create - Create a new user
- getById - Get user by ID
- update - Update user
- delete - Delete user
- fetchWithGroups - Get all users with their groups
- getEmail - Get user email by ID
- getByIds - Get users by IDs (bulk)
- checkExistsByEmail - Check if user exists by email
- getInternal - Get user (internal service-to-service)
- updateFullName - Update user full name
- updateFirstName - Update user first name
- updateLastName - Update user last name
- updateDesignation - Update user designation
- checkIsAdmin - Check if user is admin
- uploadDisplayPicture - Upload display picture
- getDisplayPicture - Get display picture
- removeDisplayPicture - Remove display picture
- bulkInvite - Bulk invite users
- resendInvite - Resend user invite
- listGraph - List users (paginated with graph data)
- listTeams - Get current user's teams
- uploadNext - Upload next version
- rollBack - Rollback to previous version
- checkModified - Check if document is modified
- verifyGmail - [Connector Service] Gmail webhook verification
- postGmail - [Connector Service] Gmail webhook
- handle - [Connector Service] Google Workspace Admin webhook
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
agentConversationsAddMessage- Add message to agent conversationagentConversationsDelete- Delete agent conversationagentConversationsGet- Get agent conversationagentConversationsList- List agent conversationsagentConversationsRegenerate- Regenerate agent responseagentConversationsStart- Create agent conversationagentConversationsStream- Create agent conversation with streamingagentConversationsStreamMessage- Add message with streamingagentsCreate- Create agentagentsDelete- Delete agentagentsGet- Get agentagentsGetPermissions- Get agent permissionsagentsList- List agentsagentsListTools- List available toolsagentsShare- Share agentagentsUnshare- Revoke agent accessagentsUpdate- Update agentagentsUpdatePermissions- Update agent permissionsagentTemplatesCreate- Create agent templateagentTemplatesDelete- Delete agent templateagentTemplatesGet- Get agent templateagentTemplatesList- List agent templatesagentTemplatesUpdate- Update agent templateaiModelsConfigurationCreate- Bulk create AI models configurationaiModelsConfigurationGetAll- Get all AI models configurationaiModelsProvidersAdd- Add new AI model provideraiModelsProvidersDelete- Delete AI model provideraiModelsProvidersGetAvailableModelsByType- Get available models for selectionaiModelsProvidersGetByType- Get models by typeaiModelsProvidersList- Get all AI model providersaiModelsProvidersSetDefault- Set default AI modelaiModelsProvidersUpdate- Update AI model providerauthConfigGetMicrosoft- Get Microsoft authentication configurationauthenticationConfigurationGetAzureAd- Get Azure AD configurationauthenticationConfigurationGetGoogle- Get Google authentication configurationauthenticationConfigurationGetOAuth- Get generic OAuth configurationauthenticationConfigurationGetSsoConfig- Get SAML SSO configurationauthenticationConfigurationsConfigureMicrosoft- Configure Microsoft authenticationauthenticationConfigurationSetAzureAdAuthConfig- Configure Azure AD authenticationauthenticationConfigurationSetGoogleAuthConfig- Configure Google authenticationauthenticationConfigurationSetupOAuth- Configure generic OAuth providerauthenticationConfigurationSetupSso- Configure SAML SSO authenticationconnectorConfigurationGet- Get connector configurationconnectorConfigurationsGetGoogleWorkspaceCredentials- Get Google Workspace credentials statusconnectorConfigurationsUpdateAuth- Update authentication configurationconnectorConfigurationUpdate- Update connector configurationconnectorConfigurationUpdateFiltersSync- Update filters and sync configurationconnectorControlToggle- Toggle connector sync or agentconnectorFiltersGetFieldOptions- Get dynamic filter optionsconnectorFiltersGetOptions- Get filter optionsconnectorFiltersSave- Save filter selectionsconnectorGetStats- Get connector statisticsconnectorInstancesCreate- Create connector instanceconnectorInstancesDelete- Delete connector instanceconnectorInstancesGet- Get connector instanceconnectorInstancesGetActiveAgents- List active agent connectorsconnectorInstancesList- List connector instancesconnectorInstancesListActive- List active connector instancesconnectorInstancesListConfigured- List configured connector instancesconnectorInstancesListInactive- List inactive connector instancesconnectorInstancesUpdateName- Update connector instance nameconnectorOAuthConfigurationCreateGoogleWorkspaceCredentials- Upload Google Workspace credentialsconnectorOauthConfigurationGetAtlassianConfig- Get Atlassian OAuth configurationconnectorOAuthConfigurationGetGoogleWorkspace- Get Google Workspace OAuth configurationconnectorOauthConfigurationGetOneDriveConfig- Get OneDrive configurationconnectorOAuthConfigurationGetSharePointConfig- Get SharePoint configurationconnectorOAuthConfigurationsConfigureOneDrive- Configure OneDrive connectorconnectorOAuthConfigurationSetAtlassianConfig- Configure Atlassian OAuthconnectorOAuthConfigurationsSetGoogleWorkspaceOauth- Configure Google Workspace OAuthconnectorOAuthConfigurationsSetSharePointConfig- Configure SharePoint connectorconnectorOAuthGetAuthorizationUrl- Get OAuth authorization URLconnectorOAuthGetTokenFromCode- Exchange authorization code for tokens (legacy)connectorOAuthHandleCallback- OAuth callback handlerconnectorRegistryGetSchema- Get connector configuration schemaconnectorRegistryList- List available connector typesconnectorReindex- Reindex single recordconnectorReindexFailed- Reindex failed connector recordsconnectorReindexRecordGroup- Reindex record groupconnectorResync- Resync connectorconnectorServiceCheckHealth- [Connector Service] Health checkconnectorServiceConvertRecordBuffer- [Connector Service] Convert record bufferconnectorServiceGetSignedUrl- [Connector Service] Get signed URL for recordconnectorServiceGetStats- [Connector Service] Get connector statisticsconnectorServiceInternalStreamRecord- [Connector Service] Internal stream recordconnectorServicePostDrive- [Connector Service] Google Drive webhookconnectorServicesReindexFailedRecords- [Connector Service] Reindex all failed recordsconversationsAddMessage- Add message to conversationconversationsAddMessageStream- Add message with streaming responseconversationsCreate- Create a new AI conversationconversationsDelete- Delete conversationconversationsGet- Get conversation by IDconversationsList- List all conversationsconversationsListArchived- List archived conversationsconversationsPatchArchive- Archive conversationconversationsRegenerateAnswer- Regenerate AI responseconversationsShare- Share conversation with usersconversationsStream- Create conversation with streaming responseconversationsUnarchive- Unarchive conversationconversationsUnshare- Revoke conversation accessconversationsUpdateMessageFeedback- Submit feedback on AI responseconversationsUpdateTitle- Update conversation titlecrawlingJobsGetStatus- Get crawling job statuscrawlingJobsList- Get all crawling job statusescrawlingJobsPause- Pause a crawling jobcrawlingJobsRemove- Remove a crawling jobcrawlingJobsRemoveAll- Remove all crawling jobscrawlingJobsResume- Resume a paused crawling jobcrawlingJobsSchedule- Schedule a crawling jobdoclingServiceCreateBlocks- [Docling Service] Create blocks from parse result (Phase 2)doclingServiceHealthCheck- [Docling Service] Health checkdoclingServiceParsePdf- [Docling Service] Parse PDF (Phase 1)doclingServiceProcessPdf- [Docling Service] Process PDF documentdocumentBufferGet- Get document bufferdocumentBufferUpdate- Update document bufferdocumentManagementDelete- Delete documentdocumentManagementDownload- Download documentdocumentManagementGetById- Get document by IDdocumentUploadCreatePlaceholder- Create document placeholderdocumentUploadGetDirectUploadUrl- Get direct upload URLdocumentUploadUpload- Upload a new documentemailOperationsSend- Send a transactional emailfoldersCreate- Create root folderfoldersCreateSubfolder- Create subfolderfoldersDelete- Delete folderfoldersGetContents- Get folder contentsfoldersUpdate- Update folderindexingServiceHealth- [Indexing Service] Health checkknowledgeBasesCreate- Create a new knowledge baseknowledgeBasesDelete- Delete knowledge baseknowledgeBasesGet- Get knowledge base by IDknowledgeBasesGetHubChildNodes- Get knowledge hub child nodesknowledgeBasesGetRootNodes- Get knowledge hub root nodesknowledgeBasesList- List all knowledge basesknowledgeBasesUpdate- Update knowledge basemailConfigurationUpdateSmtp- Reload SMTP configurationmetricsCollectionGetConfiguration- Get metrics collection configurationmetricsCollectionSetPushInterval- Configure metrics push intervalmetricsCollectionSetServerUrl- Configure metrics server URLmetricsCollectionsToggle- Enable or disable metrics collectionoauthAppsActivate- Activate suspended OAuth appoauthAppsCreate- Create OAuth appoauthAppsDelete- Delete OAuth appoauthAppsGet- Get OAuth app detailsoauthAppsList- List OAuth appsoauthAppsListScopes- List available scopesoauthAppsListTokens- List app tokensoauthAppsRegenerateSecret- Regenerate client secretoauthAppsRevokeAllTokens- Revoke all app tokensoauthAppsSuspend- Suspend OAuth appoauthAppsUpdate- Update OAuth appoAuthConfigurationCreate- Create OAuth configurationoauthConfigurationGet- Get OAuth configurationoauthConfigurationGetRegistry- List OAuth-capable connector typesoauthConfigurationList- List OAuth configurationsoauthConfigurationListConfigsByType- List OAuth configs for connector typeoauthConfigurationsDeleteConfiguration- Delete OAuth configurationoauthConfigurationsGetConnectorType- Get OAuth connector type detailsoauthConfigurationUpdate- Update OAuth configurationoauthExchangeCode- Exchange OAuth authorization code for tokensoauthProviderAuthorize- Initiate OAuth authorization flowoauthProviderExchange- Exchange authorization code for tokensoauthProviderIntrospect- Introspect a tokenoauthProviderRevokeToken- Revoke an access or refresh tokenoauthProviderSubmitConsent- Submit authorization consentopenIDConnectGetConfiguration- OpenID Connect DiscoveryopenIDConnectGetUserInfo- Get authenticated user informationopenIDConnectJwks- JSON Web Key SetorganizationAuthConfigGetAuthMethods- Get organization authentication methodsorganizationAuthConfigsCreate- Create organization authentication configurationorganizationAuthConfigurationUpdateMethod- Update organization authentication methodsorganizationsCheckExists- Check if organization existsorganizationsCreate- Create organizationorganizationsDelete- Delete organizationorganizationsDeleteLogo- Delete organization logoorganizationsGetCurrent- Get current organizationorganizationsGetLogo- Get organization logoorganizationsGetOnboardingStatus- Get onboarding statusorganizationsUpdate- Update organizationorganizationsUpdateOnboardingStatus- Update onboarding statusorganizationsUploadLogo- Upload organization logopermissionsGrant- Grant permissionspermissionsList- List permissionspermissionsRemove- Remove permissionspermissionsUpdate- Update permissionsplatformSettingsGet- Get platform settingsplatformSettingsGetCustomSystemPrompt- Get custom system promptplatformSettingsGetFeatureFlags- Get available feature flagsplatformSettingsUpdate- Update platform settingsplatformSettingsUpdateSystemPrompt- Update custom system promptpublicUrlsGetConnector- Get connector public URLpublicUrlsGetFrontend- Get frontend public URLpublicUrlsSetConnector- Set connector public URLpublicUrlsSetFrontendUrl- Set frontend public URLqueryServiceChat- [Query Service] Chat with knowledge basequeryServiceChatStream- [Query Service] Streaming chat with knowledge basequeryServiceHealthCheck- [Query Service] AI model health checkqueryServiceListTools- [Query Service] List available agent toolsqueryServiceSearch- [Query Service] Semantic searchqueryServicesGetHealth- [Query Service] Health checkqueueManagementGetStats- Get queue statisticsrecordsDelete- Delete recordrecordsGet- Get all records across knowledge basesrecordsGetById- Get record by IDrecordsList- Get records for a knowledge baserecordsMove- Move a record to another folderrecordsStreamContent- Stream record contentrecordsUpdate- Update recordsamlCallback- SAML authentication callbacksamlSignIn- Initiate SAML sign-in flowsamlUpdateAppConfig- Reload SAML application configuration (Internal)semanticSearchArchive- Archive searchsemanticSearchDelete- Delete searchsemanticSearchDeleteAllHistory- Clear all search historysemanticSearchGetById- Get search by IDsemanticSearchGetHistory- Get search historysemanticSearchPatchShare- Share search resultssemanticSearchPostSearch- Perform semantic searchsemanticSearchUnarchive- Unarchive searchsemanticSearchUnshare- Revoke search accesssmtpConfigurationCreateOrUpdate- Create or update SMTP configurationsmtpConfigurationGet- Get SMTP configurationstorageConfigurationConfigureLocal- Configure Local StoragestorageConfigurationCreateAzureBlob- Configure Azure Blob StoragestorageConfigurationCreateS3StorageConfig- Configure AWS S3 StoragestorageConfigurationGet- Get current storage configurationteamsAddUsers- Add users to teamteamsCreate- Create a teamteamsDelete- Delete teamteamsGet- Get team by IDteamsGetCreatedByUser- Get teams created by current userteamsGetUser- Get current user's teamsteamsGetUsers- Get team membersteamsList- List teamsteamsRemoveUsers- Remove users from teamteamsUpdate- Update teamteamsUpdatePermissions- Update user role in teamuploadFiles- Upload files to knowledge baseuploadGetLimits- Get upload limitsuploadToFolder- Upload files to folderuserAccountAuthenticate- Authenticate user with credentialsuserAccountCheckPasswordStatus- Check if user has password set (Internal)userAccountForgotPassword- Request password reset emailuserAccountGenerateLoginOtp- Generate and send OTP for loginuserAccountInitializeAuth- Initialize authentication sessionuserAccountLogout- Logout current sessionuserAccountRefresh- Refresh access tokenuserAccountResetPassword- Reset password (authenticated user)userAccountResetPasswordWithToken- Reset password with email tokenuserGroupsAddUsers- Add users to groupuserGroupsCreate- Create user groupuserGroupsDelete- Delete user groupuserGroupsGetById- Get user group by IDuserGroupsGetStats- Get user group statisticsuserGroupsGetUserGroups- Get groups for a useruserGroupsGetUsers- Get users in a groupuserGroupsList- Get all user groupsuserGroupsRemoveUsers- Remove users from groupuserGroupsUpdate- Update user groupusersBulkInvite- Bulk invite usersusersCheckExistsByEmail- Check if user exists by emailusersCheckIsAdmin- Check if user is adminusersCreate- Create a new userusersDelete- Delete userusersFetchWithGroups- Get all users with their groupsusersGet- Get all usersusersGetById- Get user by IDusersGetByIds- Get users by IDs (bulk)usersGetDisplayPicture- Get display pictureusersGetEmail- Get user email by IDusersGetInternal- Get user (internal service-to-service)usersListGraph- List users (paginated with graph data)usersListTeams- Get current user's teamsusersRemoveDisplayPicture- Remove display pictureusersResendInvite- Resend user inviteusersUpdate- Update userusersUpdateDesignation- Update user designationusersUpdateFirstName- Update user first nameusersUpdateFullName- Update user full nameusersUpdateLastName- Update user last nameusersUploadDisplayPicture- Upload display pictureversionControlCheckModified- Check if document is modifiedversionControlRollBack- Rollback to previous versionversionControlUploadNext- Upload next versionwebhooksHandle- [Connector Service] Google Workspace Admin webhookwebhooksPostGmail- [Connector Service] Gmail webhookwebhooksVerifyGmail- [Connector Service] Gmail webhook verification
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";
const pipeshub = new Pipeshub({
serverURL: "https://api.example.com",
bearerAuth: process.env["PIPESHUB_BEARER_AUTH"] ?? "",
});
async function run() {
const result = await pipeshub.conversations.stream({
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 { openAsBlob } from "node:fs";
import { Pipeshub } from "pipeshub";
const pipeshub = new Pipeshub({
serverURL: "https://api.example.com",
bearerAuth: process.env["PIPESHUB_BEARER_AUTH"] ?? "",
});
async function run() {
const result = await pipeshub.users.uploadDisplayPicture({
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";
const pipeshub = new Pipeshub({
serverURL: "https://api.example.com",
});
async function run() {
const result = await pipeshub.userAccount.initializeAuth({
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";
const pipeshub = new Pipeshub({
serverURL: "https://api.example.com",
retryConfig: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
});
async function run() {
const result = await pipeshub.userAccount.initializeAuth({
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";
import * as errors from "pipeshub/models/errors";
const pipeshub = new Pipeshub({
serverURL: "https://api.example.com",
});
async function run() {
try {
const result = await pipeshub.userAccount.initializeAuth({
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 (13)
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 286 methods.*BadRequestError: Bad request. Possible reasons:
- SMTP not configured properly (missing host, port, or fromEmail)
- Invalid or unknown email template type
- Missing required templateData fields for the selected template
- Invalid email format in sendEmailTo or sendCcTo
400. Applicable to 1 of 286 methods.*NotFoundError: SMTP configuration not found in application config. Status code404. Applicable to 1 of 286 methods.*SendEmailInternalServerError: Internal server error. Email sending failed due to:
- SMTP server connection failure
- Authentication failure with SMTP server
- Template compilation error
- Network issues
500. Applicable to 1 of 286 methods.*FailError: Service is unhealthy or dependency check failed. Status code500. Applicable to 1 of 286 methods.*QueryServiceHealthCheckInternalServerError: Model health check failed. Status code500. Applicable to 1 of 286 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 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";
import { ProxyAgent } from "undici";
import { HTTPClient } from "pipeshub/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";
const sdk = new Pipeshub({ debugLogger: console });You can also enable a default debug logger by setting an environment variable PIPESHUB_DEBUG to true.