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

# Update a robot

PATCH https://api-chat.parstechai.com/v1/robots/{robot_id}
Content-Type: application/json

Changes any subset of a robot's fields and settings: its name, your `external_id`, its description, whether it is active, and its `settings`, the same ones your customer sees in the ParsChat panel. See the [robot settings guide](/documentation/guides/robot-settings) for what each one does.

**Only what you send changes, and nested objects merge.** `{"settings": {"conversations": {"auto_close": {"idle_minutes": 720}}}}` keeps `enabled` as it was, and a working-hours `days` object changes only the days it names.

**A request is all or nothing.** If any part is refused, nothing in it is saved. An unknown field is refused rather than ignored, so a typo cannot pass as saved, and `null` is accepted only for `external_id` and `description`, which it clears. An empty body changes nothing.

**`settings.ai` and `settings.ai_operator` need an AI messages package.** Without one they read as `null`, and a request carrying either answers `403 ai_not_in_plan`.

**Auto-close.** `idle_minutes` is 15 to 21600 (15 days). With `enabled: false` a conversation still closes after 15 days without a message. Conversations are closed by an hourly job, so one closes up to about an hour after its limit, with a `chat` event; a customer who writes again reopens the same conversation.

**`is_active: false` is not a pause.** It switches every channel of the robot off, which frees their channel capacity; `true` does not switch them back on. To stop only the AI, set `settings.ai_operator.enabled` to `false`.

**Not in this API:** the robot's custom prompt, which changes only through the panel's prompt assistant, and the AI operator's avatar.

Reference: https://docs-parschat.parstechai.com/api-reference/robots/update-robot

## Authentication

- `Authorization` header (bearer token, required) — Your API key, issued by ParsChat sales. One key per account, spanning every robot you own. Send it as `Authorization: Bearer pk_live_…`.

## Request

### Path parameters

- `robot_id` (string, required) — The robot's id, as returned by the create call.

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional) — Display name, 1 to 255 characters.
- `external_id` (string, optional, nullable) — Your own customer id, 1 to 255 characters, unique across your robots (409 otherwise). `null` clears it.
- `description` (string, optional, nullable) — Free text, up to 255 characters. `null` clears it.
- `is_active` (boolean, optional) — `false` deactivates the robot and switches all its channels off; `true` reactivates it but leaves the channels off.
- `settings` (RobotSettingsUpdate, optional) — A change to any part of a robot's settings. Only what you send changes; nested objects merge.

## Response

### 200

The robot after the change, with all its settings.

- `id` (string, optional) — ParsChat identifier for the robot.
- `name` (string, optional) — Display name, shown in the panel.
- `external_id` (string, optional, nullable) — Your own identifier for this customer. Returned on every webhook event, so you do not need a lookup table. `null` until you set one.
- `description` (string, optional, nullable) — Free text about the robot, up to 255 characters. `null` until you set it.
- `is_active` (boolean, optional) — `false` while the robot is deactivated: its channels are switched off. See `PATCH /robots/{robot_id}`.
- `channels` (list of ChannelSummary, optional) — Channels attached to this robot, in short form. Empty until you connect one. Call the channels endpoint for the full record.
- `created_at` (datetime, optional) — When the robot was created.
- `settings` (RobotSettings, optional) — A robot's settings, the same ones your customer sees in the ParsChat panel. `ai` and `ai_operator` are `null` for an account without an AI messages package.

## Errors

### 400 Bad Request Error

The request itself is malformed: a parameter is missing, unparseable, or out of range. Unlike 422, the request never reached validation of its contents.

- `error` (ErrorError, optional)

### 401 Unauthorized Error

The key is missing, wrong, revoked, or past its expiry date. All four answer `invalid_key`: telling an expired key from an unknown one would confirm to whoever holds a leaked key that it was once real.

- `error` (ErrorError, optional)

### 403 Forbidden Error

AI settings on an account without an AI messages package, or your plan is not active. Nothing was saved.

- `error` (ErrorError, optional)

### 404 Not Found Error

No such resource, or it belongs to another partner. We return 404 rather than 403 here, because a 403 would confirm the id exists.

- `error` (ErrorError, optional)

### 409 Conflict Error

That `external_id` already belongs to another of your robots. Nothing was saved.

- `error` (ErrorError, optional)

### 422 Unprocessable Entity Error

A value out of range, a `null` where none is allowed, or an unknown field. The message names the field by its path; branch on `code`, not on the wording. Nothing was saved.

- `error` (ErrorError, optional)

### 429 Too Many Requests Error

You are calling the API too fast. `details` names the limit you are held to. This never means an automated reply to an end customer was discarded: those are queued, not dropped.

- `error` (ErrorError, optional)

### 500 Internal Server Error

Something failed on our side. Retry with backoff, and quote `request_id` if it persists.

- `error` (ErrorError, optional)

## Types

### RobotSettingsUpdate

A change to any part of a robot's settings. Only what you send changes; nested objects merge.

- `conversations` (ConversationSettingsUpdate, optional) — Any part of how the robot's conversations are run. Only what you send changes.
- `ai` (AISettingsUpdate, optional) — Any part of how the AI answers. Needs an AI messages package, or the request answers `403 ai_not_in_plan`. The robot's custom prompt is not here: it changes only through the panel's prompt assistant.
- `ai_operator` (AIOperatorSettingsUpdate, optional) — Any part of when the AI answers. Needs an AI messages package, or the request answers `403 ai_not_in_plan`.

### ChannelSummary

The short form of a channel, as it appears inside a robot.

- `id` (string, optional) — ParsChat identifier for the channel.
- `type` (enum, optional) — The kind of surface this channel connects.
  - Allowed values: `telegram`, `instagram`, `goftino`, `widget`, `crisp`, `gap`, `whatsapp`
- `is_active` (boolean, optional) — Whether the channel is receiving traffic.

### RobotSettings

A robot's settings, the same ones your customer sees in the ParsChat panel. `ai` and `ai_operator` are `null` for an account without an AI messages package.

- `conversations` (ConversationSettings, required) — How the robot's conversations are run.
- `ai` (AISettings, required, nullable) — `null` without an AI messages package.
- `ai_operator` (AIOperatorSettings, required, nullable) — `null` without an AI messages package.

### ErrorError

- `code` (string, optional) — Stable machine-readable code. Branch on this, not on the message.
- `message` (string, optional) — Human-readable explanation. Wording may change.
- `request_id` (string, optional) — Log this. It is what lets support find your exact request.
- `details` (map from string to any, optional) — Machine-readable context for the code. On `capacity_exhausted` it carries `occupied`, `requested` and `capacity`; on `rate_limited`, `limit_per_minute` and `window_seconds`.

### ConversationSettingsUpdate

Any part of how the robot's conversations are run. Only what you send changes.

- `auto_close` (AutoCloseSettingsUpdate, optional) — When an idle conversation is closed. A robot that never set it shows the rule actually in force (today, 7 days).
- `operator_handover` (OperatorHandoverSettingsUpdate, optional) — What the customer is told when the AI hands their conversation to a person.
- `offline` (OfflineMessageSettingsUpdate, optional) — What a customer waiting for a person is told while the robot is offline.
- `busy` (BusyMessageSettingsUpdate, optional) — What a customer waiting for a person is told when nobody has replied in time.
- `working_hours` (WorkingHoursUpdate, optional) — When your customer's team is at work. Outside these hours the robot counts as offline, which is what `ai_operator.availability` and the offline message follow.
- `offline_message` (string, optional, deprecated) — Deprecated: use `offline.message`. The same text. 1 to 500 characters; whitespace only restores the default text.
- `ai_failure_message` (enum, optional, deprecated) — Deprecated and ignored: when the AI cannot answer, the customer gets the operator handover message.
  - Allowed values: `offline_message`, `handover_message`, `none`

### AISettingsUpdate

Any part of how the AI answers. Needs an AI messages package, or the request answers `403 ai_not_in_plan`. The robot's custom prompt is not here: it changes only through the panel's prompt assistant.

- `enhanced_accuracy` (boolean, optional) — Check every answer before sending it. Uses two AI units per message.
- `creativity` (integer, optional) — 0 sticks closely to your customer's content, 100 is freest.
- `language` (enum, optional) — `auto` answers in the customer's own language.
  - Allowed values: `auto`, `persian`, `english`, `dutch`
- `topic` (string, optional) — What the robot answers about, given to the AI with every question (the panel's robot introduction). Saved at once: nothing is retrained and no characters are used. 5 characters or fewer counts as none.

### AIOperatorSettingsUpdate

Any part of when the AI answers. Needs an AI messages package, or the request answers `403 ai_not_in_plan`.

- `enabled` (boolean, optional) — `false`: the AI never answers; every conversation waits for a person.
- `display_name` (string, optional) — The AI's name in the operator list. 1 to 50 characters.
- `start_mode` (enum, optional) — `on_first_message` answers at once; `if_operator_not_respond` answers only after `wait_minutes` without an operator reply.
  - Allowed values: `on_first_message`, `if_operator_not_respond`
- `availability` (enum, optional) — Answer only while the team is online, only while it is offline (outside working hours or with nobody online), or always.
  - Allowed values: `online`, `offline`, `always`
- `wait_minutes` (integer, optional) — Minutes to wait for an operator before the AI answers. Used only by `if_operator_not_respond`. 1 to 10080 (one week).

### ConversationSettings

How the robot's conversations are run.

- `auto_close` (AutoCloseSettings, required) — When an idle conversation is closed. A robot that never set it shows the rule actually in force (today, 7 days).
- `operator_handover` (OperatorHandoverSettings, required) — What the customer is told when the AI hands their conversation to a person.
- `offline` (OfflineMessageSettings, required) — What a customer waiting for a person is told while the robot is offline.
- `busy` (BusyMessageSettings, required) — What a customer waiting for a person is told when nobody has replied in time.
- `working_hours` (WorkingHours, required) — When your customer's team is at work. Outside these hours the robot counts as offline, which is what `ai_operator.availability` and the offline message follow.
- `offline_message` (string, required, deprecated) — Deprecated: use `offline.message`. The same text.
- `ai_failure_message` (enum, required, deprecated) — Deprecated and ignored: when the AI cannot answer, the customer gets the operator handover message. Always `null`.
  - Allowed values: `offline_message`, `handover_message`, `none`

### AISettings

How the AI answers. Present only for an account holding an AI messages package.

- `enhanced_accuracy` (boolean, required) — Check every answer before sending it. Uses two AI units per message.
- `creativity` (integer, required) — 0 sticks closely to your customer's content, 100 is freest.
- `language` (enum, required) — `auto` answers in the customer's own language.
  - Allowed values: `auto`, `persian`, `english`, `dutch`
- `topic` (string, required) — What the robot answers about, given to the AI with every question (the panel's robot introduction). Saved at once: nothing is retrained and no characters are used. 5 characters or fewer counts as none.

### AIOperatorSettings

When the AI answers instead of a person. Present only for an account holding an AI messages package.

- `enabled` (boolean, required) — `false`: the AI never answers; every conversation waits for a person.
- `display_name` (string, required) — The AI's name in the operator list. 1 to 50 characters.
- `start_mode` (enum, required) — `on_first_message` answers at once; `if_operator_not_respond` answers only after `wait_minutes` without an operator reply.
  - Allowed values: `on_first_message`, `if_operator_not_respond`
- `availability` (enum, required) — Answer only while the team is online, only while it is offline (outside working hours or with nobody online), or always.
  - Allowed values: `online`, `offline`, `always`
- `wait_minutes` (integer, required) — Minutes to wait for an operator before the AI answers. Used only by `if_operator_not_respond`. 1 to 10080 (one week).

### AutoCloseSettingsUpdate

When an idle conversation is closed. A robot that never set it shows the rule actually in force (today, 7 days).

- `enabled` (boolean, optional) — `true`: a conversation closes after `idle_minutes` without a message. `false`: it closes after `max_idle_minutes` (15 days). Off never means never.
- `idle_minutes` (integer, optional) — Minutes without a message before a conversation closes, 15 to 21600. Kept while `enabled` is `false`, so turning it back on restores it.

### OperatorHandoverSettingsUpdate

What the customer is told when the AI hands their conversation to a person.

- `message` (string, optional) — Sent once per conversation when the AI hands the conversation to a person, on every channel. Up to 500 characters; required while `send_message` is on.
- `send_message` (boolean, optional) — Whether `message` is sent.

### OfflineMessageSettingsUpdate

What a customer waiting for a person is told while the robot is offline.

- `message` (string, optional) — Sent once per conversation to a customer waiting for a person while the robot is offline: outside its working hours. Up to 500 characters; required while `send_message` is on.
- `send_message` (boolean, optional) — Whether `message` is sent. Off until you switch it on.

### BusyMessageSettingsUpdate

What a customer waiting for a person is told when nobody has replied in time.

- `message` (string, optional) — Sent once per conversation to a customer waiting for a person while the robot is online, when nobody has replied within `after_seconds`. Up to 500 characters; required while `send_message` is on.
- `send_message` (boolean, optional) — Whether `message` is sent. Off until you switch it on.
- `after_seconds` (integer, optional) — Seconds without a reply before `message` is sent, 30 to 3600.

### WorkingHoursUpdate

When your customer's team is at work. Outside these hours the robot counts as offline, which is what `ai_operator.availability` and the offline message follow.

- `enabled` (boolean, optional) — `false`: every hour is a working hour.
- `time_zone` (string, optional) — An IANA time zone.
- `days` (WorkingHoursUpdateDays, optional) — The days to change, each with its open windows. `[]` closes that day. A day you leave out is not changed.

### AutoCloseSettings

When an idle conversation is closed. A robot that never set it shows the rule actually in force (today, 7 days).

- `enabled` (boolean, required) — `true`: a conversation closes after `idle_minutes` without a message. `false`: it closes after `max_idle_minutes` (15 days). Off never means never.
- `idle_minutes` (integer, required) — Minutes without a message before a conversation closes, 15 to 21600. Kept while `enabled` is `false`, so turning it back on restores it.
- `max_idle_minutes` (integer, required) — The ceiling: always 21600 (15 days). Read-only.

### OperatorHandoverSettings

What the customer is told when the AI hands their conversation to a person.

- `message` (string, required) — Sent once per conversation when the AI hands the conversation to a person, on every channel. Up to 500 characters; required while `send_message` is on.
- `send_message` (boolean, required) — Whether `message` is sent.

### OfflineMessageSettings

What a customer waiting for a person is told while the robot is offline.

- `message` (string, required) — Sent once per conversation to a customer waiting for a person while the robot is offline: outside its working hours. Up to 500 characters; required while `send_message` is on.
- `send_message` (boolean, required) — Whether `message` is sent. Off until you switch it on.

### BusyMessageSettings

What a customer waiting for a person is told when nobody has replied in time.

- `message` (string, required) — Sent once per conversation to a customer waiting for a person while the robot is online, when nobody has replied within `after_seconds`. Up to 500 characters; required while `send_message` is on.
- `send_message` (boolean, required) — Whether `message` is sent. Off until you switch it on.
- `after_seconds` (integer, required) — Seconds without a reply before `message` is sent, 30 to 3600.

### WorkingHours

When your customer's team is at work. Outside these hours the robot counts as offline, which is what `ai_operator.availability` and the offline message follow.

- `enabled` (boolean, required) — `false`: every hour is a working hour.
- `time_zone` (string, required) — An IANA time zone.
- `days` (WorkingHoursDays, required) — Each day's open windows, `SAT` to `FRI`. `[]` means closed that day.

### WorkingHoursUpdateDays

The days to change, each with its open windows. `[]` closes that day. A day you leave out is not changed.

- `SAT` (list of WorkingHoursWindow, optional)
- `SUN` (list of WorkingHoursWindow, optional)
- `MON` (list of WorkingHoursWindow, optional)
- `TUE` (list of WorkingHoursWindow, optional)
- `WED` (list of WorkingHoursWindow, optional)
- `THU` (list of WorkingHoursWindow, optional)
- `FRI` (list of WorkingHoursWindow, optional)

### WorkingHoursDays

Each day's open windows, `SAT` to `FRI`. `[]` means closed that day.

- `SAT` (list of WorkingHoursWindow, optional)
- `SUN` (list of WorkingHoursWindow, optional)
- `MON` (list of WorkingHoursWindow, optional)
- `TUE` (list of WorkingHoursWindow, optional)
- `WED` (list of WorkingHoursWindow, optional)
- `THU` (list of WorkingHoursWindow, optional)
- `FRI` (list of WorkingHoursWindow, optional)

### WorkingHoursWindow

One open interval, local to the schedule's `time_zone`. `HH:MM`, 24-hour, `start` before `end`.

- `start` (string, required) — `HH:MM`.
- `end` (string, required) — `HH:MM`, after `start`.

## Examples

### Change only the auto-close period

**Request**

```json
{
  "settings": {
    "conversations": {
      "auto_close": {
        "idle_minutes": 720
      }
    }
  }
}
```

**Response**

```json
{
  "id": "rbt_8fK2mQ",
  "name": "Rose Flower Shop",
  "external_id": "shop_10422",
  "description": "Flower shop on Instagram",
  "is_active": true,
  "channels": [
    {
      "id": "chn_3pQ7xL",
      "type": "instagram",
      "is_active": true
    }
  ],
  "created_at": "2026-09-20T11:04:33Z",
  "settings": {
    "conversations": {
      "auto_close": {
        "enabled": true,
        "idle_minutes": 720,
        "max_idle_minutes": 21600
      },
      "operator_handover": {
        "message": "An operator will join you shortly.",
        "send_message": true
      },
      "offline": {
        "message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
        "send_message": false
      },
      "busy": {
        "message": "در حال حاضر اپراتورهای ما مشغول هستند. پیام شما ثبت شد و در اولین فرصت پاسخ داده می‌شود.",
        "send_message": false,
        "after_seconds": 300
      },
      "working_hours": {
        "enabled": true,
        "time_zone": "Asia/Tehran",
        "days": {
          "SAT": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "SUN": [
            {
              "start": "09:00",
              "end": "13:00"
            },
            {
              "start": "16:00",
              "end": "20:00"
            }
          ],
          "MON": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "TUE": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "WED": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "THU": [
            {
              "start": "09:00",
              "end": "13:00"
            }
          ],
          "FRI": []
        }
      },
      "offline_message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
      "ai_failure_message": null
    },
    "ai": {
      "enhanced_accuracy": false,
      "creativity": 50,
      "language": "auto",
      "topic": "Flower shop: roses and tulips, delivery inside Tehran only"
    },
    "ai_operator": {
      "enabled": true,
      "display_name": "Rose assistant",
      "start_mode": "on_first_message",
      "availability": "always",
      "wait_minutes": 3
    }
  }
}
```

**SDK Code**

```python Change only the auto-close period
import requests

url = "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

payload = { "settings": { "conversations": { "auto_close": { "idle_minutes": 720 } } } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Change only the auto-close period
const url = 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"settings":{"conversations":{"auto_close":{"idle_minutes":720}}}}'
};

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

```go Change only the auto-close period
package main

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

func main() {

	url := "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

	payload := strings.NewReader("{\n  \"settings\": {\n    \"conversations\": {\n      \"auto_close\": {\n        \"idle_minutes\": 720\n      }\n    }\n  }\n}")

	req, _ := http.NewRequest("PATCH", 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 only the auto-close period
require 'uri'
require 'net/http'

url = URI("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"settings\": {\n    \"conversations\": {\n      \"auto_close\": {\n        \"idle_minutes\": 720\n      }\n    }\n  }\n}"

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

```java Change only the auto-close period
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"settings\": {\n    \"conversations\": {\n      \"auto_close\": {\n        \"idle_minutes\": 720\n      }\n    }\n  }\n}")
  .asString();
```

```php Change only the auto-close period
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ', [
  'body' => '{
  "settings": {
    "conversations": {
      "auto_close": {
        "idle_minutes": 720
      }
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Change only the auto-close period
using RestSharp;

var client = new RestClient("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"settings\": {\n    \"conversations\": {\n      \"auto_close\": {\n        \"idle_minutes\": 720\n      }\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Change only the auto-close period
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["settings": ["conversations": ["auto_close": ["idle_minutes": 720]]]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Turn auto-close off (closes after 15 days)

**Request**

```json
{
  "settings": {
    "conversations": {
      "auto_close": {
        "enabled": false
      }
    }
  }
}
```

**Response**

```json
{
  "id": "rbt_8fK2mQ",
  "name": "Rose Flower Shop",
  "external_id": "shop_10422",
  "description": "Flower shop on Instagram",
  "is_active": true,
  "channels": [
    {
      "id": "chn_3pQ7xL",
      "type": "instagram",
      "is_active": true
    }
  ],
  "created_at": "2026-09-20T11:04:33Z",
  "settings": {
    "conversations": {
      "auto_close": {
        "enabled": false,
        "idle_minutes": 720,
        "max_idle_minutes": 21600
      },
      "operator_handover": {
        "message": "An operator will join you shortly.",
        "send_message": true
      },
      "offline": {
        "message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
        "send_message": false
      },
      "busy": {
        "message": "در حال حاضر اپراتورهای ما مشغول هستند. پیام شما ثبت شد و در اولین فرصت پاسخ داده می‌شود.",
        "send_message": false,
        "after_seconds": 300
      },
      "working_hours": {
        "enabled": true,
        "time_zone": "Asia/Tehran",
        "days": {
          "SAT": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "SUN": [
            {
              "start": "09:00",
              "end": "13:00"
            },
            {
              "start": "16:00",
              "end": "20:00"
            }
          ],
          "MON": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "TUE": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "WED": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "THU": [
            {
              "start": "09:00",
              "end": "13:00"
            }
          ],
          "FRI": []
        }
      },
      "offline_message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
      "ai_failure_message": null
    },
    "ai": {
      "enhanced_accuracy": false,
      "creativity": 50,
      "language": "auto",
      "topic": "Flower shop: roses and tulips, delivery inside Tehran only"
    },
    "ai_operator": {
      "enabled": true,
      "display_name": "Rose assistant",
      "start_mode": "on_first_message",
      "availability": "always",
      "wait_minutes": 3
    }
  }
}
```

**SDK Code**

```python Turn auto-close off (closes after 15 days)
import requests

url = "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

payload = { "settings": { "conversations": { "auto_close": { "enabled": False } } } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Turn auto-close off (closes after 15 days)
const url = 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"settings":{"conversations":{"auto_close":{"enabled":false}}}}'
};

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

```go Turn auto-close off (closes after 15 days)
package main

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

func main() {

	url := "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

	payload := strings.NewReader("{\n  \"settings\": {\n    \"conversations\": {\n      \"auto_close\": {\n        \"enabled\": false\n      }\n    }\n  }\n}")

	req, _ := http.NewRequest("PATCH", 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 Turn auto-close off (closes after 15 days)
require 'uri'
require 'net/http'

url = URI("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"settings\": {\n    \"conversations\": {\n      \"auto_close\": {\n        \"enabled\": false\n      }\n    }\n  }\n}"

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

```java Turn auto-close off (closes after 15 days)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"settings\": {\n    \"conversations\": {\n      \"auto_close\": {\n        \"enabled\": false\n      }\n    }\n  }\n}")
  .asString();
```

```php Turn auto-close off (closes after 15 days)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ', [
  'body' => '{
  "settings": {
    "conversations": {
      "auto_close": {
        "enabled": false
      }
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Turn auto-close off (closes after 15 days)
using RestSharp;

var client = new RestClient("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"settings\": {\n    \"conversations\": {\n      \"auto_close\": {\n        \"enabled\": false\n      }\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Turn auto-close off (closes after 15 days)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["settings": ["conversations": ["auto_close": ["enabled": false]]]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Several settings in one request

**Request**

```json
{
  "name": "Rose Flower Shop (Tehran)",
  "settings": {
    "conversations": {
      "operator_handover": {
        "message": "Connecting you to a person.",
        "send_message": true
      },
      "working_hours": {
        "enabled": true,
        "time_zone": "Asia/Tehran",
        "days": {
          "FRI": [
            {
              "start": "10:00",
              "end": "14:00"
            }
          ]
        }
      }
    },
    "ai_operator": {
      "start_mode": "if_operator_not_respond",
      "availability": "offline",
      "wait_minutes": 5
    }
  }
}
```

**Response**

```json
{
  "id": "rbt_8fK2mQ",
  "name": "Rose Flower Shop (Tehran)",
  "external_id": "shop_10422",
  "description": "Flower shop on Instagram",
  "is_active": true,
  "channels": [
    {
      "id": "chn_3pQ7xL",
      "type": "instagram",
      "is_active": true
    }
  ],
  "created_at": "2026-09-20T11:04:33Z",
  "settings": {
    "conversations": {
      "auto_close": {
        "enabled": true,
        "idle_minutes": 360,
        "max_idle_minutes": 21600
      },
      "operator_handover": {
        "message": "Connecting you to a person.",
        "send_message": true
      },
      "offline": {
        "message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
        "send_message": false
      },
      "busy": {
        "message": "در حال حاضر اپراتورهای ما مشغول هستند. پیام شما ثبت شد و در اولین فرصت پاسخ داده می‌شود.",
        "send_message": false,
        "after_seconds": 300
      },
      "working_hours": {
        "enabled": true,
        "time_zone": "Asia/Tehran",
        "days": {
          "SAT": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "SUN": [
            {
              "start": "09:00",
              "end": "13:00"
            },
            {
              "start": "16:00",
              "end": "20:00"
            }
          ],
          "MON": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "TUE": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "WED": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "THU": [
            {
              "start": "09:00",
              "end": "13:00"
            }
          ],
          "FRI": [
            {
              "start": "10:00",
              "end": "14:00"
            }
          ]
        }
      },
      "offline_message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
      "ai_failure_message": null
    },
    "ai": {
      "enhanced_accuracy": false,
      "creativity": 50,
      "language": "auto",
      "topic": "Flower shop: roses and tulips, delivery inside Tehran only"
    },
    "ai_operator": {
      "enabled": true,
      "display_name": "Rose assistant",
      "start_mode": "if_operator_not_respond",
      "availability": "offline",
      "wait_minutes": 5
    }
  }
}
```

**SDK Code**

```python Several settings in one request
import requests

url = "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

payload = {
    "name": "Rose Flower Shop (Tehran)",
    "settings": {
        "conversations": {
            "operator_handover": {
                "message": "Connecting you to a person.",
                "send_message": True
            },
            "working_hours": {
                "enabled": True,
                "time_zone": "Asia/Tehran",
                "days": { "FRI": [
                        {
                            "start": "10:00",
                            "end": "14:00"
                        }
                    ] }
            }
        },
        "ai_operator": {
            "start_mode": "if_operator_not_respond",
            "availability": "offline",
            "wait_minutes": 5
        }
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Several settings in one request
const url = 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Rose Flower Shop (Tehran)","settings":{"conversations":{"operator_handover":{"message":"Connecting you to a person.","send_message":true},"working_hours":{"enabled":true,"time_zone":"Asia/Tehran","days":{"FRI":[{"start":"10:00","end":"14:00"}]}}},"ai_operator":{"start_mode":"if_operator_not_respond","availability":"offline","wait_minutes":5}}}'
};

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

```go Several settings in one request
package main

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

func main() {

	url := "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

	payload := strings.NewReader("{\n  \"name\": \"Rose Flower Shop (Tehran)\",\n  \"settings\": {\n    \"conversations\": {\n      \"operator_handover\": {\n        \"message\": \"Connecting you to a person.\",\n        \"send_message\": true\n      },\n      \"working_hours\": {\n        \"enabled\": true,\n        \"time_zone\": \"Asia/Tehran\",\n        \"days\": {\n          \"FRI\": [\n            {\n              \"start\": \"10:00\",\n              \"end\": \"14:00\"\n            }\n          ]\n        }\n      }\n    },\n    \"ai_operator\": {\n      \"start_mode\": \"if_operator_not_respond\",\n      \"availability\": \"offline\",\n      \"wait_minutes\": 5\n    }\n  }\n}")

	req, _ := http.NewRequest("PATCH", 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 Several settings in one request
require 'uri'
require 'net/http'

url = URI("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Rose Flower Shop (Tehran)\",\n  \"settings\": {\n    \"conversations\": {\n      \"operator_handover\": {\n        \"message\": \"Connecting you to a person.\",\n        \"send_message\": true\n      },\n      \"working_hours\": {\n        \"enabled\": true,\n        \"time_zone\": \"Asia/Tehran\",\n        \"days\": {\n          \"FRI\": [\n            {\n              \"start\": \"10:00\",\n              \"end\": \"14:00\"\n            }\n          ]\n        }\n      }\n    },\n    \"ai_operator\": {\n      \"start_mode\": \"if_operator_not_respond\",\n      \"availability\": \"offline\",\n      \"wait_minutes\": 5\n    }\n  }\n}"

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

```java Several settings in one request
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Rose Flower Shop (Tehran)\",\n  \"settings\": {\n    \"conversations\": {\n      \"operator_handover\": {\n        \"message\": \"Connecting you to a person.\",\n        \"send_message\": true\n      },\n      \"working_hours\": {\n        \"enabled\": true,\n        \"time_zone\": \"Asia/Tehran\",\n        \"days\": {\n          \"FRI\": [\n            {\n              \"start\": \"10:00\",\n              \"end\": \"14:00\"\n            }\n          ]\n        }\n      }\n    },\n    \"ai_operator\": {\n      \"start_mode\": \"if_operator_not_respond\",\n      \"availability\": \"offline\",\n      \"wait_minutes\": 5\n    }\n  }\n}")
  .asString();
```

```php Several settings in one request
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ', [
  'body' => '{
  "name": "Rose Flower Shop (Tehran)",
  "settings": {
    "conversations": {
      "operator_handover": {
        "message": "Connecting you to a person.",
        "send_message": true
      },
      "working_hours": {
        "enabled": true,
        "time_zone": "Asia/Tehran",
        "days": {
          "FRI": [
            {
              "start": "10:00",
              "end": "14:00"
            }
          ]
        }
      }
    },
    "ai_operator": {
      "start_mode": "if_operator_not_respond",
      "availability": "offline",
      "wait_minutes": 5
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Several settings in one request
using RestSharp;

var client = new RestClient("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Rose Flower Shop (Tehran)\",\n  \"settings\": {\n    \"conversations\": {\n      \"operator_handover\": {\n        \"message\": \"Connecting you to a person.\",\n        \"send_message\": true\n      },\n      \"working_hours\": {\n        \"enabled\": true,\n        \"time_zone\": \"Asia/Tehran\",\n        \"days\": {\n          \"FRI\": [\n            {\n              \"start\": \"10:00\",\n              \"end\": \"14:00\"\n            }\n          ]\n        }\n      }\n    },\n    \"ai_operator\": {\n      \"start_mode\": \"if_operator_not_respond\",\n      \"availability\": \"offline\",\n      \"wait_minutes\": 5\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Several settings in one request
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Rose Flower Shop (Tehran)",
  "settings": [
    "conversations": [
      "operator_handover": [
        "message": "Connecting you to a person.",
        "send_message": true
      ],
      "working_hours": [
        "enabled": true,
        "time_zone": "Asia/Tehran",
        "days": ["FRI": [
            [
              "start": "10:00",
              "end": "14:00"
            ]
          ]]
      ]
    ],
    "ai_operator": [
      "start_mode": "if_operator_not_respond",
      "availability": "offline",
      "wait_minutes": 5
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Change the AI's topic

**Request**

```json
{
  "settings": {
    "ai": {
      "topic": "Flower shop: roses, tulips and orchids, delivery across Iran"
    }
  }
}
```

**Response**

```json
{
  "id": "rbt_8fK2mQ",
  "name": "Rose Flower Shop",
  "external_id": "shop_10422",
  "description": "Flower shop on Instagram",
  "is_active": true,
  "channels": [
    {
      "id": "chn_3pQ7xL",
      "type": "instagram",
      "is_active": true
    }
  ],
  "created_at": "2026-09-20T11:04:33Z",
  "settings": {
    "conversations": {
      "auto_close": {
        "enabled": true,
        "idle_minutes": 360,
        "max_idle_minutes": 21600
      },
      "operator_handover": {
        "message": "An operator will join you shortly.",
        "send_message": true
      },
      "offline": {
        "message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
        "send_message": false
      },
      "busy": {
        "message": "در حال حاضر اپراتورهای ما مشغول هستند. پیام شما ثبت شد و در اولین فرصت پاسخ داده می‌شود.",
        "send_message": false,
        "after_seconds": 300
      },
      "working_hours": {
        "enabled": true,
        "time_zone": "Asia/Tehran",
        "days": {
          "SAT": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "SUN": [
            {
              "start": "09:00",
              "end": "13:00"
            },
            {
              "start": "16:00",
              "end": "20:00"
            }
          ],
          "MON": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "TUE": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "WED": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "THU": [
            {
              "start": "09:00",
              "end": "13:00"
            }
          ],
          "FRI": []
        }
      },
      "offline_message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
      "ai_failure_message": null
    },
    "ai": {
      "enhanced_accuracy": false,
      "creativity": 50,
      "language": "auto",
      "topic": "Flower shop: roses, tulips and orchids, delivery across Iran"
    },
    "ai_operator": {
      "enabled": true,
      "display_name": "Rose assistant",
      "start_mode": "on_first_message",
      "availability": "always",
      "wait_minutes": 3
    }
  }
}
```

**SDK Code**

```python Change the AI's topic
import requests

url = "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

payload = { "settings": { "ai": { "topic": "Flower shop: roses, tulips and orchids, delivery across Iran" } } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Change the AI's topic
const url = 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"settings":{"ai":{"topic":"Flower shop: roses, tulips and orchids, delivery across Iran"}}}'
};

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

```go Change the AI's topic
package main

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

func main() {

	url := "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

	payload := strings.NewReader("{\n  \"settings\": {\n    \"ai\": {\n      \"topic\": \"Flower shop: roses, tulips and orchids, delivery across Iran\"\n    }\n  }\n}")

	req, _ := http.NewRequest("PATCH", 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 AI's topic
require 'uri'
require 'net/http'

url = URI("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"settings\": {\n    \"ai\": {\n      \"topic\": \"Flower shop: roses, tulips and orchids, delivery across Iran\"\n    }\n  }\n}"

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

```java Change the AI's topic
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"settings\": {\n    \"ai\": {\n      \"topic\": \"Flower shop: roses, tulips and orchids, delivery across Iran\"\n    }\n  }\n}")
  .asString();
```

```php Change the AI's topic
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ', [
  'body' => '{
  "settings": {
    "ai": {
      "topic": "Flower shop: roses, tulips and orchids, delivery across Iran"
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Change the AI's topic
using RestSharp;

var client = new RestClient("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"settings\": {\n    \"ai\": {\n      \"topic\": \"Flower shop: roses, tulips and orchids, delivery across Iran\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Change the AI's topic
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["settings": ["ai": ["topic": "Flower shop: roses, tulips and orchids, delivery across Iran"]]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Rename and clear your own id

**Request**

```json
{
  "name": "Tulip Corner",
  "external_id": null,
  "description": null
}
```

**Response**

```json
{
  "id": "rbt_8fK2mQ",
  "name": "Tulip Corner",
  "external_id": null,
  "description": null,
  "is_active": true,
  "channels": [
    {
      "id": "chn_3pQ7xL",
      "type": "instagram",
      "is_active": true
    }
  ],
  "created_at": "2026-09-20T11:04:33Z",
  "settings": {
    "conversations": {
      "auto_close": {
        "enabled": true,
        "idle_minutes": 360,
        "max_idle_minutes": 21600
      },
      "operator_handover": {
        "message": "An operator will join you shortly.",
        "send_message": true
      },
      "offline": {
        "message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
        "send_message": false
      },
      "busy": {
        "message": "در حال حاضر اپراتورهای ما مشغول هستند. پیام شما ثبت شد و در اولین فرصت پاسخ داده می‌شود.",
        "send_message": false,
        "after_seconds": 300
      },
      "working_hours": {
        "enabled": true,
        "time_zone": "Asia/Tehran",
        "days": {
          "SAT": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "SUN": [
            {
              "start": "09:00",
              "end": "13:00"
            },
            {
              "start": "16:00",
              "end": "20:00"
            }
          ],
          "MON": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "TUE": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "WED": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "THU": [
            {
              "start": "09:00",
              "end": "13:00"
            }
          ],
          "FRI": []
        }
      },
      "offline_message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
      "ai_failure_message": null
    },
    "ai": {
      "enhanced_accuracy": false,
      "creativity": 50,
      "language": "auto",
      "topic": "Flower shop: roses and tulips, delivery inside Tehran only"
    },
    "ai_operator": {
      "enabled": true,
      "display_name": "Rose assistant",
      "start_mode": "on_first_message",
      "availability": "always",
      "wait_minutes": 3
    }
  }
}
```

**SDK Code**

```python Rename and clear your own id
import requests

url = "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

payload = {
    "name": "Tulip Corner",
    "external_id": None,
    "description": None
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Rename and clear your own id
const url = 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Tulip Corner","external_id":null,"description":null}'
};

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

```go Rename and clear your own id
package main

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

func main() {

	url := "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

	payload := strings.NewReader("{\n  \"name\": \"Tulip Corner\",\n  \"external_id\": null,\n  \"description\": null\n}")

	req, _ := http.NewRequest("PATCH", 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 Rename and clear your own id
require 'uri'
require 'net/http'

url = URI("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Tulip Corner\",\n  \"external_id\": null,\n  \"description\": null\n}"

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

```java Rename and clear your own id
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Tulip Corner\",\n  \"external_id\": null,\n  \"description\": null\n}")
  .asString();
```

```php Rename and clear your own id
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ', [
  'body' => '{
  "name": "Tulip Corner",
  "external_id": null,
  "description": null
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Rename and clear your own id
using RestSharp;

var client = new RestClient("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Tulip Corner\",\n  \"external_id\": null,\n  \"description\": null\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Rename and clear your own id
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Tulip Corner",
  "external_id": ,
  "description": 
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Deactivate the robot

**Request**

```json
{
  "is_active": false
}
```

**Response**

```json
{
  "id": "rbt_8fK2mQ",
  "name": "Rose Flower Shop",
  "external_id": "shop_10422",
  "description": "Flower shop on Instagram",
  "is_active": false,
  "channels": [
    {
      "id": "chn_3pQ7xL",
      "type": "instagram",
      "is_active": false
    }
  ],
  "created_at": "2026-09-20T11:04:33Z",
  "settings": {
    "conversations": {
      "auto_close": {
        "enabled": true,
        "idle_minutes": 360,
        "max_idle_minutes": 21600
      },
      "operator_handover": {
        "message": "An operator will join you shortly.",
        "send_message": true
      },
      "offline": {
        "message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
        "send_message": false
      },
      "busy": {
        "message": "در حال حاضر اپراتورهای ما مشغول هستند. پیام شما ثبت شد و در اولین فرصت پاسخ داده می‌شود.",
        "send_message": false,
        "after_seconds": 300
      },
      "working_hours": {
        "enabled": true,
        "time_zone": "Asia/Tehran",
        "days": {
          "SAT": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "SUN": [
            {
              "start": "09:00",
              "end": "13:00"
            },
            {
              "start": "16:00",
              "end": "20:00"
            }
          ],
          "MON": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "TUE": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "WED": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "THU": [
            {
              "start": "09:00",
              "end": "13:00"
            }
          ],
          "FRI": []
        }
      },
      "offline_message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
      "ai_failure_message": null
    },
    "ai": {
      "enhanced_accuracy": false,
      "creativity": 50,
      "language": "auto",
      "topic": "Flower shop: roses and tulips, delivery inside Tehran only"
    },
    "ai_operator": {
      "enabled": true,
      "display_name": "Rose assistant",
      "start_mode": "on_first_message",
      "availability": "always",
      "wait_minutes": 3
    }
  }
}
```

**SDK Code**

```python Deactivate the robot
import requests

url = "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

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

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

print(response.json())
```

```javascript Deactivate the robot
const url = 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"is_active":false}'
};

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

```go Deactivate the robot
package main

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

func main() {

	url := "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

	payload := strings.NewReader("{\n  \"is_active\": false\n}")

	req, _ := http.NewRequest("PATCH", 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 Deactivate the robot
require 'uri'
require 'net/http'

url = URI("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")

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

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

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

```java Deactivate the robot
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"is_active\": false\n}")
  .asString();
```

```php Deactivate the robot
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ', [
  'body' => '{
  "is_active": false
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Deactivate the robot
using RestSharp;

var client = new RestClient("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"is_active\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Deactivate the robot
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Offline and busy messages switched on

**Response**

```json
{
  "id": "rbt_8fK2mQ",
  "name": "Rose Flower Shop",
  "external_id": "shop_10422",
  "description": "Flower shop on Instagram",
  "is_active": true,
  "channels": [
    {
      "id": "chn_3pQ7xL",
      "type": "instagram",
      "is_active": true
    }
  ],
  "created_at": "2026-09-20T11:04:33Z",
  "settings": {
    "conversations": {
      "auto_close": {
        "enabled": true,
        "idle_minutes": 360,
        "max_idle_minutes": 21600
      },
      "operator_handover": {
        "message": "An operator will join you shortly.",
        "send_message": true
      },
      "offline": {
        "message": "Our team is offline right now; we will reply when we are back.",
        "send_message": true
      },
      "busy": {
        "message": "در حال حاضر اپراتورهای ما مشغول هستند. پیام شما ثبت شد و در اولین فرصت پاسخ داده می‌شود.",
        "send_message": true,
        "after_seconds": 120
      },
      "working_hours": {
        "enabled": true,
        "time_zone": "Asia/Tehran",
        "days": {
          "SAT": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "SUN": [
            {
              "start": "09:00",
              "end": "13:00"
            },
            {
              "start": "16:00",
              "end": "20:00"
            }
          ],
          "MON": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "TUE": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "WED": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "THU": [
            {
              "start": "09:00",
              "end": "13:00"
            }
          ],
          "FRI": []
        }
      },
      "offline_message": "Our team is offline right now; we will reply when we are back.",
      "ai_failure_message": null
    },
    "ai": {
      "enhanced_accuracy": false,
      "creativity": 50,
      "language": "auto",
      "topic": "Flower shop: roses and tulips, delivery inside Tehran only"
    },
    "ai_operator": {
      "enabled": true,
      "display_name": "Rose assistant",
      "start_mode": "on_first_message",
      "availability": "always",
      "wait_minutes": 3
    }
  }
}
```

**SDK Code**

```python Offline and busy messages switched on
import requests

url = "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

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

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

print(response.json())
```

```javascript Offline and busy messages switched on
const url = 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ';
const options = {method: 'PATCH', 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 Offline and busy messages switched on
package main

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

func main() {

	url := "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

	req, _ := http.NewRequest("PATCH", 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 Offline and busy messages switched on
require 'uri'
require 'net/http'

url = URI("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")

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

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

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

```java Offline and busy messages switched on
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Offline and busy messages switched on
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Offline and busy messages switched on
using RestSharp;

var client = new RestClient("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Offline and busy messages switched on
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Tell waiting customers when the team is offline or busy

**Request**

```json
{
  "settings": {
    "conversations": {
      "offline": {
        "message": "Our team is offline right now; we will reply when we are back.",
        "send_message": true
      },
      "busy": {
        "send_message": true,
        "after_seconds": 120
      }
    }
  }
}
```

**Response**

```json
{
  "id": "rbt_8fK2mQ",
  "name": "Rose Flower Shop",
  "external_id": "shop_10422",
  "description": "Flower shop on Instagram",
  "is_active": true,
  "channels": [
    {
      "id": "chn_3pQ7xL",
      "type": "instagram",
      "is_active": true
    }
  ],
  "created_at": "2026-09-20T11:04:33Z",
  "settings": {
    "conversations": {
      "auto_close": {
        "enabled": true,
        "idle_minutes": 720,
        "max_idle_minutes": 21600
      },
      "operator_handover": {
        "message": "An operator will join you shortly.",
        "send_message": true
      },
      "offline": {
        "message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
        "send_message": false
      },
      "busy": {
        "message": "در حال حاضر اپراتورهای ما مشغول هستند. پیام شما ثبت شد و در اولین فرصت پاسخ داده می‌شود.",
        "send_message": false,
        "after_seconds": 300
      },
      "working_hours": {
        "enabled": true,
        "time_zone": "Asia/Tehran",
        "days": {
          "SAT": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "SUN": [
            {
              "start": "09:00",
              "end": "13:00"
            },
            {
              "start": "16:00",
              "end": "20:00"
            }
          ],
          "MON": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "TUE": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "WED": [
            {
              "start": "09:00",
              "end": "18:00"
            }
          ],
          "THU": [
            {
              "start": "09:00",
              "end": "13:00"
            }
          ],
          "FRI": []
        }
      },
      "offline_message": "در حال حاضر اپراتورهای ما آنلاین نیستند. پیام شما ثبت شد و به‌محض آنلاین شدن اولین اپراتور پاسخ داده می‌شود.",
      "ai_failure_message": null
    },
    "ai": {
      "enhanced_accuracy": false,
      "creativity": 50,
      "language": "auto",
      "topic": "Flower shop: roses and tulips, delivery inside Tehran only"
    },
    "ai_operator": {
      "enabled": true,
      "display_name": "Rose assistant",
      "start_mode": "on_first_message",
      "availability": "always",
      "wait_minutes": 3
    }
  }
}
```

**SDK Code**

```python Tell waiting customers when the team is offline or busy
import requests

url = "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

payload = { "settings": { "conversations": {
            "offline": {
                "message": "Our team is offline right now; we will reply when we are back.",
                "send_message": True
            },
            "busy": {
                "send_message": True,
                "after_seconds": 120
            }
        } } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Tell waiting customers when the team is offline or busy
const url = 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"settings":{"conversations":{"offline":{"message":"Our team is offline right now; we will reply when we are back.","send_message":true},"busy":{"send_message":true,"after_seconds":120}}}}'
};

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

```go Tell waiting customers when the team is offline or busy
package main

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

func main() {

	url := "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ"

	payload := strings.NewReader("{\n  \"settings\": {\n    \"conversations\": {\n      \"offline\": {\n        \"message\": \"Our team is offline right now; we will reply when we are back.\",\n        \"send_message\": true\n      },\n      \"busy\": {\n        \"send_message\": true,\n        \"after_seconds\": 120\n      }\n    }\n  }\n}")

	req, _ := http.NewRequest("PATCH", 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 Tell waiting customers when the team is offline or busy
require 'uri'
require 'net/http'

url = URI("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"settings\": {\n    \"conversations\": {\n      \"offline\": {\n        \"message\": \"Our team is offline right now; we will reply when we are back.\",\n        \"send_message\": true\n      },\n      \"busy\": {\n        \"send_message\": true,\n        \"after_seconds\": 120\n      }\n    }\n  }\n}"

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

```java Tell waiting customers when the team is offline or busy
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"settings\": {\n    \"conversations\": {\n      \"offline\": {\n        \"message\": \"Our team is offline right now; we will reply when we are back.\",\n        \"send_message\": true\n      },\n      \"busy\": {\n        \"send_message\": true,\n        \"after_seconds\": 120\n      }\n    }\n  }\n}")
  .asString();
```

```php Tell waiting customers when the team is offline or busy
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ', [
  'body' => '{
  "settings": {
    "conversations": {
      "offline": {
        "message": "Our team is offline right now; we will reply when we are back.",
        "send_message": true
      },
      "busy": {
        "send_message": true,
        "after_seconds": 120
      }
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Tell waiting customers when the team is offline or busy
using RestSharp;

var client = new RestClient("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"settings\": {\n    \"conversations\": {\n      \"offline\": {\n        \"message\": \"Our team is offline right now; we will reply when we are back.\",\n        \"send_message\": true\n      },\n      \"busy\": {\n        \"send_message\": true,\n        \"after_seconds\": 120\n      }\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Tell waiting customers when the team is offline or busy
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["settings": ["conversations": [
      "offline": [
        "message": "Our team is offline right now; we will reply when we are back.",
        "send_message": true
      ],
      "busy": [
        "send_message": true,
        "after_seconds": 120
      ]
    ]]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```