lumnisai 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1538,6 +1538,48 @@ class MessagingResource {
1538
1538
  request
1539
1539
  );
1540
1540
  }
1541
+ /**
1542
+ * Cancel a queued draft.
1543
+ *
1544
+ * This cancels a draft that was queued for later sending (status='scheduled').
1545
+ * The draft status will be set to 'discarded' and removed from the send queue.
1546
+ *
1547
+ * Can also cancel drafts in 'pending_review' or 'approved' status.
1548
+ *
1549
+ * @param userId - User ID or email
1550
+ * @param draftId - Draft UUID to cancel
1551
+ * @returns CancelDraftResponse with success status
1552
+ * @throws MessagingValidationError if draft cannot be cancelled (already sent, etc.)
1553
+ * @throws MessagingNotFoundError if draft not found
1554
+ *
1555
+ * @example
1556
+ * ```typescript
1557
+ * // Cancel a queued draft
1558
+ * const result = await client.messaging.cancelDraft('user@example.com', 'draft-uuid');
1559
+ * if (result.success) {
1560
+ * console.log(`Draft cancelled: ${result.draftId}`);
1561
+ * }
1562
+ * ```
1563
+ */
1564
+ async cancelDraft(userId, draftId) {
1565
+ try {
1566
+ const queryParams = new URLSearchParams();
1567
+ queryParams.append("user_id", userId);
1568
+ return await this.http.post(
1569
+ `/messaging/drafts/${encodeURIComponent(draftId)}/cancel?${queryParams.toString()}`
1570
+ );
1571
+ } catch (error) {
1572
+ if (error instanceof NotFoundError) {
1573
+ throw new MessagingNotFoundError(`Draft not found: ${draftId}`);
1574
+ }
1575
+ if (error instanceof ValidationError) {
1576
+ throw new MessagingValidationError(
1577
+ error.message || `Cannot cancel draft: ${draftId}`
1578
+ );
1579
+ }
1580
+ throw error;
1581
+ }
1582
+ }
1541
1583
  /**
1542
1584
  * Delete a single conversation and all its messages.
1543
1585
  *
package/dist/index.d.cts CHANGED
@@ -1578,6 +1578,11 @@ interface ProspectInfo {
1578
1578
  * Merged with batch context (prospect keys take precedence).
1579
1579
  */
1580
1580
  aiContext?: Record<string, any> | null;
1581
+ /**
1582
+ * Queue priority (0-10). Higher = processed first when rate limited.
1583
+ * @default 0
1584
+ */
1585
+ priority?: number;
1581
1586
  }
1582
1587
  /**
1583
1588
  * Request to create batch drafts
@@ -1601,11 +1606,19 @@ interface BatchDraftRequest {
1601
1606
  organizationId?: string | null;
1602
1607
  }
1603
1608
  /**
1604
- * Request to batch send drafts
1609
+ * Request to batch send drafts with optional rate limiting and queue priority.
1605
1610
  */
1606
1611
  interface BatchSendRequest {
1607
1612
  draftIds: string[];
1613
+ /**
1614
+ * Daily send limit (1-100). If not provided, uses subscription-based limits for LinkedIn.
1615
+ */
1608
1616
  sendRatePerDay?: number;
1617
+ /**
1618
+ * Queue priority (0-10). Higher = processed first. Only applies to rate-limited items.
1619
+ * @default 0
1620
+ */
1621
+ priority?: number;
1609
1622
  }
1610
1623
  /**
1611
1624
  * Request to update LinkedIn subscription
@@ -1804,6 +1817,7 @@ interface EmailThreadSummary {
1804
1817
  */
1805
1818
  interface DraftResponse {
1806
1819
  id: string;
1820
+ /** Draft status: 'pending_review' | 'approved' | 'scheduled' | 'sending' | 'sent' | 'failed' | 'discarded' */
1807
1821
  status: string;
1808
1822
  content: string;
1809
1823
  createdAt: string;
@@ -1813,6 +1827,10 @@ interface DraftResponse {
1813
1827
  outreachMethod?: 'direct_message' | 'connection_request' | 'inmail' | 'email' | null;
1814
1828
  /** Subject line for email drafts (optional) */
1815
1829
  subject?: string | null;
1830
+ /** ISO timestamp when queued message will be sent (if status is 'scheduled') */
1831
+ scheduledFor?: string | null;
1832
+ /** Error details if status is 'failed' */
1833
+ errorMessage?: string | null;
1816
1834
  }
1817
1835
  /**
1818
1836
  * Response from batch draft creation (legacy synchronous mode)
@@ -1961,6 +1979,15 @@ interface BatchSendResponse {
1961
1979
  failed: number;
1962
1980
  queued: number;
1963
1981
  }
1982
+ /**
1983
+ * Response from cancelling a draft
1984
+ */
1985
+ interface CancelDraftResponse {
1986
+ success: boolean;
1987
+ draftId?: string;
1988
+ prospectExternalId?: string | null;
1989
+ error?: string;
1990
+ }
1964
1991
  /**
1965
1992
  * Response from deleting a single conversation
1966
1993
  */
@@ -2448,6 +2475,30 @@ declare class MessagingResource {
2448
2475
  * Send multiple drafts with rate limiting
2449
2476
  */
2450
2477
  sendBatchDrafts(userId: string, request: BatchSendRequest): Promise<BatchSendResponse>;
2478
+ /**
2479
+ * Cancel a queued draft.
2480
+ *
2481
+ * This cancels a draft that was queued for later sending (status='scheduled').
2482
+ * The draft status will be set to 'discarded' and removed from the send queue.
2483
+ *
2484
+ * Can also cancel drafts in 'pending_review' or 'approved' status.
2485
+ *
2486
+ * @param userId - User ID or email
2487
+ * @param draftId - Draft UUID to cancel
2488
+ * @returns CancelDraftResponse with success status
2489
+ * @throws MessagingValidationError if draft cannot be cancelled (already sent, etc.)
2490
+ * @throws MessagingNotFoundError if draft not found
2491
+ *
2492
+ * @example
2493
+ * ```typescript
2494
+ * // Cancel a queued draft
2495
+ * const result = await client.messaging.cancelDraft('user@example.com', 'draft-uuid');
2496
+ * if (result.success) {
2497
+ * console.log(`Draft cancelled: ${result.draftId}`);
2498
+ * }
2499
+ * ```
2500
+ */
2501
+ cancelDraft(userId: string, draftId: string): Promise<CancelDraftResponse>;
2451
2502
  /**
2452
2503
  * Delete a single conversation and all its messages.
2453
2504
  *
@@ -3149,4 +3200,4 @@ declare class ProgressTracker {
3149
3200
  */
3150
3201
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
3151
3202
 
3152
- export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
3203
+ export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
package/dist/index.d.mts CHANGED
@@ -1578,6 +1578,11 @@ interface ProspectInfo {
1578
1578
  * Merged with batch context (prospect keys take precedence).
1579
1579
  */
1580
1580
  aiContext?: Record<string, any> | null;
1581
+ /**
1582
+ * Queue priority (0-10). Higher = processed first when rate limited.
1583
+ * @default 0
1584
+ */
1585
+ priority?: number;
1581
1586
  }
1582
1587
  /**
1583
1588
  * Request to create batch drafts
@@ -1601,11 +1606,19 @@ interface BatchDraftRequest {
1601
1606
  organizationId?: string | null;
1602
1607
  }
1603
1608
  /**
1604
- * Request to batch send drafts
1609
+ * Request to batch send drafts with optional rate limiting and queue priority.
1605
1610
  */
1606
1611
  interface BatchSendRequest {
1607
1612
  draftIds: string[];
1613
+ /**
1614
+ * Daily send limit (1-100). If not provided, uses subscription-based limits for LinkedIn.
1615
+ */
1608
1616
  sendRatePerDay?: number;
1617
+ /**
1618
+ * Queue priority (0-10). Higher = processed first. Only applies to rate-limited items.
1619
+ * @default 0
1620
+ */
1621
+ priority?: number;
1609
1622
  }
1610
1623
  /**
1611
1624
  * Request to update LinkedIn subscription
@@ -1804,6 +1817,7 @@ interface EmailThreadSummary {
1804
1817
  */
1805
1818
  interface DraftResponse {
1806
1819
  id: string;
1820
+ /** Draft status: 'pending_review' | 'approved' | 'scheduled' | 'sending' | 'sent' | 'failed' | 'discarded' */
1807
1821
  status: string;
1808
1822
  content: string;
1809
1823
  createdAt: string;
@@ -1813,6 +1827,10 @@ interface DraftResponse {
1813
1827
  outreachMethod?: 'direct_message' | 'connection_request' | 'inmail' | 'email' | null;
1814
1828
  /** Subject line for email drafts (optional) */
1815
1829
  subject?: string | null;
1830
+ /** ISO timestamp when queued message will be sent (if status is 'scheduled') */
1831
+ scheduledFor?: string | null;
1832
+ /** Error details if status is 'failed' */
1833
+ errorMessage?: string | null;
1816
1834
  }
1817
1835
  /**
1818
1836
  * Response from batch draft creation (legacy synchronous mode)
@@ -1961,6 +1979,15 @@ interface BatchSendResponse {
1961
1979
  failed: number;
1962
1980
  queued: number;
1963
1981
  }
1982
+ /**
1983
+ * Response from cancelling a draft
1984
+ */
1985
+ interface CancelDraftResponse {
1986
+ success: boolean;
1987
+ draftId?: string;
1988
+ prospectExternalId?: string | null;
1989
+ error?: string;
1990
+ }
1964
1991
  /**
1965
1992
  * Response from deleting a single conversation
1966
1993
  */
@@ -2448,6 +2475,30 @@ declare class MessagingResource {
2448
2475
  * Send multiple drafts with rate limiting
2449
2476
  */
2450
2477
  sendBatchDrafts(userId: string, request: BatchSendRequest): Promise<BatchSendResponse>;
2478
+ /**
2479
+ * Cancel a queued draft.
2480
+ *
2481
+ * This cancels a draft that was queued for later sending (status='scheduled').
2482
+ * The draft status will be set to 'discarded' and removed from the send queue.
2483
+ *
2484
+ * Can also cancel drafts in 'pending_review' or 'approved' status.
2485
+ *
2486
+ * @param userId - User ID or email
2487
+ * @param draftId - Draft UUID to cancel
2488
+ * @returns CancelDraftResponse with success status
2489
+ * @throws MessagingValidationError if draft cannot be cancelled (already sent, etc.)
2490
+ * @throws MessagingNotFoundError if draft not found
2491
+ *
2492
+ * @example
2493
+ * ```typescript
2494
+ * // Cancel a queued draft
2495
+ * const result = await client.messaging.cancelDraft('user@example.com', 'draft-uuid');
2496
+ * if (result.success) {
2497
+ * console.log(`Draft cancelled: ${result.draftId}`);
2498
+ * }
2499
+ * ```
2500
+ */
2501
+ cancelDraft(userId: string, draftId: string): Promise<CancelDraftResponse>;
2451
2502
  /**
2452
2503
  * Delete a single conversation and all its messages.
2453
2504
  *
@@ -3149,4 +3200,4 @@ declare class ProgressTracker {
3149
3200
  */
3150
3201
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
3151
3202
 
3152
- export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
3203
+ export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -1578,6 +1578,11 @@ interface ProspectInfo {
1578
1578
  * Merged with batch context (prospect keys take precedence).
1579
1579
  */
1580
1580
  aiContext?: Record<string, any> | null;
1581
+ /**
1582
+ * Queue priority (0-10). Higher = processed first when rate limited.
1583
+ * @default 0
1584
+ */
1585
+ priority?: number;
1581
1586
  }
1582
1587
  /**
1583
1588
  * Request to create batch drafts
@@ -1601,11 +1606,19 @@ interface BatchDraftRequest {
1601
1606
  organizationId?: string | null;
1602
1607
  }
1603
1608
  /**
1604
- * Request to batch send drafts
1609
+ * Request to batch send drafts with optional rate limiting and queue priority.
1605
1610
  */
1606
1611
  interface BatchSendRequest {
1607
1612
  draftIds: string[];
1613
+ /**
1614
+ * Daily send limit (1-100). If not provided, uses subscription-based limits for LinkedIn.
1615
+ */
1608
1616
  sendRatePerDay?: number;
1617
+ /**
1618
+ * Queue priority (0-10). Higher = processed first. Only applies to rate-limited items.
1619
+ * @default 0
1620
+ */
1621
+ priority?: number;
1609
1622
  }
1610
1623
  /**
1611
1624
  * Request to update LinkedIn subscription
@@ -1804,6 +1817,7 @@ interface EmailThreadSummary {
1804
1817
  */
1805
1818
  interface DraftResponse {
1806
1819
  id: string;
1820
+ /** Draft status: 'pending_review' | 'approved' | 'scheduled' | 'sending' | 'sent' | 'failed' | 'discarded' */
1807
1821
  status: string;
1808
1822
  content: string;
1809
1823
  createdAt: string;
@@ -1813,6 +1827,10 @@ interface DraftResponse {
1813
1827
  outreachMethod?: 'direct_message' | 'connection_request' | 'inmail' | 'email' | null;
1814
1828
  /** Subject line for email drafts (optional) */
1815
1829
  subject?: string | null;
1830
+ /** ISO timestamp when queued message will be sent (if status is 'scheduled') */
1831
+ scheduledFor?: string | null;
1832
+ /** Error details if status is 'failed' */
1833
+ errorMessage?: string | null;
1816
1834
  }
1817
1835
  /**
1818
1836
  * Response from batch draft creation (legacy synchronous mode)
@@ -1961,6 +1979,15 @@ interface BatchSendResponse {
1961
1979
  failed: number;
1962
1980
  queued: number;
1963
1981
  }
1982
+ /**
1983
+ * Response from cancelling a draft
1984
+ */
1985
+ interface CancelDraftResponse {
1986
+ success: boolean;
1987
+ draftId?: string;
1988
+ prospectExternalId?: string | null;
1989
+ error?: string;
1990
+ }
1964
1991
  /**
1965
1992
  * Response from deleting a single conversation
1966
1993
  */
@@ -2448,6 +2475,30 @@ declare class MessagingResource {
2448
2475
  * Send multiple drafts with rate limiting
2449
2476
  */
2450
2477
  sendBatchDrafts(userId: string, request: BatchSendRequest): Promise<BatchSendResponse>;
2478
+ /**
2479
+ * Cancel a queued draft.
2480
+ *
2481
+ * This cancels a draft that was queued for later sending (status='scheduled').
2482
+ * The draft status will be set to 'discarded' and removed from the send queue.
2483
+ *
2484
+ * Can also cancel drafts in 'pending_review' or 'approved' status.
2485
+ *
2486
+ * @param userId - User ID or email
2487
+ * @param draftId - Draft UUID to cancel
2488
+ * @returns CancelDraftResponse with success status
2489
+ * @throws MessagingValidationError if draft cannot be cancelled (already sent, etc.)
2490
+ * @throws MessagingNotFoundError if draft not found
2491
+ *
2492
+ * @example
2493
+ * ```typescript
2494
+ * // Cancel a queued draft
2495
+ * const result = await client.messaging.cancelDraft('user@example.com', 'draft-uuid');
2496
+ * if (result.success) {
2497
+ * console.log(`Draft cancelled: ${result.draftId}`);
2498
+ * }
2499
+ * ```
2500
+ */
2501
+ cancelDraft(userId: string, draftId: string): Promise<CancelDraftResponse>;
2451
2502
  /**
2452
2503
  * Delete a single conversation and all its messages.
2453
2504
  *
@@ -3149,4 +3200,4 @@ declare class ProgressTracker {
3149
3200
  */
3150
3201
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
3151
3202
 
3152
- export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
3203
+ export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
package/dist/index.mjs CHANGED
@@ -1532,6 +1532,48 @@ class MessagingResource {
1532
1532
  request
1533
1533
  );
1534
1534
  }
1535
+ /**
1536
+ * Cancel a queued draft.
1537
+ *
1538
+ * This cancels a draft that was queued for later sending (status='scheduled').
1539
+ * The draft status will be set to 'discarded' and removed from the send queue.
1540
+ *
1541
+ * Can also cancel drafts in 'pending_review' or 'approved' status.
1542
+ *
1543
+ * @param userId - User ID or email
1544
+ * @param draftId - Draft UUID to cancel
1545
+ * @returns CancelDraftResponse with success status
1546
+ * @throws MessagingValidationError if draft cannot be cancelled (already sent, etc.)
1547
+ * @throws MessagingNotFoundError if draft not found
1548
+ *
1549
+ * @example
1550
+ * ```typescript
1551
+ * // Cancel a queued draft
1552
+ * const result = await client.messaging.cancelDraft('user@example.com', 'draft-uuid');
1553
+ * if (result.success) {
1554
+ * console.log(`Draft cancelled: ${result.draftId}`);
1555
+ * }
1556
+ * ```
1557
+ */
1558
+ async cancelDraft(userId, draftId) {
1559
+ try {
1560
+ const queryParams = new URLSearchParams();
1561
+ queryParams.append("user_id", userId);
1562
+ return await this.http.post(
1563
+ `/messaging/drafts/${encodeURIComponent(draftId)}/cancel?${queryParams.toString()}`
1564
+ );
1565
+ } catch (error) {
1566
+ if (error instanceof NotFoundError) {
1567
+ throw new MessagingNotFoundError(`Draft not found: ${draftId}`);
1568
+ }
1569
+ if (error instanceof ValidationError) {
1570
+ throw new MessagingValidationError(
1571
+ error.message || `Cannot cancel draft: ${draftId}`
1572
+ );
1573
+ }
1574
+ throw error;
1575
+ }
1576
+ }
1535
1577
  /**
1536
1578
  * Delete a single conversation and all its messages.
1537
1579
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lumnisai",
3
3
  "type": "module",
4
- "version": "0.1.21",
4
+ "version": "0.1.22",
5
5
  "description": "Official Node.js SDK for the Lumnis AI API",
6
6
  "author": "Lumnis AI",
7
7
  "license": "MIT",