> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.jelliu.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.jelliu.co/_mcp/server.

# Update a widget

PUT https://api.jelliu.co/api/widgets/{id}
Content-Type: application/json

Changes a widget's settings. Despite the `PUT` verb this is a **partial** update: only the fields you
send change, and at least one must be sent. Two exceptions to "merge" semantics:

* `branding` replaces the stored branding object as a whole (send every branding field you want to
  keep; `primary_color` is required inside it).
* `allowed_origins` replaces the whole list.

Send `greeting_message: null` (or an empty string) to clear the greeting. The widget API key cannot
be rotated and the widget cannot be deactivated here; use `DELETE /api/widgets/{id}` to take it down.

**Side effects.** Updates the row, clears the cached widget list, the cached authenticated embed script
and the runtime configuration cache, and writes an audit entry.

**Consistency.** Runtime endpoints (`/widget/*`) keep a per-instance copy of the configuration for up
to 30 seconds, so a new `allowed_origins`, `rate_limit_rpm` or `voice_enabled` can take that long to
apply everywhere. Browsers may cache the embed script for up to 5 minutes, so launcher colour and
position changes can take that long to appear on your site.

**Idempotency.** Safe to retry: sending the same body again leaves the same state (only
`updated_at` moves).

**Webhook events.** `audit.log_recorded` when you subscribe to it. See [Webhooks](/webhooks).

**Access**

* **Required scope:** `write`.
* **Rate limit:** General API — 120 requests/min per workspace (200 on Growth, 300 on Business, 600 on Enterprise). See [Rate limits](/rate-limits).
* **Plan:** Available on every plan.

Reference: https://developer.jelliu.co/api-reference/widgets/put-widgets-by-id

## Authentication

- `Authorization` header (bearer token, required) — Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

## Request

### Path parameters

- `id` (string, required) — Widget id. A value that is not a UUID returns 400 `Invalid widget ID`.

### Body (application/json)

This endpoint expects an object.

- `agent_id` (string, optional) — Agent that answers visitors from now on. Not looked up; use an agent of your workspace.
- `name` (string, optional) — Internal name. Trimmed; an empty or blank string is treated as not sent.
- `allowed_origins` (list of string, optional) — Replaces the whole list. Full origins (scheme, host, optional port); `*` never matches.
- `branding` (object, optional) — Widget look and copy. On write, `primary_color` is required whenever `branding` is sent, and the object REPLACES the stored branding (it is not merged). Widgets created without branding store `{}`, which is what `POST /widget/init` then returns.
  - `primary_color` (string, required) — Accent colour for the launcher and header, as `#RRGGBB` (error: `Must be a hex color like #FF0000`).
  - `logo_url` (string, optional) — Logo shown in the chat header.
  - `position` (enum, optional) — Corner for the launcher button. `bottom-right` puts it in the lower-right corner (the default when omitted); `bottom-left` in the lower-left corner.
    - Allowed values: `bottom-right`, `bottom-left`
  - `title` (string, optional) — Chat header title.
  - `subtitle` (string, optional) — Line under the title, such as expected reply time.
  - `quick_replies` (list of string, optional) — Up to 4 suggestion chips shown under the greeting (1 to 60 characters each).
  - `agent_names` (list of string, optional) — Display names (1 to 40 characters); the UI picks one per visitor and replies are signed with it.
  - `agent_avatars` (list of string, optional) — One picture per entry of `agent_names`, aligned by index. `https://` URLs or site-relative paths only (up to 500 characters); other values fail with `La imagen debe ser https o una ruta propia`.
  - `i18n` (map from string to object, optional) — Per-language greeting and quick replies, keyed by primary language subtag (`es`, `en`). The widget uses the block matching the visitor's language before falling back to `greeting_message`.
    - `greeting` (string, optional) — Greeting for this language.
    - `quick_replies` (list of string, optional) — Quick replies for this language.
- `voice_enabled` (boolean, optional) — Whether `POST /widget/voice-session` may be used for this widget.
- `greeting_message` (string, optional, nullable) — First message the widget shows. Trimmed. `null` or an empty string clears it.
- `rate_limit_rpm` (integer, optional) — Requests per minute allowed per widget credential on the public `/widget/*` endpoints.

## Response

### 200

The updated widget.

- `data` (object, required) — A web-chat widget configuration. Returned by every `/api/widgets` endpoint. Field names are snake_case.
  - `id` (string, optional) — Widget id. Also the public credential used by the embed script (`x-widget-id` / `wid`).
  - `tenant_id` (string, optional) — Workspace that owns the widget.
  - `agent_id` (string, optional) — Agent that answers the widget's visitors (text and voice).
  - `name` (string, optional) — Internal name shown in the dashboard; visitors do not see it.
  - `allowed_origins` (list of string, optional) — Origins allowed to embed the widget. Runtime calls must send an `x-widget-parent-origin` that matches one entry: scheme and port exactly, hostname equal modulo one leading `www.`. `*` never matches.
  - `branding` (object, optional) — Widget look and copy. On write, `primary_color` is required whenever `branding` is sent, and the object REPLACES the stored branding (it is not merged). Widgets created without branding store `{}`, which is what `POST /widget/init` then returns.
    - `primary_color` (string, required) — Accent colour for the launcher and header, as `#RRGGBB` (error: `Must be a hex color like #FF0000`).
    - `logo_url` (string, optional) — Logo shown in the chat header.
    - `position` (enum, optional) — Corner for the launcher button. `bottom-right` puts it in the lower-right corner (the default when omitted); `bottom-left` in the lower-left corner.
      - Allowed values: `bottom-right`, `bottom-left`
    - `title` (string, optional) — Chat header title.
    - `subtitle` (string, optional) — Line under the title, such as expected reply time.
    - `quick_replies` (list of string, optional) — Up to 4 suggestion chips shown under the greeting (1 to 60 characters each).
    - `agent_names` (list of string, optional) — Display names (1 to 40 characters); the UI picks one per visitor and replies are signed with it.
    - `agent_avatars` (list of string, optional) — One picture per entry of `agent_names`, aligned by index. `https://` URLs or site-relative paths only (up to 500 characters); other values fail with `La imagen debe ser https o una ruta propia`.
    - `i18n` (map from string to object, optional) — Per-language greeting and quick replies, keyed by primary language subtag (`es`, `en`). The widget uses the block matching the visitor's language before falling back to `greeting_message`.
      - `greeting` (string, optional) — Greeting for this language.
      - `quick_replies` (list of string, optional) — Quick replies for this language.
  - `voice_enabled` (boolean, optional) — Whether visitors can talk to the agent by voice (`POST /widget/voice-session`).
  - `greeting_message` (string, optional, nullable) — First message the chat shows before the visitor writes; `null` when not set.
  - `rate_limit_rpm` (integer, optional) — Requests per minute allowed per widget credential on the public `/widget/*` endpoints (default 30). The widget id and the API key are counted separately.
  - `api_key` (string, optional) — HMAC-SHA256 digest (64 hex characters) of the widget API key as stored. It is NOT the key and cannot authenticate. The plaintext key is returned only once, as `plaintext_api_key`, in the `POST /api/widgets` response.
  - `is_active` (boolean, optional) — `false` once the widget is deleted. Cannot be changed through the API.
  - `created_at` (datetime, optional) — When the widget was created.
  - `updated_at` (datetime, optional) — When the widget was last updated.
  - `deleted_at` (datetime, optional, nullable) — Always `null` in API responses; deleted widgets are not returned.

## Errors

### 400 Bad Request Error

`Invalid widget ID` when `id` is not a UUID, or `Invalid update input` with Zod's flattened error in `details`. An empty body (or one whose fields are all blank) reports `At least one field must be provided` in `formErrors`.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 401 Unauthorized Error

No usable credential. Either the `Authorization` header is missing or is not a well-formed `Bearer jl_…` key, or the key is unknown, revoked or expired. Do not retry with the same key. See [Authentication](/authentication#401-unauthorized).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 403 Forbidden Error

The API key lacks the `write` scope, or the workspace is suspended.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 404 Not Found Error

The widget does not exist, was deleted, or belongs to another workspace.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 429 Too Many Requests Error

Rate limit exceeded for the current 60-second window (`RATE_LIMIT_EXCEEDED`). Wait `Retry-After` seconds, then retry. The `message` differs per limiter; the code does not. See [Rate limits](/rate-limits).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

## Examples

### Widgets_putWidgetsById_example

**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "id": "84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e",
    "tenant_id": "58ffb2a3-7704-4790-bf60-a7235e42d0e4",
    "agent_id": "efac2e32-c698-4018-974d-bbf4500916b5",
    "name": "Sitio web principal",
    "allowed_origins": [
      "https://www.clinicasonrisa.co"
    ],
    "branding": {
      "primary_color": "#1C1D2B",
      "position": "bottom-right",
      "title": "Habla con nosotros"
    },
    "voice_enabled": true,
    "greeting_message": "¡Hola! ¿Te ayudo a agendar tu cita?",
    "rate_limit_rpm": 30,
    "api_key": "1dbac0de07f71908b42f2b1fb25f87f37073d231959ec319cb79296f14425645",
    "is_active": true,
    "created_at": "2026-09-10T14:22:05.418Z",
    "updated_at": "2026-09-15T13:12:09.330Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Widgets_putWidgetsById_example
import requests

url = "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e"

headers = {"Authorization": "Bearer <token>"}

response = requests.put(url, headers=headers)

print(response.json())
```

```javascript Widgets_putWidgetsById_example
const url = 'https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e';
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Widgets_putWidgetsById_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e"

	req, _ := http.NewRequest("PUT", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Widgets_putWidgetsById_example
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Widgets_putWidgetsById_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Widgets_putWidgetsById_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Widgets_putWidgetsById_example
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Widgets_putWidgetsById_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Change the greeting and enable voice

**Request**

```json
{
  "voice_enabled": true,
  "greeting_message": "¡Hola! ¿Te ayudo a agendar tu cita?"
}
```

**Response**

```json
{
  "data": {
    "id": "84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e",
    "tenant_id": "58ffb2a3-7704-4790-bf60-a7235e42d0e4",
    "agent_id": "efac2e32-c698-4018-974d-bbf4500916b5",
    "name": "Sitio web principal",
    "allowed_origins": [
      "https://www.clinicasonrisa.co"
    ],
    "branding": {
      "primary_color": "#1C1D2B",
      "position": "bottom-right",
      "title": "Habla con nosotros"
    },
    "voice_enabled": true,
    "greeting_message": "¡Hola! ¿Te ayudo a agendar tu cita?",
    "rate_limit_rpm": 30,
    "api_key": "1dbac0de07f71908b42f2b1fb25f87f37073d231959ec319cb79296f14425645",
    "is_active": true,
    "created_at": "2026-09-10T14:22:05.418Z",
    "updated_at": "2026-09-15T13:12:09.330Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Change the greeting and enable voice
import requests

url = "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e"

payload = {
    "voice_enabled": True,
    "greeting_message": "¡Hola! ¿Te ayudo a agendar tu cita?"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Change the greeting and enable voice
const url = 'https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"voice_enabled":true,"greeting_message":"¡Hola! ¿Te ayudo a agendar tu cita?"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Change the greeting and enable voice
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e"

	payload := strings.NewReader("{\n  \"voice_enabled\": true,\n  \"greeting_message\": \"¡Hola! ¿Te ayudo a agendar tu cita?\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Change the greeting and enable voice
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"voice_enabled\": true,\n  \"greeting_message\": \"¡Hola! ¿Te ayudo a agendar tu cita?\"\n}"

response = http.request(request)
puts response.read_body
```

```java Change the greeting and enable voice
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"voice_enabled\": true,\n  \"greeting_message\": \"¡Hola! ¿Te ayudo a agendar tu cita?\"\n}")
  .asString();
```

```php Change the greeting and enable voice
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e', [
  'body' => '{
  "voice_enabled": true,
  "greeting_message": "¡Hola! ¿Te ayudo a agendar tu cita?"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Change the greeting and enable voice
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"voice_enabled\": true,\n  \"greeting_message\": \"¡Hola! ¿Te ayudo a agendar tu cita?\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Change the greeting and enable voice
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "voice_enabled": true,
  "greeting_message": "¡Hola! ¿Te ayudo a agendar tu cita?"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Replace the allowed origins

**Request**

```json
{
  "allowed_origins": [
    "https://www.clinicasonrisa.co",
    "https://reservas.clinicasonrisa.co"
  ]
}
```

**Response**

```json
{
  "data": {
    "id": "84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e",
    "tenant_id": "58ffb2a3-7704-4790-bf60-a7235e42d0e4",
    "agent_id": "efac2e32-c698-4018-974d-bbf4500916b5",
    "name": "Sitio web principal",
    "allowed_origins": [
      "https://www.clinicasonrisa.co"
    ],
    "branding": {
      "primary_color": "#1C1D2B",
      "position": "bottom-right",
      "title": "Habla con nosotros"
    },
    "voice_enabled": true,
    "greeting_message": "¡Hola! ¿Te ayudo a agendar tu cita?",
    "rate_limit_rpm": 30,
    "api_key": "1dbac0de07f71908b42f2b1fb25f87f37073d231959ec319cb79296f14425645",
    "is_active": true,
    "created_at": "2026-09-10T14:22:05.418Z",
    "updated_at": "2026-09-15T13:12:09.330Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Replace the allowed origins
import requests

url = "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e"

payload = { "allowed_origins": ["https://www.clinicasonrisa.co", "https://reservas.clinicasonrisa.co"] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Replace the allowed origins
const url = 'https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"allowed_origins":["https://www.clinicasonrisa.co","https://reservas.clinicasonrisa.co"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Replace the allowed origins
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e"

	payload := strings.NewReader("{\n  \"allowed_origins\": [\n    \"https://www.clinicasonrisa.co\",\n    \"https://reservas.clinicasonrisa.co\"\n  ]\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Replace the allowed origins
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"allowed_origins\": [\n    \"https://www.clinicasonrisa.co\",\n    \"https://reservas.clinicasonrisa.co\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Replace the allowed origins
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"allowed_origins\": [\n    \"https://www.clinicasonrisa.co\",\n    \"https://reservas.clinicasonrisa.co\"\n  ]\n}")
  .asString();
```

```php Replace the allowed origins
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e', [
  'body' => '{
  "allowed_origins": [
    "https://www.clinicasonrisa.co",
    "https://reservas.clinicasonrisa.co"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Replace the allowed origins
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"allowed_origins\": [\n    \"https://www.clinicasonrisa.co\",\n    \"https://reservas.clinicasonrisa.co\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Replace the allowed origins
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["allowed_origins": ["https://www.clinicasonrisa.co", "https://reservas.clinicasonrisa.co"]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Replace branding (send every field to keep)

**Request**

```json
{
  "branding": {
    "primary_color": "#0E7C66",
    "position": "bottom-left",
    "title": "Clínica Sonrisa",
    "subtitle": "Te respondemos al instante"
  }
}
```

**Response**

```json
{
  "data": {
    "id": "84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e",
    "tenant_id": "58ffb2a3-7704-4790-bf60-a7235e42d0e4",
    "agent_id": "efac2e32-c698-4018-974d-bbf4500916b5",
    "name": "Sitio web principal",
    "allowed_origins": [
      "https://www.clinicasonrisa.co"
    ],
    "branding": {
      "primary_color": "#1C1D2B",
      "position": "bottom-right",
      "title": "Habla con nosotros"
    },
    "voice_enabled": true,
    "greeting_message": "¡Hola! ¿Te ayudo a agendar tu cita?",
    "rate_limit_rpm": 30,
    "api_key": "1dbac0de07f71908b42f2b1fb25f87f37073d231959ec319cb79296f14425645",
    "is_active": true,
    "created_at": "2026-09-10T14:22:05.418Z",
    "updated_at": "2026-09-15T13:12:09.330Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Replace branding (send every field to keep)
import requests

url = "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e"

payload = { "branding": {
        "primary_color": "#0E7C66",
        "position": "bottom-left",
        "title": "Clínica Sonrisa",
        "subtitle": "Te respondemos al instante"
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Replace branding (send every field to keep)
const url = 'https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"branding":{"primary_color":"#0E7C66","position":"bottom-left","title":"Clínica Sonrisa","subtitle":"Te respondemos al instante"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Replace branding (send every field to keep)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e"

	payload := strings.NewReader("{\n  \"branding\": {\n    \"primary_color\": \"#0E7C66\",\n    \"position\": \"bottom-left\",\n    \"title\": \"Clínica Sonrisa\",\n    \"subtitle\": \"Te respondemos al instante\"\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Replace branding (send every field to keep)
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"branding\": {\n    \"primary_color\": \"#0E7C66\",\n    \"position\": \"bottom-left\",\n    \"title\": \"Clínica Sonrisa\",\n    \"subtitle\": \"Te respondemos al instante\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Replace branding (send every field to keep)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"branding\": {\n    \"primary_color\": \"#0E7C66\",\n    \"position\": \"bottom-left\",\n    \"title\": \"Clínica Sonrisa\",\n    \"subtitle\": \"Te respondemos al instante\"\n  }\n}")
  .asString();
```

```php Replace branding (send every field to keep)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e', [
  'body' => '{
  "branding": {
    "primary_color": "#0E7C66",
    "position": "bottom-left",
    "title": "Clínica Sonrisa",
    "subtitle": "Te respondemos al instante"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Replace branding (send every field to keep)
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"branding\": {\n    \"primary_color\": \"#0E7C66\",\n    \"position\": \"bottom-left\",\n    \"title\": \"Clínica Sonrisa\",\n    \"subtitle\": \"Te respondemos al instante\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Replace branding (send every field to keep)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["branding": [
    "primary_color": "#0E7C66",
    "position": "bottom-left",
    "title": "Clínica Sonrisa",
    "subtitle": "Te respondemos al instante"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Remove the greeting

**Request**

```json
{
  "greeting_message": null
}
```

**Response**

```json
{
  "data": {
    "id": "84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e",
    "tenant_id": "58ffb2a3-7704-4790-bf60-a7235e42d0e4",
    "agent_id": "efac2e32-c698-4018-974d-bbf4500916b5",
    "name": "Sitio web principal",
    "allowed_origins": [
      "https://www.clinicasonrisa.co"
    ],
    "branding": {
      "primary_color": "#1C1D2B",
      "position": "bottom-right",
      "title": "Habla con nosotros"
    },
    "voice_enabled": true,
    "greeting_message": "¡Hola! ¿Te ayudo a agendar tu cita?",
    "rate_limit_rpm": 30,
    "api_key": "1dbac0de07f71908b42f2b1fb25f87f37073d231959ec319cb79296f14425645",
    "is_active": true,
    "created_at": "2026-09-10T14:22:05.418Z",
    "updated_at": "2026-09-15T13:12:09.330Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Remove the greeting
import requests

url = "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e"

payload = { "greeting_message": None }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Remove the greeting
const url = 'https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"greeting_message":null}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Remove the greeting
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e"

	payload := strings.NewReader("{\n  \"greeting_message\": null\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Remove the greeting
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"greeting_message\": null\n}"

response = http.request(request)
puts response.read_body
```

```java Remove the greeting
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"greeting_message\": null\n}")
  .asString();
```

```php Remove the greeting
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e', [
  'body' => '{
  "greeting_message": null
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Remove the greeting
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"greeting_message\": null\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove the greeting
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["greeting_message": ] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/widgets/84b5aa0e-f6d6-4d88-b3ad-cd7a5a2aeb9e")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```