Bots
Update a bot
Update a bot. Callable by a company admin whose role includes the messaging update permission. A bot’s type cannot be changed. For a response bot, the webhook is updated to match. Returns 400 with the validation errors when the bot or its webhook is invalid.
PUT
/
api
/
v1
/
messaging
/
bots
/
{id}
Update a bot
curl --request PUT \
--url https://api.fluid.app/api/v1/messaging/bots/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bot": {
"description": "Answers questions about paper stock, delivery times, and reorders"
}
}
'import requests
url = "https://api.fluid.app/api/v1/messaging/bots/{id}"
payload = { "bot": { "description": "Answers questions about paper stock, delivery times, and reorders" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bot: {
description: 'Answers questions about paper stock, delivery times, and reorders'
}
})
};
fetch('https://api.fluid.app/api/v1/messaging/bots/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/v1/messaging/bots/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bot' => [
'description' => 'Answers questions about paper stock, delivery times, and reorders'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/v1/messaging/bots/{id}"
payload := strings.NewReader("{\n \"bot\": {\n \"description\": \"Answers questions about paper stock, delivery times, and reorders\"\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(string(body))
}HttpResponse<String> response = Unirest.put("https://api.fluid.app/api/v1/messaging/bots/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bot\": {\n \"description\": \"Answers questions about paper stock, delivery times, and reorders\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/v1/messaging/bots/{id}")
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 \"bot\": {\n \"description\": \"Answers questions about paper stock, delivery times, and reorders\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 3187,
"title": "Paper Order Helper",
"description": "Answers questions about paper stock, delivery times, and reorders",
"type": "ResponseBot",
"image_url": "https://cdn.fluid.app/bots/3187/paper-order-helper.png",
"avatar_background_color": "1565C0",
"avatar_emoji": null,
"archived_at": null,
"recipient": {
"id": 48176,
"discarded_at": null,
"avatar_background": null,
"first_name": "Paper Order Helper",
"last_name": null,
"email": null,
"phone": null,
"blocked": false
},
"conversation": null,
"conversations": [],
"webhook_external_uri": "https://bots.piedpiper.com/fluid/dunder-mifflin/paper-orders",
"webhook_http_method": "post"
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Response
The updated bot.
A messaging bot.
⌘I
Update a bot
curl --request PUT \
--url https://api.fluid.app/api/v1/messaging/bots/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bot": {
"description": "Answers questions about paper stock, delivery times, and reorders"
}
}
'import requests
url = "https://api.fluid.app/api/v1/messaging/bots/{id}"
payload = { "bot": { "description": "Answers questions about paper stock, delivery times, and reorders" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bot: {
description: 'Answers questions about paper stock, delivery times, and reorders'
}
})
};
fetch('https://api.fluid.app/api/v1/messaging/bots/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/v1/messaging/bots/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bot' => [
'description' => 'Answers questions about paper stock, delivery times, and reorders'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/v1/messaging/bots/{id}"
payload := strings.NewReader("{\n \"bot\": {\n \"description\": \"Answers questions about paper stock, delivery times, and reorders\"\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(string(body))
}HttpResponse<String> response = Unirest.put("https://api.fluid.app/api/v1/messaging/bots/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bot\": {\n \"description\": \"Answers questions about paper stock, delivery times, and reorders\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/v1/messaging/bots/{id}")
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 \"bot\": {\n \"description\": \"Answers questions about paper stock, delivery times, and reorders\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 3187,
"title": "Paper Order Helper",
"description": "Answers questions about paper stock, delivery times, and reorders",
"type": "ResponseBot",
"image_url": "https://cdn.fluid.app/bots/3187/paper-order-helper.png",
"avatar_background_color": "1565C0",
"avatar_emoji": null,
"archived_at": null,
"recipient": {
"id": 48176,
"discarded_at": null,
"avatar_background": null,
"first_name": "Paper Order Helper",
"last_name": null,
"email": null,
"phone": null,
"blocked": false
},
"conversation": null,
"conversations": [],
"webhook_external_uri": "https://bots.piedpiper.com/fluid/dunder-mifflin/paper-orders",
"webhook_http_method": "post"
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}