Update AI Agent Widget
Used to update the AI-specific widget for an existing agent, including widget settings, appearance, and behavior configurations.
API Endpoint
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://api.seliseblocks.com/agents/update-widget |
Request
Request Example
curl -X POST 'https://api.seliseblocks.com/agents/update-widget' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"regen_widget_id": false,
"project_key": "YOUR_PROJECT_KEY",
"widget": {
"Name": "Support Chat Widget",
"WidgetSettings": [
{
"WidgetType": "chat",
"FeStyle": ""
}
],
"LogoUrl": "https://example.com/logo.png",
"LogoId": "logo_123456",
"FeScript": "",
"ShowAgentName": true,
"Greeting": "Welcome! My name is [NAME]. If you need any assistance or have any questions, I am here to help.",
"SiteUrl": "https://example.com",
"BrandColor": "#4F46E5",
"PredefinedQuestions": [
"How can I reset my password?",
"What are your business hours?",
"How do I contact support?"
],
"EnablePredefinedQuestions": true
}
}'
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
| Content-Type | application/json | Yes | Data type, must be application/json. |
Request Body
Request Body Schema
{
"agent_id": "string",
"regen_widget_id": false,
"project_key": "string",
"widget": {
"Name": "string",
"WidgetSettings": [
{
"WidgetType": "chat",
"FeStyle": ""
}
],
"LogoUrl": "string",
"LogoId": "string",
"FeScript": "string",
"ShowAgentName": false,
"Greeting": "Welcome! My name is [NAME]. If you need any assistance or have any questions, I'm here to help.",
"SiteUrl": "string",
"BrandColor": "string",
"PredefinedQuestions": ["string"],
"EnablePredefinedQuestions": false
}
}
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| agent_id | string | Yes | Unique identifier of the agent to be updated. |
| regen_widget_id | boolean | No | Whether to regenerate the widget ID. |
| project_key | string | Yes | The project key for your project. |
| widget | object | Yes | Widget configuration object. |
Widget Configuration Parameters
| Field | Type | Description |
|---|---|---|
| Name | string | Name of the widget. |
| WidgetSettings | array | Array of widget setting objects. |
| LogoUrl | string | URL of the widget logo image. |
| LogoId | string | Unique identifier for the logo asset. |
| FeScript | string | Frontend script for widget customization. |
| ShowAgentName | boolean | Whether to display the agent's name in the widget. |
| Greeting | string | Initial greeting message shown to users. Use [NAME] as a placeholder for the agent's name. |
| SiteUrl | string | URL of the website where widget will be embedded. |
| BrandColor | string | Primary brand color for the widget (hex format). |
| PredefinedQuestions | array | Array of predefined questions to show users. |
| EnablePredefinedQuestions | boolean | Whether to enable predefined questions feature. |
Widget Settings Parameters
| Field | Type | Description |
|---|---|---|
| WidgetType | string | Type of widget (e.g., chat, form). |
| FeStyle | string | Custom frontend styling configuration. |
Response
Success Response (200 OK)
Returns an object containing the update status and details.
{
"is_success": true,
"item_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"detail": "Widget updated successfully",
"error": {}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| is_success | boolean | Indicates whether the widget update was successful. |
| item_id | string | Unique identifier for the updated agent. |
| detail | string | Success or failure message with additional context. |
| error | object | Error details if the operation failed (empty if successful). |
Error Response (422 Unprocessable Entity)
Returns validation error details when the request body is invalid.
{
"detail": [
{
"loc": [
"body",
"agent_id"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Error Response Fields
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., body field). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |