@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
250 lines • 57.6 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* API v4
* Swagger documentation for API v4
*
* The version of the OpenAPI document: 4.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import { V4ThreadsCreateThreadBodyDtoToJSON, V4ThreadsCreateThreadResponseDtoFromJSON, V4ThreadsDeleteThreadResponseDtoFromJSON, V4ThreadsGetThreadColumnsResponseDtoFromJSON, V4ThreadsGetThreadResponseDtoFromJSON, V4ThreadsGetThreadsInViewResponseDtoFromJSON, V4ThreadsGetThreadsResponseDtoFromJSON, V4ThreadsUpdateThreadBodyDtoToJSON, V4ThreadsUpdateThreadResponseDtoFromJSON, } from '../models/index';
/**
*
*/
export class ThreadsAPIV4Api extends runtime.BaseAPI {
/**
* # POST /v4/threads ## Overview Creates a new conversation thread with the provided information. This endpoint allows you to start new threads for communication, lead management, property discussions, or customer support. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Body The request body should contain thread information to create the new thread. ### Required Fields | Field | Type | Description | |-------|------|-------------| | `title` | string | Thread title or subject | | `content` | string | Initial thread content or message | ### Optional Fields | Field | Type | Description | |-------|------|-------------| | `tags` | array | Array of tags to categorize the thread | | `leadId` | number | Associated lead ID | | `propertyId` | string | Associated property ID | ### Validation Rules - **Title**: Required, non-empty string, should be descriptive - **Content**: Required, non-empty string, contains the initial message - **Tags**: Optional array of strings for categorization - **Lead ID**: Must be a valid lead ID if provided - **Property ID**: Must be a valid property ID if provided - **Organization Scoping**: Thread is automatically associated with user\'s organization ## Request Example ```json { \"title\": \"Property Viewing Request\", \"content\": \"Customer interested in viewing the downtown condo unit\", \"tags\": [\"viewing\", \"customer-inquiry\", \"downtown\"], \"leadId\": 456, \"propertyId\": \"property-789\" } ``` ## Response Structure Returns the newly created thread\'s ID and confirmation. ## Use Cases This endpoint is ideal for: - **Communication Management**: Starting new conversation threads - **Lead Management**: Creating threads for lead communications - **Customer Support**: Initiating support tickets and help requests - **Property Management**: Starting conversations about specific properties - **Team Collaboration**: Creating internal discussion threads - **Workflow Management**: Initiating process-based communication ## Business Rules - **Title Requirements**: Thread titles should be clear and descriptive - **Content Requirements**: Initial content should provide context for the thread - **Association Validation**: Lead and property IDs are validated if provided - **Organization Association**: Threads are automatically scoped to the user\'s organization - **Data Validation**: All content is validated for reasonable formats - **Audit Trail**: Thread creation is logged for compliance and tracking ## Thread Categories ### Communication Threads You can create threads for various communication purposes: - **Customer Inquiries**: Customer questions and requests - **Lead Follow-up**: Sales and lead management communications - **Support Tickets**: Customer support and issue resolution - **Internal Discussions**: Team and organizational communications ### Business Entity Threads - **Property Threads**: Conversations about specific properties - **Lead Threads**: Communications related to specific leads - **Project Threads**: Discussions about projects and deals - **Vendor Threads**: Communications with vendors and partners ## Error Handling Common validation errors include: - **Missing Required Fields**: Title or content not provided - **Invalid Lead ID**: Lead does not exist or belongs to different organization - **Invalid Property ID**: Property does not exist or is not accessible - **Invalid Tags**: Tags contain invalid characters or exceed limits - **Content Too Long**: Content exceeds maximum allowed length
* Create a new thread
*/
async v4ThreadsControllerCreateThreadV4Raw(requestParameters, initOverrides) {
if (requestParameters['v4ThreadsCreateThreadBodyDto'] == null) {
throw new runtime.RequiredError('v4ThreadsCreateThreadBodyDto', 'Required parameter "v4ThreadsCreateThreadBodyDto" was null or undefined when calling v4ThreadsControllerCreateThreadV4().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/threads`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: V4ThreadsCreateThreadBodyDtoToJSON(requestParameters['v4ThreadsCreateThreadBodyDto']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4ThreadsCreateThreadResponseDtoFromJSON(jsonValue));
}
/**
* # POST /v4/threads ## Overview Creates a new conversation thread with the provided information. This endpoint allows you to start new threads for communication, lead management, property discussions, or customer support. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Body The request body should contain thread information to create the new thread. ### Required Fields | Field | Type | Description | |-------|------|-------------| | `title` | string | Thread title or subject | | `content` | string | Initial thread content or message | ### Optional Fields | Field | Type | Description | |-------|------|-------------| | `tags` | array | Array of tags to categorize the thread | | `leadId` | number | Associated lead ID | | `propertyId` | string | Associated property ID | ### Validation Rules - **Title**: Required, non-empty string, should be descriptive - **Content**: Required, non-empty string, contains the initial message - **Tags**: Optional array of strings for categorization - **Lead ID**: Must be a valid lead ID if provided - **Property ID**: Must be a valid property ID if provided - **Organization Scoping**: Thread is automatically associated with user\'s organization ## Request Example ```json { \"title\": \"Property Viewing Request\", \"content\": \"Customer interested in viewing the downtown condo unit\", \"tags\": [\"viewing\", \"customer-inquiry\", \"downtown\"], \"leadId\": 456, \"propertyId\": \"property-789\" } ``` ## Response Structure Returns the newly created thread\'s ID and confirmation. ## Use Cases This endpoint is ideal for: - **Communication Management**: Starting new conversation threads - **Lead Management**: Creating threads for lead communications - **Customer Support**: Initiating support tickets and help requests - **Property Management**: Starting conversations about specific properties - **Team Collaboration**: Creating internal discussion threads - **Workflow Management**: Initiating process-based communication ## Business Rules - **Title Requirements**: Thread titles should be clear and descriptive - **Content Requirements**: Initial content should provide context for the thread - **Association Validation**: Lead and property IDs are validated if provided - **Organization Association**: Threads are automatically scoped to the user\'s organization - **Data Validation**: All content is validated for reasonable formats - **Audit Trail**: Thread creation is logged for compliance and tracking ## Thread Categories ### Communication Threads You can create threads for various communication purposes: - **Customer Inquiries**: Customer questions and requests - **Lead Follow-up**: Sales and lead management communications - **Support Tickets**: Customer support and issue resolution - **Internal Discussions**: Team and organizational communications ### Business Entity Threads - **Property Threads**: Conversations about specific properties - **Lead Threads**: Communications related to specific leads - **Project Threads**: Discussions about projects and deals - **Vendor Threads**: Communications with vendors and partners ## Error Handling Common validation errors include: - **Missing Required Fields**: Title or content not provided - **Invalid Lead ID**: Lead does not exist or belongs to different organization - **Invalid Property ID**: Property does not exist or is not accessible - **Invalid Tags**: Tags contain invalid characters or exceed limits - **Content Too Long**: Content exceeds maximum allowed length
* Create a new thread
*/
async v4ThreadsControllerCreateThreadV4(requestParameters, initOverrides) {
const response = await this.v4ThreadsControllerCreateThreadV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # DELETE /v4/threads/{threadId} ## Overview Deletes an existing conversation thread from the system. This is a permanent operation that removes the thread and handles all associated data relationships appropriately. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `threadId` | number | Yes | The unique identifier of the thread to delete | ## Access Control - **Organization Scope**: Thread must belong to the authenticated user\'s organization - **Thread Validation**: Invalid or non-existent thread IDs will return a 404 error - **Data Privacy**: Only threads within the user\'s organization can be deleted ## Deletion Behavior The deletion operation: - **Permanent Removal**: Thread is permanently deleted from the system - **Cascade Handling**: Associated relationships and references are handled appropriately - **Immediate Effect**: Deletion is applied immediately - **Audit Trail**: Deletion is logged for audit and compliance purposes - **Data Integrity**: System ensures referential integrity during deletion ## Response Structure Returns confirmation that the thread was successfully deleted. ## Use Cases This endpoint is ideal for: - **Data Cleanup**: Remove outdated or completed thread conversations - **Communication Management**: Clean up unnecessary or spam threads - **Privacy Compliance**: Delete threads upon request (GDPR, etc.) - **System Maintenance**: Remove test or duplicate thread data - **Workflow Completion**: Remove threads when processes are complete - **Content Moderation**: Remove inappropriate or policy-violating threads ## Important Considerations Before deleting a thread, consider: - **Active Communications**: Check if thread has ongoing conversations - **Historical Value**: Consider impact on communication history and analytics - **Associated Data**: Review any entities or workflows linked to the thread - **Backup Requirements**: Ensure proper backup if recovery might be needed - **Compliance**: Follow data retention and deletion policies - **User Notification**: Consider notifying relevant users of the deletion ## Referential Impact Thread deletion may affect: - **Communication History**: Loss of conversation context and history - **Lead Communications**: Impact on lead management and sales processes - **Support Tickets**: Effect on customer support history and analytics - **Property Communications**: Loss of property-related conversation context - **Analytics**: Impact on communication analytics and reporting ## Data Relationships The system handles these relationships during deletion: - **Message History**: All messages in the thread are deleted - **User References**: User participation records are updated appropriately - **Entity Associations**: Links to leads, properties, and other entities are removed - **Tag Associations**: Thread tag relationships are cleaned up - **Workflow References**: Process and workflow references are updated ## Error Handling Common errors include: - **Thread Not Found**: Thread ID does not exist or belongs to different organization - **Permission Denied**: User lacks permission to delete threads - **Referential Constraints**: Thread cannot be deleted due to active dependencies - **System Errors**: Database or system issues preventing deletion - **Business Rules**: Business logic preventing deletion (e.g., active communications) ## Recovery - **No API Recovery**: Deleted threads cannot be restored through the API - **Backup Systems**: Recovery may be possible through system backups - **Audit Logs**: Deletion events are recorded for audit purposes - **Data Archival**: Consider data archival policies for compliance - **Recreation**: Similar threads can be created with POST /v4/threads
* Delete a specific thread by threadId
*/
async v4ThreadsControllerDeleteThreadV4Raw(requestParameters, initOverrides) {
if (requestParameters['threadId'] == null) {
throw new runtime.RequiredError('threadId', 'Required parameter "threadId" was null or undefined when calling v4ThreadsControllerDeleteThreadV4().');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/threads/{threadId}`;
urlPath = urlPath.replace(`{${"threadId"}}`, encodeURIComponent(String(requestParameters['threadId'])));
const response = await this.request({
path: urlPath,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4ThreadsDeleteThreadResponseDtoFromJSON(jsonValue));
}
/**
* # DELETE /v4/threads/{threadId} ## Overview Deletes an existing conversation thread from the system. This is a permanent operation that removes the thread and handles all associated data relationships appropriately. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `threadId` | number | Yes | The unique identifier of the thread to delete | ## Access Control - **Organization Scope**: Thread must belong to the authenticated user\'s organization - **Thread Validation**: Invalid or non-existent thread IDs will return a 404 error - **Data Privacy**: Only threads within the user\'s organization can be deleted ## Deletion Behavior The deletion operation: - **Permanent Removal**: Thread is permanently deleted from the system - **Cascade Handling**: Associated relationships and references are handled appropriately - **Immediate Effect**: Deletion is applied immediately - **Audit Trail**: Deletion is logged for audit and compliance purposes - **Data Integrity**: System ensures referential integrity during deletion ## Response Structure Returns confirmation that the thread was successfully deleted. ## Use Cases This endpoint is ideal for: - **Data Cleanup**: Remove outdated or completed thread conversations - **Communication Management**: Clean up unnecessary or spam threads - **Privacy Compliance**: Delete threads upon request (GDPR, etc.) - **System Maintenance**: Remove test or duplicate thread data - **Workflow Completion**: Remove threads when processes are complete - **Content Moderation**: Remove inappropriate or policy-violating threads ## Important Considerations Before deleting a thread, consider: - **Active Communications**: Check if thread has ongoing conversations - **Historical Value**: Consider impact on communication history and analytics - **Associated Data**: Review any entities or workflows linked to the thread - **Backup Requirements**: Ensure proper backup if recovery might be needed - **Compliance**: Follow data retention and deletion policies - **User Notification**: Consider notifying relevant users of the deletion ## Referential Impact Thread deletion may affect: - **Communication History**: Loss of conversation context and history - **Lead Communications**: Impact on lead management and sales processes - **Support Tickets**: Effect on customer support history and analytics - **Property Communications**: Loss of property-related conversation context - **Analytics**: Impact on communication analytics and reporting ## Data Relationships The system handles these relationships during deletion: - **Message History**: All messages in the thread are deleted - **User References**: User participation records are updated appropriately - **Entity Associations**: Links to leads, properties, and other entities are removed - **Tag Associations**: Thread tag relationships are cleaned up - **Workflow References**: Process and workflow references are updated ## Error Handling Common errors include: - **Thread Not Found**: Thread ID does not exist or belongs to different organization - **Permission Denied**: User lacks permission to delete threads - **Referential Constraints**: Thread cannot be deleted due to active dependencies - **System Errors**: Database or system issues preventing deletion - **Business Rules**: Business logic preventing deletion (e.g., active communications) ## Recovery - **No API Recovery**: Deleted threads cannot be restored through the API - **Backup Systems**: Recovery may be possible through system backups - **Audit Logs**: Deletion events are recorded for audit purposes - **Data Archival**: Consider data archival policies for compliance - **Recreation**: Similar threads can be created with POST /v4/threads
* Delete a specific thread by threadId
*/
async v4ThreadsControllerDeleteThreadV4(requestParameters, initOverrides) {
const response = await this.v4ThreadsControllerDeleteThreadV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/threads/{threadId}/{columns} ## Overview Retrieves specific columns for a conversation thread identified by its unique ID. This endpoint allows selective data retrieval, returning only the requested fields for the specified thread. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `threadId` | number | Yes | The unique identifier of the thread | | `columns` | string | Yes | Comma-separated list of column names to retrieve | ## Column Selection Specify desired columns as a comma-separated string: - **Basic Info**: `tid,title,organizationId` - **Content Information**: `content,tags` - **Association Data**: `leadId,pid` - **Timestamp Data**: `createdAt,updatedAt` - **Custom Selection**: Any combination of available columns ## Available Columns ### Basic Information - `tid`: Thread ID - `title`: Thread title or subject - `organizationId`: Organization ID ### Content Information - `content`: Thread content or initial message - `tags`: Array of tags associated with the thread - `category`: Thread category or type - `priority`: Thread priority level - `status`: Thread status (active, closed, etc.) ### Association Information - `leadId`: Associated lead ID - `pid`: Associated property ID - `contactId`: Associated contact ID - `userId`: Thread creator user ID - `assignedTo`: User assigned to handle the thread ### Timestamp Information - `createdAt`: Thread creation timestamp - `updatedAt`: Last modification timestamp - `lastActivityAt`: Last activity timestamp - `resolvedAt`: Thread resolution timestamp ## Access Control - **Organization Scope**: Thread must belong to the user\'s organization - **Column Validation**: Invalid column names are ignored - **Data Privacy**: Only authorized columns are returned ## Use Cases This endpoint is ideal for: - **Performance Optimization**: Retrieve only needed data to reduce bandwidth - **Specific Comparisons**: Get particular fields for thread comparison tables - **Integration**: Extract specific data points for external systems - **Custom Views**: Build interfaces with selective data display - **Mobile Optimization**: Minimize data transfer for mobile applications - **API Efficiency**: Reduce response size for better performance ## Performance Benefits - **Reduced Data Transfer**: Only requested columns are returned - **Faster Processing**: Less data processing on both server and client - **Network Efficiency**: Smaller response payloads - **Selective Queries**: Database queries target only required fields - **Cache Optimization**: Smaller responses improve caching efficiency
* Get specific columns of a thread by threadId
*/
async v4ThreadsControllerGetThreadColumnsV4Raw(requestParameters, initOverrides) {
if (requestParameters['columns'] == null) {
throw new runtime.RequiredError('columns', 'Required parameter "columns" was null or undefined when calling v4ThreadsControllerGetThreadColumnsV4().');
}
if (requestParameters['threadId'] == null) {
throw new runtime.RequiredError('threadId', 'Required parameter "threadId" was null or undefined when calling v4ThreadsControllerGetThreadColumnsV4().');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/threads/{threadId}/{columns}`;
urlPath = urlPath.replace(`{${"columns"}}`, encodeURIComponent(String(requestParameters['columns'])));
urlPath = urlPath.replace(`{${"threadId"}}`, encodeURIComponent(String(requestParameters['threadId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4ThreadsGetThreadColumnsResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/threads/{threadId}/{columns} ## Overview Retrieves specific columns for a conversation thread identified by its unique ID. This endpoint allows selective data retrieval, returning only the requested fields for the specified thread. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `threadId` | number | Yes | The unique identifier of the thread | | `columns` | string | Yes | Comma-separated list of column names to retrieve | ## Column Selection Specify desired columns as a comma-separated string: - **Basic Info**: `tid,title,organizationId` - **Content Information**: `content,tags` - **Association Data**: `leadId,pid` - **Timestamp Data**: `createdAt,updatedAt` - **Custom Selection**: Any combination of available columns ## Available Columns ### Basic Information - `tid`: Thread ID - `title`: Thread title or subject - `organizationId`: Organization ID ### Content Information - `content`: Thread content or initial message - `tags`: Array of tags associated with the thread - `category`: Thread category or type - `priority`: Thread priority level - `status`: Thread status (active, closed, etc.) ### Association Information - `leadId`: Associated lead ID - `pid`: Associated property ID - `contactId`: Associated contact ID - `userId`: Thread creator user ID - `assignedTo`: User assigned to handle the thread ### Timestamp Information - `createdAt`: Thread creation timestamp - `updatedAt`: Last modification timestamp - `lastActivityAt`: Last activity timestamp - `resolvedAt`: Thread resolution timestamp ## Access Control - **Organization Scope**: Thread must belong to the user\'s organization - **Column Validation**: Invalid column names are ignored - **Data Privacy**: Only authorized columns are returned ## Use Cases This endpoint is ideal for: - **Performance Optimization**: Retrieve only needed data to reduce bandwidth - **Specific Comparisons**: Get particular fields for thread comparison tables - **Integration**: Extract specific data points for external systems - **Custom Views**: Build interfaces with selective data display - **Mobile Optimization**: Minimize data transfer for mobile applications - **API Efficiency**: Reduce response size for better performance ## Performance Benefits - **Reduced Data Transfer**: Only requested columns are returned - **Faster Processing**: Less data processing on both server and client - **Network Efficiency**: Smaller response payloads - **Selective Queries**: Database queries target only required fields - **Cache Optimization**: Smaller responses improve caching efficiency
* Get specific columns of a thread by threadId
*/
async v4ThreadsControllerGetThreadColumnsV4(requestParameters, initOverrides) {
const response = await this.v4ThreadsControllerGetThreadColumnsV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/threads/{threadId} ## Overview Retrieves detailed information for a specific conversation thread by its unique identifier. This endpoint returns complete thread data including content, associations, and metadata. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `threadId` | number | Yes | The unique identifier of the thread to retrieve | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply column selection and formatting | ## Access Control - **Organization Scope**: Thread must belong to the authenticated user\'s organization - **Thread Validation**: Invalid or non-existent thread IDs will return a 404 error - **Data Privacy**: Only threads within the user\'s organization are accessible ## Response Structure Returns a complete thread object with all available fields and conversation information. ## Use Cases This endpoint is ideal for: - **Thread Detail Views**: Display complete thread information in detail pages - **Communication History**: Access full conversation details and context - **Lead Management**: Get detailed thread information for lead communications - **Customer Support**: Access complete support ticket threads and conversations - **Property Communications**: View detailed conversations about specific properties - **Workflow Management**: Access thread details for process management ## Thread Information Access The response includes comprehensive thread information: - **Content Details**: Complete thread content and message information - **Association Details**: Links to leads, properties, and other entities - **Metadata**: Creation timestamps, user attribution, and organizational context - **Tag Information**: All tags and categorization data - **Relationship Data**: Associated entities and their relationships - **Activity History**: Thread activity and participation details ## Performance Considerations - **Single Record Fetch**: Optimized for retrieving individual threads - **Complete Data**: Returns all available thread fields and information - **Real-time Data**: Always returns current thread information - **Organization Filtering**: Automatic organization scoping ensures security
* Get a specific thread by threadId
*/
async v4ThreadsControllerGetThreadV4Raw(requestParameters, initOverrides) {
if (requestParameters['threadId'] == null) {
throw new runtime.RequiredError('threadId', 'Required parameter "threadId" was null or undefined when calling v4ThreadsControllerGetThreadV4().');
}
const queryParameters = {};
if (requestParameters['viewId'] != null) {
queryParameters['viewId'] = requestParameters['viewId'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/threads/{threadId}`;
urlPath = urlPath.replace(`{${"threadId"}}`, encodeURIComponent(String(requestParameters['threadId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4ThreadsGetThreadResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/threads/{threadId} ## Overview Retrieves detailed information for a specific conversation thread by its unique identifier. This endpoint returns complete thread data including content, associations, and metadata. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `threadId` | number | Yes | The unique identifier of the thread to retrieve | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply column selection and formatting | ## Access Control - **Organization Scope**: Thread must belong to the authenticated user\'s organization - **Thread Validation**: Invalid or non-existent thread IDs will return a 404 error - **Data Privacy**: Only threads within the user\'s organization are accessible ## Response Structure Returns a complete thread object with all available fields and conversation information. ## Use Cases This endpoint is ideal for: - **Thread Detail Views**: Display complete thread information in detail pages - **Communication History**: Access full conversation details and context - **Lead Management**: Get detailed thread information for lead communications - **Customer Support**: Access complete support ticket threads and conversations - **Property Communications**: View detailed conversations about specific properties - **Workflow Management**: Access thread details for process management ## Thread Information Access The response includes comprehensive thread information: - **Content Details**: Complete thread content and message information - **Association Details**: Links to leads, properties, and other entities - **Metadata**: Creation timestamps, user attribution, and organizational context - **Tag Information**: All tags and categorization data - **Relationship Data**: Associated entities and their relationships - **Activity History**: Thread activity and participation details ## Performance Considerations - **Single Record Fetch**: Optimized for retrieving individual threads - **Complete Data**: Returns all available thread fields and information - **Real-time Data**: Always returns current thread information - **Organization Filtering**: Automatic organization scoping ensures security
* Get a specific thread by threadId
*/
async v4ThreadsControllerGetThreadV4(requestParameters, initOverrides) {
const response = await this.v4ThreadsControllerGetThreadV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/threads/viewId/{viewId} ## Overview Retrieves threads filtered by a specific view configuration. This endpoint applies view-defined filters, sorts, and column selections to provide a customized dataset of conversation threads. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | Yes | The unique identifier of the view to apply | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of threads to return (default: 20, max: 100) | | `offset` | number | No | Number of threads to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count of threads without the actual data | ## View Application The specified view configuration is applied automatically: - **Filters**: All view filters are applied to narrow the thread dataset - **Sorts**: View sort criteria determine the order of returned threads - **Columns**: View column selection determines which fields are returned - **Relationships**: Related data inclusion based on view configuration ## Access Control - **Organization Scope**: Threads are filtered by the user\'s organization - **View Ownership**: View must belong to the requesting user - **Data Privacy**: Only organization threads are accessible through views ## Response Structure Returns threads that match the specified view configuration. ## Use Cases This endpoint is ideal for: - **Custom Dashboards**: Display threads according to predefined views - **Filtered Reports**: Generate reports with specific thread criteria - **Saved Searches**: Retrieve threads using saved filter combinations - **User Preferences**: Apply user-defined thread viewing preferences - **Specialized Views**: Access threads for specific lead types or property categories ## View Consistency - **Reproducible Results**: Same view ID produces consistent results - **Filter Persistence**: View filters remain constant across requests - **Sort Stability**: View sorting provides predictable ordering - **Column Consistency**: Same columns returned for each request ## Performance Benefits - **Optimized Queries**: View-specific optimizations improve performance - **Cached Configurations**: View settings are cached for faster execution - **Reduced Overhead**: Only requested columns are processed and returned - **Efficient Filtering**: Database-level filtering reduces data transfer
* Get threads with a specific viewId
*/
async v4ThreadsControllerGetThreadsInViewV4Raw(requestParameters, initOverrides) {
if (requestParameters['viewId'] == null) {
throw new runtime.RequiredError('viewId', 'Required parameter "viewId" was null or undefined when calling v4ThreadsControllerGetThreadsInViewV4().');
}
const queryParameters = {};
if (requestParameters['limit'] != null) {
queryParameters['limit'] = requestParameters['limit'];
}
if (requestParameters['offset'] != null) {
queryParameters['offset'] = requestParameters['offset'];
}
if (requestParameters['countOnly'] != null) {
queryParameters['countOnly'] = requestParameters['countOnly'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/threads/viewId/{viewId}`;
urlPath = urlPath.replace(`{${"viewId"}}`, encodeURIComponent(String(requestParameters['viewId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4ThreadsGetThreadsInViewResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/threads/viewId/{viewId} ## Overview Retrieves threads filtered by a specific view configuration. This endpoint applies view-defined filters, sorts, and column selections to provide a customized dataset of conversation threads. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | Yes | The unique identifier of the view to apply | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of threads to return (default: 20, max: 100) | | `offset` | number | No | Number of threads to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count of threads without the actual data | ## View Application The specified view configuration is applied automatically: - **Filters**: All view filters are applied to narrow the thread dataset - **Sorts**: View sort criteria determine the order of returned threads - **Columns**: View column selection determines which fields are returned - **Relationships**: Related data inclusion based on view configuration ## Access Control - **Organization Scope**: Threads are filtered by the user\'s organization - **View Ownership**: View must belong to the requesting user - **Data Privacy**: Only organization threads are accessible through views ## Response Structure Returns threads that match the specified view configuration. ## Use Cases This endpoint is ideal for: - **Custom Dashboards**: Display threads according to predefined views - **Filtered Reports**: Generate reports with specific thread criteria - **Saved Searches**: Retrieve threads using saved filter combinations - **User Preferences**: Apply user-defined thread viewing preferences - **Specialized Views**: Access threads for specific lead types or property categories ## View Consistency - **Reproducible Results**: Same view ID produces consistent results - **Filter Persistence**: View filters remain constant across requests - **Sort Stability**: View sorting provides predictable ordering - **Column Consistency**: Same columns returned for each request ## Performance Benefits - **Optimized Queries**: View-specific optimizations improve performance - **Cached Configurations**: View settings are cached for faster execution - **Reduced Overhead**: Only requested columns are processed and returned - **Efficient Filtering**: Database-level filtering reduces data transfer
* Get threads with a specific viewId
*/
async v4ThreadsControllerGetThreadsInViewV4(requestParameters, initOverrides) {
const response = await this.v4ThreadsControllerGetThreadsInViewV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/threads ## Overview Retrieves a list of conversation threads with optional filtering, sorting, and pagination capabilities. This endpoint provides access to thread information including titles, content, tags, and associated leads or properties. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply filters and column selection | | `limit` | number | No | Maximum number of threads to return (default: 20, max: 100) | | `offset` | number | No | Number of threads to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count of threads without the actual data | ## Access Control - **Organization Scope**: Threads are filtered by the user\'s organization - **Data Privacy**: Only threads within the organization are accessible - **Permission**: User must have thread read permissions ## View Integration When a `viewId` is provided: - **Filters**: All view filters are applied to narrow the thread dataset - **Sorts**: View sort criteria determine the order of returned threads - **Columns**: View column selection determines which fields are returned - **Consistent Results**: Same view produces consistent response structure ## Response Structure Returns a paginated list of threads matching the specified criteria. ## Use Cases This endpoint is ideal for: - **Communication Management**: Building thread listing interfaces and communication dashboards - **Customer Support**: Managing support ticket threads and conversations - **Lead Management**: Tracking communication threads related to leads - **Property Management**: Organizing conversations about specific properties - **Team Collaboration**: Managing internal team communication threads - **Knowledge Management**: Building searchable conversation archives ## Thread Data Categories Thread information includes: - **Basic Information**: Thread ID, title, and creation details - **Content**: Thread content and message details - **Metadata**: Tags, categories, and organizational information - **Associations**: Links to leads, properties, or other entities - **Participation**: User involvement and activity tracking - **Timeline**: Creation and modification timestamps ## Performance Considerations - **Optimized Queries**: Database queries are optimized for organization filtering - **View Caching**: View configurations are cached for improved performance - **Index Usage**: Queries utilize database indexes for fast retrieval - **Response Size**: Use limit parameter to control response size
* Get threads with optional viewId
*/
async v4ThreadsControllerGetThreadsV4Raw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters['viewId'] != null) {
queryParameters['viewId'] = requestParameters['viewId'];
}
if (requestParameters['limit'] != null) {
queryParameters['limit'] = requestParameters['limit'];
}
if (requestParameters['offset'] != null) {
queryParameters['offset'] = requestParameters['offset'];
}
if (requestParameters['countOnly'] != null) {
queryParameters['countOnly'] = requestParameters['countOnly'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/threads`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4ThreadsGetThreadsResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/threads ## Overview Retrieves a list of conversation threads with optional filtering, sorting, and pagination capabilities. This endpoint provides access to thread information including titles, content, tags, and associated leads or properties. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply filters and column selection | | `limit` | number | No | Maximum number of threads to return (default: 20, max: 100) | | `offset` | number | No | Number of threads to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count of threads without the actual data | ## Access Control - **Organization Scope**: Threads are filtered by the user\'s organization - **Data Privacy**: Only threads within the organization are accessible - **Permission**: User must have thread read permissions ## View Integration When a `viewId` is provided: - **Filters**: All view filters are applied to narrow the thread dataset - **Sorts**: View sort criteria determine the order of returned threads - **Columns**: View column selection determines which fields are returned - **Consistent Results**: Same view produces consistent response structure ## Response Structure Returns a paginated list of threads matching the specified criteria. ## Use Cases This endpoint is ideal for: - **Communication Management**: Building thread listing interfaces and communication dashboards - **Customer Support**: Managing support ticket threads and conversations - **Lead Management**: Tracking communication threads related to leads - **Property Management**: Organizing conversations about specific properties - **Team Collaboration**: Managing internal team communication threads - **Knowledge Management**: Building searchable conversation archives ## Thread Data Categories Thread information includes: - **Basic Information**: Thread ID, title, and creation details - **Content**: Thread content and message details - **Metadata**: Tags, categories, and organizational information - **Associations**: Links to leads, properties, or other entities - **Participation**: User involvement and activity tracking - **Timeline**: Creation and modification timestamps ## Performance Considerations - **Optimized Queries**: Database queries are optimized for organization filtering - **View Caching**: View configurations are cached for improved performance - **Index Usage**: Queries utilize database indexes for fast retrieval - **Response Size**: Use limit parameter to control response size
* Get threads with optional viewId
*/
async v4ThreadsControllerGetThreadsV4(requestParameters = {}, initOverrides) {
const response = await this.v4ThreadsControllerGetThreadsV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # PATCH /v4/threads/{threadId} ## Overview Updates an existing conversation thread with the provided information. This endpoint allows partial updates, meaning you only need to include the fields you want to change. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `threadId` | number | Yes | The unique identifier of the thread to update | ## Request Body The request body should contain only the fields you want to update. All fields are optional for updates. ### Updateable Fields | Field | Type | Description | |-------|------|-------------| | `title` | string | Thread title or subject | | `content` | string | Thread content or initial message | | `tags` | array | Array of tags to categorize the thread | ### Validation Rules - **Title**: Must be non-empty string (if provided) - **Content**: Must be non-empty string (if provided) - **Tags**: Must be array of valid strings (if provided) - **Partial Updates**: Only provided fields will be updated - **Organization Scope**: Thread must belong to user\'s organization ## Request Example ```json { \"title\": \"Updated Property Viewing Request\", \"tags\": [\"viewing\", \"customer-inquiry\", \"downtown\", \"urgent\"] } ``` ## Access Control - **Organization Scope**: Thread must belong to the authenticated user\'s organization - **Thread Validation**: Invalid or non-existent thread IDs will return a 404 error - **Data Privacy**: Only threads within the user\'s organization can be updated ## Response Structure Returns confirmation that the thread was successfully updated. ## Use Cases This endpoint is ideal for: - **Content Updates**: Modify thread titles and content as information changes - *