Get Widget Configuration
Used to retrieve the configuration settings for a specific chat widget. This endpoint provides all the necessary settings to render and customize the chat widget interface.
API Endpoint
| Property | Value |
|---|---|
| Request Method | GET |
| Request URL | https://api.seliseblocks.com/conversation/config |
Request
Request Example
curl -X GET 'https://api.seliseblocks.com/conversation/config?widget_id=widget_123' \
-H 'accept: application/json'
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| widget_id | string | Yes | The unique identifier of the chat widget. |
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
tip
When to use this endpoint:
- Widget initialization: Fetch configuration before rendering the chat interface
- Dynamic customization: Apply branding and styling based on configuration
- Feature toggling: Enable/disable features based on widget settings
- Multi-tenant support: Load different configurations for different clients
- A/B testing: Serve different widget variants based on configuration
- Real-time updates: Periodically refresh configuration for dynamic changes
Common use cases:
- Branding: Colors, logos, fonts, and theme customization
- Behavior: Auto-greeting messages, response delays, typing indicators
- Features: File upload, voice input, quick replies, suggested actions
- Integration: Third-party tools, analytics, CRM connections
- Localization: Language settings, date/time formats, translations
- Access control: Authentication requirements, user permissions
Response
Success Response (200 OK)
Returns a configuration object containing all widget settings.
{
"widget_id": "widget_123",
"display_name": "Customer Support Chat",
"theme": {
"primary_color": "#007bff",
"secondary_color": "#6c757d",
"background_color": "#ffffff",
"text_color": "#212529",
"font_family": "Inter, sans-serif"
},
"branding": {
"logo_url": "https://example.com/logo.png",
"company_name": "Acme Corp",
"avatar_url": "https://example.com/avatar.png"
},
"behavior": {
"welcome_message": "Hello! How can I help you today?",
"auto_open": false,
"auto_open_delay": 3000,
"show_typing_indicator": true,
"message_delay": 500,
"enable_sound": true
},
"features": {
"file_upload": true,
"voice_input": false,
"quick_replies": true,
"suggested_actions": true,
"conversation_history": true,
"export_transcript": true,
"rating_prompt": true
},
"limits": {
"max_file_size_mb": 10,
"max_message_length": 2000,
"allowed_file_types": ["pdf", "jpg", "png", "docx"]
},
"localization": {
"language": "en",
"timezone": "UTC",
"date_format": "MM/DD/YYYY",
"time_format": "12h"
},
"integration": {
"analytics_enabled": true,
"analytics_id": "GA-123456",
"crm_integration": "salesforce",
"custom_metadata": {
"department": "support",
"priority": "high"
}
},
"security": {
"require_authentication": false,
"allowed_domains": ["example.com", "*.example.com"],
"data_retention_days": 90
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| - | object | Flexible configuration object (additionalProp1: {}) containing widget settings. The structure varies based on widget type and customization options. |
note
Configuration Object Structure
The response returns a flexible object that can contain various configuration categories:
Theme Settings:
- Color schemes (primary, secondary, background, text)
- Typography (font families, sizes, weights)
- Layout preferences (position, size, animations)
- Dark/light mode support
Branding Elements:
- Company logo and avatar URLs
- Brand colors and styling
- Custom CSS overrides
- White-label options
Behavior Configuration:
- Welcome and greeting messages
- Auto-open settings and delays
- Typing indicators and animations
- Sound effects and notifications
- Message delivery settings
Feature Flags:
- File upload capabilities
- Voice and video support
- Quick reply buttons
- Suggested actions
- Conversation history
- Transcript export
- Feedback and rating prompts
Limits and Constraints:
- Maximum file sizes
- Message length limits
- Rate limiting settings
- Allowed file types
- Concurrent session limits
Localization:
- Language and locale
- Timezone settings
- Date and time formats
- Currency formatting
- Translation keys
Integration Settings:
- Analytics tracking (Google Analytics, Mixpanel, etc.)
- CRM connections (Salesforce, HubSpot, etc.)
- Third-party webhooks
- Custom metadata fields
- API keys for external services
Security and Compliance:
- Authentication requirements
- Domain whitelist/blacklist
- Data retention policies
- GDPR compliance settings
- Encryption preferences
Error Response (422 Unprocessable Entity)
Returns validation error details when the widget_id is invalid or not found.
{
"detail": [
{
"loc": [
"query",
"widget_id"
],
"msg": "Widget not found or access denied",
"type": "value_error.notfound"
}
]
}
Error Response Fields
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., query parameter). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Common Error Scenarios
| Error Type | Description | Resolution |
|---|---|---|
| Widget Not Found | The specified widget_id doesn't exist | Verify widget_id is correct and widget exists |
| Access Denied | Insufficient permissions to access widget config | Check API credentials and permissions |
| Widget Inactive | The widget has been deactivated or deleted | Contact administrator or use an active widget |
| Invalid Widget ID | Widget ID format is incorrect | Ensure widget_id follows correct format |
| Configuration Unavailable | Widget config temporarily unavailable | Retry with exponential backoff |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | OK - Configuration retrieved successfully | Success |
| 400 | Bad Request - Invalid request format | Bad Request |
| 401 | Unauthorized - Authentication required | Unauthorized |
| 403 | Forbidden - Access denied to widget config | Forbidden |
| 404 | Not Found - Widget doesn't exist | Not Found |
| 422 | Validation Error - Invalid widget_id | Unprocessable Entity |
| 500 | Internal Server Error - Failed to fetch config | Internal Server Error |
warning
Important Considerations
- Caching: Cache configuration locally to reduce API calls and improve performance
- Cache invalidation: Implement cache refresh strategy (e.g., every 5-15 minutes)
- Fallback values: Always have default configuration in case API fails
- Security: Don't expose sensitive configuration values in client-side code
- Version compatibility: Configuration structure may evolve; handle unknown fields gracefully
- Performance: Fetch configuration once during initialization, not per message
- Real-time updates: Consider WebSocket or polling for dynamic configuration changes
- Cross-origin: Ensure proper CORS configuration for widget embedding
- Feature detection: Check feature flags before enabling functionality
- Responsive design: Adapt widget rendering based on configuration settings
- Error handling: Gracefully degrade if specific configuration options are missing
- Testing: Test widget with different configurations across environments