Last Updated: 2025-11-26
This document provides comprehensive documentation for all REST API endpoints in the User Connection Management System. Each endpoint includes request/response formats, authentication requirements, error handling, and usage examples.
- Base Configuration
- User Management Endpoints
- Integration Endpoints
- Connection Management Endpoints
- Connection Testing Endpoints
- Feature Template Endpoints
- Feature Mapping Endpoints
- Error Handling
- Status Codes
http://localhost:3000
All requests and responses use application/json content type unless otherwise specified.
Currently, the system does not implement authentication tokens. User identification is done via userId parameter in requests.
Future: OAuth 2.0 or JWT-based authentication will be implemented.
Retrieve detailed information about a specific user.
Endpoint: GET /api/users/:userId
URL Parameters:
userId(string, required) - Unique identifier for the user
Request Example:
GET /api/users/user_123 HTTP/1.1
Host: localhost:3000Success Response (200 OK):
{
"success": true,
"user": {
"userId": "user_123",
"name": "John Doe",
"email": "john.doe@example.com",
"status": "active",
"createdAt": "2025-11-01T10:00:00.000Z",
"updatedAt": "2025-11-23T15:30:00.000Z"
}
}Error Response (404 Not Found):
{
"success": false,
"message": "User not found"
}Error Response (500 Internal Server Error):
{
"success": false,
"message": "Failed to fetch user",
"error": "Elasticsearch connection timeout"
}Retrieve a list of all active users in the system.
Endpoint: GET /api/users
Query Parameters:
status(string, optional) - Filter by user status (activeorinactive). Default: all statuses
Request Example:
GET /api/users?status=active HTTP/1.1
Host: localhost:3000Success Response (200 OK):
{
"success": true,
"users": [
{
"userId": "user_123",
"name": "John Doe",
"email": "john.doe@example.com",
"status": "active",
"createdAt": "2025-11-01T10:00:00.000Z"
},
{
"userId": "user_456",
"name": "Jane Smith",
"email": "jane.smith@example.com",
"status": "active",
"createdAt": "2025-11-02T14:20:00.000Z"
}
],
"total": 2
}Error Response (500 Internal Server Error):
{
"success": false,
"message": "Failed to fetch users",
"error": "Database error"
}Retrieve a list of all available integrations with their metadata.
Endpoint: GET /api/integrations
Query Parameters:
category(string, optional) - Filter by category (e.g.,crm,payment,database)status(string, optional) - Filter by status (activeorinactive). Default:active
Request Example:
GET /api/integrations?category=crm&status=active HTTP/1.1
Host: localhost:3000Success Response (200 OK):
{
"success": true,
"integrations": [
{
"id": "salesforce",
"displayName": "Salesforce",
"description": "Customer Relationship Management platform",
"category": "crm",
"iconUrl": "https://logo.clearbit.com/salesforce.com",
"status": "active",
"baseUrl": "https://{{instance_url}}.salesforce.com/services/data/v58.0",
"authMethods": ["oauth2", "api-key"]
},
{
"id": "hubspot",
"displayName": "HubSpot",
"description": "Marketing, sales, and service software",
"category": "crm",
"iconUrl": "https://logo.clearbit.com/hubspot.com",
"status": "active",
"baseUrl": "https://api.hubapi.com",
"authMethods": ["oauth2", "api-key"]
}
],
"total": 2
}Error Response (500 Internal Server Error):
{
"success": false,
"message": "Failed to load integrations",
"error": "File system error"
}Retrieve the authentication schema for a specific integration, including available auth methods and required fields.
Endpoint: GET /api/integrations/:integrationId/auth-schema
URL Parameters:
integrationId(string, required) - Unique identifier for the integration
Request Example:
GET /api/integrations/salesforce/auth-schema HTTP/1.1
Host: localhost:3000Success Response (200 OK):
{
"success": true,
"integration": {
"id": "salesforce",
"displayName": "Salesforce",
"baseUrl": "https://{{instance_url}}.salesforce.com/services/data/v58.0"
},
"authMethods": [
{
"id": "oauth2",
"type": "OAUTH",
"label": "OAuth 2.0",
"description": "Secure OAuth 2.0 authentication with automatic token refresh",
"fields": [
{
"name": "clientId",
"label": "Client ID",
"type": "string",
"required": true,
"description": "OAuth Client ID from Salesforce Connected App"
},
{
"name": "clientSecret",
"label": "Client Secret",
"type": "password",
"required": true,
"description": "OAuth Client Secret (will be encrypted)"
}
],
"additionalFields": [
{
"name": "instance_url",
"label": "Instance URL",
"type": "url",
"required": true,
"placeholder": "https://your-instance.salesforce.com",
"description": "Your Salesforce instance URL"
}
]
},
{
"id": "api-key",
"type": "API-KEY",
"label": "API Key",
"description": "Simple API key authentication",
"fields": [
{
"name": "apiKey",
"label": "API Key",
"type": "password",
"required": true,
"description": "Your Salesforce API key"
}
],
"additionalFields": [
{
"name": "instance_url",
"label": "Instance URL",
"type": "url",
"required": true,
"placeholder": "https://your-instance.salesforce.com",
"description": "Your Salesforce instance URL"
}
]
}
]
}Error Response (404 Not Found):
{
"success": false,
"message": "Integration not found"
}Error Response (500 Internal Server Error):
{
"success": false,
"message": "Failed to load authentication schema",
"error": "Schema file not found"
}Create a new user connection to an integration.
Endpoint: POST /api/user-integrations/connect
Request Body:
{
"userId": "user_123",
"integrationId": "salesforce",
"authMethodId": "oauth2",
"connectionName": "Salesforce Production",
"configuredVariables": {
"instance_url": "https://mycompany.salesforce.com"
},
"credentials": {
"clientId": "3MVG9...",
"clientSecret": "1234567890ABCDEF"
}
}Request Fields:
userId(string, required) - ID of the user creating the connectionintegrationId(string, required) - ID of the integration to connectauthMethodId(string, required) - Authentication method to useconnectionName(string, optional) - Custom name for the connection. If not provided, uses integration display nameconfiguredVariables(object, optional) - Dynamic variables extracted from baseUrl (e.g.,{{instance_url}})credentials(object, required) - Authentication credentials (will be encrypted)
Success Response (201 Created):
{
"success": true,
"message": "Connection created successfully",
"connectionId": "conn_abc123xyz",
"connection": {
"connectionId": "conn_abc123xyz",
"userId": "user_123",
"integrationId": "salesforce",
"integrationName": "Salesforce",
"connectionName": "Salesforce Production",
"authMethodId": "oauth2",
"authMethodLabel": "OAuth 2.0",
"status": "active",
"createdAt": "2025-11-23T15:45:00.000Z"
}
}Error Response (400 Bad Request):
{
"success": false,
"message": "Validation error",
"errors": [
"userId is required",
"integrationId is required",
"credentials.clientId is required"
]
}Error Response (404 Not Found):
{
"success": false,
"message": "Integration not found"
}Error Response (500 Internal Server Error):
{
"success": false,
"message": "Failed to create connection",
"error": "Database write error"
}Retrieve all connections for a specific user.
Endpoint: GET /api/user-integrations/my-connections
Query Parameters:
userId(string, required) - ID of the userstatus(string, optional) - Filter by status (activeorinactive). Default: all statusesintegrationId(string, optional) - Filter by specific integration
Request Example:
GET /api/user-integrations/my-connections?userId=user_123&status=active HTTP/1.1
Host: localhost:3000Success Response (200 OK):
{
"success": true,
"connections": [
{
"connectionId": "conn_abc123xyz",
"userId": "user_123",
"integrationId": "salesforce",
"integrationName": "Salesforce",
"connectionName": "Salesforce Production",
"authMethodId": "oauth2",
"authMethodLabel": "OAuth 2.0",
"status": "active",
"configuredVariables": {
"instance_url": "https://mycompany.salesforce.com"
},
"credentials": {
"encrypted": "U2FsdGVkX1...",
"decrypted": {
"clientId": "3MVG9...",
"clientSecret": "••••••••••••"
}
},
"lastTestStatus": "success",
"lastTestMessage": "Connection successful",
"lastTestDate": "2025-11-23T14:30:00.000Z",
"createdAt": "2025-11-20T10:00:00.000Z",
"updatedAt": "2025-11-23T14:30:00.000Z",
"integration": {
"displayName": "Salesforce",
"category": "crm",
"iconUrl": "https://logo.clearbit.com/salesforce.com"
}
},
{
"connectionId": "conn_def456uvw",
"userId": "user_123",
"integrationId": "salesforce",
"integrationName": "Salesforce",
"connectionName": "Salesforce Sandbox",
"authMethodId": "oauth2",
"authMethodLabel": "OAuth 2.0",
"status": "active",
"configuredVariables": {
"instance_url": "https://test.salesforce.com"
},
"credentials": {
"encrypted": "U2FsdGVkX1...",
"decrypted": {
"clientId": "3MVG9...",
"clientSecret": "••••••••••••"
}
},
"lastTestStatus": null,
"lastTestMessage": null,
"lastTestDate": null,
"createdAt": "2025-11-22T09:15:00.000Z",
"updatedAt": "2025-11-22T09:15:00.000Z",
"integration": {
"displayName": "Salesforce",
"category": "crm",
"iconUrl": "https://logo.clearbit.com/salesforce.com"
}
}
],
"total": 2,
"stats": {
"active": 2,
"inactive": 0,
"total": 2,
"recent": 1
}
}Error Response (400 Bad Request):
{
"success": false,
"message": "userId query parameter is required"
}Error Response (500 Internal Server Error):
{
"success": false,
"message": "Failed to fetch connections",
"error": "Elasticsearch query error"
}Retrieve detailed information about a specific connection, including embedded integration metadata. This endpoint is commonly used when loading a connection for editing in the Connection Wizard.
Endpoint: GET /api/user-integrations/:connectionId
URL Parameters:
connectionId(string, required) - Unique identifier for the connection
Request Example:
GET /api/user-integrations/conn_abc123xyz HTTP/1.1
Host: localhost:3000Success Response (200 OK):
{
"success": true,
"connection": {
"connectionId": "conn_abc123xyz",
"userId": "user_123",
"integrationId": "salesforce",
"integrationName": "Salesforce",
"connectionName": "Salesforce Production",
"authMethodId": "oauth2",
"authMethodLabel": "OAuth 2.0",
"status": "active",
"configuredVariables": {
"instance_url": "https://mycompany.salesforce.com"
},
"credentials": {
"encrypted": "U2FsdGVkX1...",
"decrypted": {
"clientId": "3MVG9...",
"clientSecret": "1234567890ABCDEF"
}
},
"lastTestStatus": "success",
"lastTestMessage": "Connection successful",
"lastTestDate": "2025-11-23T14:30:00.000Z",
"createdAt": "2025-11-20T10:00:00.000Z",
"updatedAt": "2025-11-23T14:30:00.000Z",
"integration": {
"displayName": "Salesforce",
"description": "Customer Relationship Management platform",
"category": "crm",
"iconUrl": "https://logo.clearbit.com/salesforce.com"
}
}
}Response Fields:
success(boolean) - Alwaystruefor successful responses. Frontend should check this field before processing dataconnection(object) - Complete connection detailsintegration(object) - Embedded integration metadata loaded from integration's auth.schema.json file
Error Response (404 Not Found):
{
"success": false,
"message": "Connection not found"
}Error Response (500 Internal Server Error):
{
"success": false,
"error": "Failed to get connection",
"message": "Elasticsearch connection timeout"
}Usage in Edit Mode:
This endpoint is essential for the edit connection feature. When a user clicks the "Edit" button on a connection card:
- Frontend redirects to wizard with URL params:
/connect-integration.html?mode=edit&connectionId=conn_abc123xyz - Wizard calls this endpoint to load existing connection data
- Response includes
success: true- Frontend checks this field to ensure data loaded successfully - Wizard pre-fills all form fields with data from the response
- Integration metadata is included - No need for separate API call to load integration details
Example Usage:
async function loadExistingConnection(connectionId) {
try {
const response = await fetch(`/api/user-integrations/${connectionId}`);
const data = await response.json();
// Check success field before processing
if (data.success && data.connection) {
const connection = data.connection;
// Pre-fill wizard with existing data
wizardData.userId = connection.userId;
wizardData.integrationId = connection.integrationId;
wizardData.integrationName = connection.integrationName;
wizardData.authMethodId = connection.authMethodId;
wizardData.authMethodLabel = connection.authMethodLabel;
wizardData.dynamicVariables = connection.configuredVariables || {};
wizardData.credentials = connection.credentials?.decrypted || {};
// Integration details are already embedded
displayIntegrationInfo(connection.integration);
// Pre-fill connection name
document.getElementById('connectionName').value =
connection.connectionName || '';
} else {
// If success is false or missing, redirect back
showToast('Failed to load connection details', 'error');
setTimeout(() => (window.location.href = '/my-connections.html'), 2000);
}
} catch (error) {
console.error('Error loading connection:', error);
showToast('Failed to load connection', 'error');
}
}Important Notes:
- Always check
successfield - Frontend must verifydata.success === truebefore processing - Integration metadata is embedded - Saves an extra API call to
/api/integrations/:id - Credentials are decrypted - Ready to use for pre-filling form fields (except password fields)
- Error handling - If connection not found or error occurs, redirect user back to My Connections page
Update an existing connection's configuration, credentials, or authentication method.
Endpoint: PUT /api/user-integrations/:connectionId
URL Parameters:
connectionId(string, required) - Unique identifier for the connection
Request Body:
{
"connectionName": "Salesforce Production v2",
"authMethodId": "oauth2",
"authMethodLabel": "OAuth 2.0",
"configuredVariables": {
"instance_url": "https://newinstance.salesforce.com"
},
"credentials": {
"clientId": "3MVG9...",
"clientSecret": "newSecretValue123"
}
}Request Fields (all optional):
connectionName(string) - Update connection nameauthMethodId(string) - Update authentication method IDauthMethodLabel(string) - Update authentication method display labelconfiguredVariables(object) - Update dynamic variablescredentials(object) - Update credentials (will be re-encrypted). Note: If a password field is omitted or empty, the existing password value is preservedstatus(string) - Update status (activeorinactive)
Success Response (200 OK):
{
"success": true,
"message": "Connection updated successfully",
"connection": {
"connectionId": "conn_abc123xyz",
"connectionName": "Salesforce Production v2",
"updatedAt": "2025-11-23T16:00:00.000Z"
}
}Error Response (404 Not Found):
{
"success": false,
"message": "Connection not found"
}Error Response (400 Bad Request):
{
"success": false,
"message": "Validation error",
"errors": ["Invalid status value. Must be 'active' or 'inactive'"]
}Error Response (500 Internal Server Error):
{
"success": false,
"message": "Failed to update connection",
"error": "Database update error"
}Usage in Edit Mode:
When a user edits an existing connection through the Connection Wizard:
- Wizard loads existing connection using GET endpoint
- User modifies fields in the wizard interface
- Wizard sends PUT request with updated fields
- Smart password handling: If password fields are left empty, they are omitted from the request and existing passwords are preserved
Example Edit Workflow:
// Step 1: Load existing connection
const response = await fetch('/api/user-integrations/conn_abc123xyz');
const { connection } = await response.json();
// Step 2: User updates connection name and instance URL
const updates = {
connectionName: 'Salesforce Production v2',
authMethodId: connection.authMethodId,
authMethodLabel: connection.authMethodLabel,
configuredVariables: {
instance_url: 'https://newinstance.salesforce.com',
},
credentials: {
clientId: connection.credentials.decrypted.clientId,
// clientSecret omitted - existing value will be preserved
},
};
// Step 3: Send PUT request
const updateResponse = await fetch('/api/user-integrations/conn_abc123xyz', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(updates),
});Security Notes:
- Password fields that are empty or omitted will preserve existing encrypted values
- All provided credentials are re-encrypted before storage
- Only fields included in the request body will be updated
Delete a user connection (soft delete by setting status to inactive).
Endpoint: DELETE /api/user-integrations/:connectionId
URL Parameters:
connectionId(string, required) - Unique identifier for the connection
Request Example:
DELETE /api/user-integrations/conn_abc123xyz HTTP/1.1
Host: localhost:3000Success Response (200 OK):
{
"success": true,
"message": "Connection deleted successfully",
"connectionId": "conn_abc123xyz"
}Error Response (404 Not Found):
{
"success": false,
"message": "Connection not found"
}Error Response (500 Internal Server Error):
{
"success": false,
"message": "Failed to delete connection",
"error": "Database error"
}Note: This is a soft delete. The connection status is set to inactive rather than permanently deleting the record. This preserves connection history and allows for potential recovery.
Test a connection by making a sample API call to the integrated service.
Endpoint: POST /api/user-integrations/:connectionId/test
URL Parameters:
connectionId(string, required) - Unique identifier for the connection
Request Example:
POST /api/user-integrations/conn_abc123xyz/test HTTP/1.1
Host: localhost:3000Request Body: Empty (no body required)
Success Response (200 OK):
{
"success": true,
"message": "Connection test successful",
"testResult": {
"status": "success",
"statusCode": 200,
"responseTime": 245,
"timestamp": "2025-11-23T16:15:00.000Z",
"endpoint": "https://mycompany.salesforce.com/services/data/v58.0/sobjects"
}
}Error Response (400 Bad Request) - Connection Failed:
{
"success": false,
"message": "Connection test failed",
"testResult": {
"status": "error",
"statusCode": 401,
"errorMessage": "Invalid credentials. Please check your client ID and secret.",
"timestamp": "2025-11-23T16:15:00.000Z",
"endpoint": "https://mycompany.salesforce.com/services/data/v58.0/sobjects"
}
}Error Response (404 Not Found):
{
"success": false,
"message": "Connection not found"
}Error Response (500 Internal Server Error):
{
"success": false,
"message": "Failed to test connection",
"error": "Network timeout"
}Side Effects:
- Updates
lastTestStatusfield with result (successorerror) - Updates
lastTestMessagefield with result message - Updates
lastTestDatefield with current timestamp
All error responses follow this consistent format:
{
"success": false,
"message": "Human-readable error message",
"error": "Technical error details (optional)",
"errors": ["Array of validation errors (optional)"]
}Returned when request data is invalid or missing required fields.
Example:
{
"success": false,
"message": "Validation error",
"errors": [
"userId is required",
"integrationId must be a valid integration ID",
"credentials.clientSecret cannot be empty"
]
}Returned when requested resource doesn't exist.
Example:
{
"success": false,
"message": "Connection not found"
}Returned when database operations fail.
Example:
{
"success": false,
"message": "Failed to fetch connections",
"error": "Elasticsearch connection timeout after 30s"
}Returned when integration configuration is invalid.
Example:
{
"success": false,
"message": "Failed to load integration",
"error": "Auth schema file not found: integrations/providers/salesforce/auth.schema.json"
}Returned when credential encryption/decryption fails.
Example:
{
"success": false,
"message": "Failed to encrypt credentials",
"error": "Encryption key not configured in environment"
}| Status Code | Meaning | Usage |
|---|---|---|
200 OK |
Success | Successful GET, PUT, DELETE, or POST operations |
201 Created |
Resource Created | Successful POST operation creating a new resource |
400 Bad Request |
Client Error | Invalid request data or validation errors |
404 Not Found |
Resource Not Found | Requested resource doesn't exist |
500 Internal Server Error |
Server Error | Database errors, configuration errors, or unexpected failures |
| Status | Meaning | Description |
|---|---|---|
success |
Test Passed | Connection successfully authenticated and API call succeeded |
error |
Test Failed | Connection failed (invalid credentials, network error, etc.) |
null |
Not Tested | Connection has never been tested |
| Status | Meaning | Description |
|---|---|---|
active |
Active | Connection is active and available for use |
inactive |
Inactive | Connection has been soft-deleted or deactivated |
- All credentials are encrypted using AES-256 before storage
- Encryption key is stored in environment variables
- Decryption only occurs when needed for API calls
- All user inputs are validated before processing
- SQL injection prevention through parameterized queries
- XSS protection through input sanitization
- Password fields are masked in responses (
••••••••••••) - Secret keys and tokens are never returned in plain text
- Only encrypted versions are stored in database
- API rate limiting will be implemented to prevent abuse
- Per-user and per-endpoint limits
- OAuth 2.0 or JWT-based authentication
- Role-based access control (RBAC)
- API key management
[!NOTE] > LEGACY: Feature templates are deprecated. Features are now created directly within integrations via
/add-feature. These endpoints are kept for backward compatibility.
Retrieve a list of all feature templates.
Endpoint: GET /api/feature-templates
Request Example:
GET /api/feature-templates HTTP/1.1
Host: localhost:3000Success Response (200 OK):
{
"success": true,
"features": [
{
"id": "create_contact",
"name": "Create Contact",
"description": "Create a new contact in the CRM",
"category": "contacts",
"fields": {
"first_name": {
"type": "static",
"label": "First Name",
"required": true,
"fieldType": "string",
"htmlType": "text",
"fillBy": "User"
}
},
"createdAt": "2025-11-24T10:00:00.000Z",
"updatedAt": "2025-11-24T10:00:00.000Z"
}
]
}Retrieve a specific feature template.
Endpoint: GET /api/feature-templates/:id
URL Parameters:
id(string, required) - Feature template ID
Request Example:
GET /api/feature-templates/create_contact HTTP/1.1
Host: localhost:3000Success Response (200 OK):
{
"success": true,
"feature": {
"id": "create_contact",
"name": "Create Contact",
"description": "Create a new contact in the CRM",
"category": "contacts",
"fields": { ... },
"createdAt": "2025-11-24T10:00:00.000Z",
"updatedAt": "2025-11-24T10:00:00.000Z"
}
}Error Response (404 Not Found):
{
"success": false,
"message": "Feature template not found"
}Retrieve all feature mappings for a specific integration.
Endpoint: GET /api/integrations/:integrationId/feature-mappings
URL Parameters:
integrationId(string, required) - Integration ID
Request Example:
GET /api/integrations/freshdesk/feature-mappings HTTP/1.1
Host: localhost:3000Success Response (200 OK):
{
"success": true,
"featureMappings": [
{
"id": "mapping_1764100935626_abc123",
"featureTemplateId": "create_contact",
"featureTemplateName": "Create Contact",
"fieldMappings": {
"first_name": {
"enabled": true,
"overrides": null,
"customHandlers": {
"valueHandler": "capitalizeFirstName",
"validationHandler": "validateNameLength",
"submitHandler": null
},
"adminValue": null
},
"email": {
"enabled": true,
"customHandlers": {
"validationHandler": "validateEmailFormat"
}
}
},
"apiConfig": {
"apiConfigId": null,
"method": "POST",
"endpoint": "/api/contacts"
},
"extraFields": [
{
"fieldKey": "object_type",
"label": "Object Type",
"type": "static",
"fieldType": "string",
"htmlType": "select",
"fillBy": "Admin",
"required": true,
"possibleValues": [
{ "id": "contact", "label": "Contact" },
{ "id": "lead", "label": "Lead" }
],
"customHandlers": null,
"adminValue": "contact",
"order": 1
}
],
"status": "active",
"createdAt": "2025-11-26T10:00:00.000Z",
"updatedAt": "2025-11-26T10:00:00.000Z"
}
]
}Create a new feature mapping for an integration.
Endpoint: POST /api/integrations/:integrationId/feature-mappings
URL Parameters:
integrationId(string, required) - Integration ID
Request Body:
{
"featureTemplateId": "create_contact",
"featureTemplateName": "Create Contact",
"fieldMappings": {
"first_name": {
"enabled": true,
"customHandlers": {
"valueHandler": "capitalizeFirstName"
}
},
"email": {
"enabled": true,
"customHandlers": {
"validationHandler": "validateEmailFormat"
}
}
},
"apiConfig": {
"apiConfigId": null,
"method": "POST",
"endpoint": "/api/contacts"
},
"extraFields": [
{
"fieldKey": "sheet_id",
"label": "Google Sheet ID",
"type": "static",
"fieldType": "string",
"htmlType": "text",
"fillBy": "Admin",
"required": true,
"adminValue": "1BxiMVs0...",
"order": 1
}
]
}Success Response (201 Created):
{
"success": true,
"mapping": {
"id": "mapping_1764100935626_abc123",
"featureTemplateId": "create_contact",
...
},
"message": "Feature mapping created successfully"
}Error Response (400 Bad Request):
{
"success": false,
"message": "Invalid feature template ID"
}Update an existing feature mapping.
Endpoint: PUT /api/integrations/:integrationId/feature-mappings/:mappingId
URL Parameters:
integrationId(string, required) - Integration IDmappingId(string, required) - Mapping ID
Request Body: Same as Create Feature Mapping
Success Response (200 OK):
{
"success": true,
"mapping": {
"id": "mapping_1764100935626_abc123",
"featureTemplateId": "create_contact",
"updatedAt": "2025-11-26T11:00:00.000Z",
...
},
"message": "Feature mapping updated successfully"
}Error Response (404 Not Found):
{
"success": false,
"message": "Feature mapping not found"
}Delete a feature mapping.
Endpoint: DELETE /api/integrations/:integrationId/feature-mappings/:mappingId
URL Parameters:
integrationId(string, required) - Integration IDmappingId(string, required) - Mapping ID
Request Example:
DELETE /api/integrations/freshdesk/feature-mappings/mapping_1764100935626_abc123 HTTP/1.1
Host: localhost:3000Success Response (200 OK):
{
"success": true,
"message": "Feature mapping deleted successfully"
}Error Response (404 Not Found):
{
"success": false,
"message": "Feature mapping not found"
}- Always check
successfield in responses before processing data - Handle all error cases with user-friendly messages
- Show loading states during API calls
- Validate data client-side before sending to API
- Never log sensitive data (credentials, tokens) to console
- Always encrypt credentials before storage
- Use try-catch blocks for all database operations
- Return consistent error formats across all endpoints
- Validate all inputs before processing
- Log errors with context for debugging
- Use transaction for operations that modify multiple records
- Test immediately after creation to validate credentials
- Re-test periodically to ensure connections remain valid
- Handle test failures gracefully with helpful error messages
- Update test status in database after each test
- Feature Templates - Added GET endpoints for feature templates
- Feature Mappings - Added full CRUD endpoints for feature-integration mappings
- Table of Contents - Updated with new endpoint sections
- Documentation - Added comprehensive request/response examples for feature system
- Enhanced PUT endpoint - Added support for
authMethodId,authMethodLabel, andconnectionNamefields - Enhanced GET endpoint - Now returns
success: truefield and embedded integration metadata - Edit mode support - Added comprehensive documentation for edit connection workflow
- Smart password handling - Documented password preservation when fields are omitted
- Usage examples - Added code examples for edit mode workflows
- Initial API documentation
- Connection management endpoints
- Connection testing endpoints
- User and integration endpoints
- Comprehensive error handling documentation
- User Connection Management System
- Connection Wizard Technical Guide
- My Connections Page Documentation
- Feature Templates Documentation
- Feature Mapping System Guide
- Field Types and Handlers Guide
- Elasticsearch Schema
For issues or questions about the API:
- Check the error message in the response
- Verify request format matches documentation
- Check server logs for detailed error information
- Consult related documentation files