Update custom attribute in Account
curl --request PATCH \
--url https://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attribute_display_name": "Custom Attribute",
"attribute_display_type": 0,
"attribute_description": "This is a custom attribute",
"attribute_key": "custom_attribute",
"attribute_values": [
"value1",
"value2"
],
"attribute_model": 0,
"regex_pattern": "^[a-zA-Z0-9]+$",
"regex_cue": "Please enter a valid value"
}
'import requests
url = "https://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}"
payload = {
"attribute_display_name": "Custom Attribute",
"attribute_display_type": 0,
"attribute_description": "This is a custom attribute",
"attribute_key": "custom_attribute",
"attribute_values": ["value1", "value2"],
"attribute_model": 0,
"regex_pattern": "^[a-zA-Z0-9]+$",
"regex_cue": "Please enter a valid value"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attribute_display_name: 'Custom Attribute',
attribute_display_type: 0,
attribute_description: 'This is a custom attribute',
attribute_key: 'custom_attribute',
attribute_values: ['value1', 'value2'],
attribute_model: 0,
regex_pattern: '^[a-zA-Z0-9]+$',
regex_cue: 'Please enter a valid value'
})
};
fetch('https://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{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://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'attribute_display_name' => 'Custom Attribute',
'attribute_display_type' => 0,
'attribute_description' => 'This is a custom attribute',
'attribute_key' => 'custom_attribute',
'attribute_values' => [
'value1',
'value2'
],
'attribute_model' => 0,
'regex_pattern' => '^[a-zA-Z0-9]+$',
'regex_cue' => 'Please enter a valid value'
]),
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://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}"
payload := strings.NewReader("{\n \"attribute_display_name\": \"Custom Attribute\",\n \"attribute_display_type\": 0,\n \"attribute_description\": \"This is a custom attribute\",\n \"attribute_key\": \"custom_attribute\",\n \"attribute_values\": [\n \"value1\",\n \"value2\"\n ],\n \"attribute_model\": 0,\n \"regex_pattern\": \"^[a-zA-Z0-9]+$\",\n \"regex_cue\": \"Please enter a valid value\"\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(string(body))
}HttpResponse<String> response = Unirest.patch("https://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attribute_display_name\": \"Custom Attribute\",\n \"attribute_display_type\": 0,\n \"attribute_description\": \"This is a custom attribute\",\n \"attribute_key\": \"custom_attribute\",\n \"attribute_values\": [\n \"value1\",\n \"value2\"\n ],\n \"attribute_model\": 0,\n \"regex_pattern\": \"^[a-zA-Z0-9]+$\",\n \"regex_cue\": \"Please enter a valid value\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}")
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 \"attribute_display_name\": \"Custom Attribute\",\n \"attribute_display_type\": 0,\n \"attribute_description\": \"This is a custom attribute\",\n \"attribute_key\": \"custom_attribute\",\n \"attribute_values\": [\n \"value1\",\n \"value2\"\n ],\n \"attribute_model\": 0,\n \"regex_pattern\": \"^[a-zA-Z0-9]+$\",\n \"regex_cue\": \"Please enter a valid value\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"attribute_display_name": "<string>",
"attribute_display_type": "<string>",
"attribute_description": "<string>",
"attribute_key": "<string>",
"regex_pattern": "<string>",
"regex_cue": "<string>",
"attribute_values": "<string>",
"attribute_model": "<string>",
"default_value": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Custom Attributes
Update custom attribute in Account
Update a custom attribute in account
PATCH
/
api
/
v1
/
accounts
/
{account_id}
/
custom_attribute_definitions
/
{id}
Update custom attribute in Account
curl --request PATCH \
--url https://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attribute_display_name": "Custom Attribute",
"attribute_display_type": 0,
"attribute_description": "This is a custom attribute",
"attribute_key": "custom_attribute",
"attribute_values": [
"value1",
"value2"
],
"attribute_model": 0,
"regex_pattern": "^[a-zA-Z0-9]+$",
"regex_cue": "Please enter a valid value"
}
'import requests
url = "https://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}"
payload = {
"attribute_display_name": "Custom Attribute",
"attribute_display_type": 0,
"attribute_description": "This is a custom attribute",
"attribute_key": "custom_attribute",
"attribute_values": ["value1", "value2"],
"attribute_model": 0,
"regex_pattern": "^[a-zA-Z0-9]+$",
"regex_cue": "Please enter a valid value"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attribute_display_name: 'Custom Attribute',
attribute_display_type: 0,
attribute_description: 'This is a custom attribute',
attribute_key: 'custom_attribute',
attribute_values: ['value1', 'value2'],
attribute_model: 0,
regex_pattern: '^[a-zA-Z0-9]+$',
regex_cue: 'Please enter a valid value'
})
};
fetch('https://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{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://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'attribute_display_name' => 'Custom Attribute',
'attribute_display_type' => 0,
'attribute_description' => 'This is a custom attribute',
'attribute_key' => 'custom_attribute',
'attribute_values' => [
'value1',
'value2'
],
'attribute_model' => 0,
'regex_pattern' => '^[a-zA-Z0-9]+$',
'regex_cue' => 'Please enter a valid value'
]),
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://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}"
payload := strings.NewReader("{\n \"attribute_display_name\": \"Custom Attribute\",\n \"attribute_display_type\": 0,\n \"attribute_description\": \"This is a custom attribute\",\n \"attribute_key\": \"custom_attribute\",\n \"attribute_values\": [\n \"value1\",\n \"value2\"\n ],\n \"attribute_model\": 0,\n \"regex_pattern\": \"^[a-zA-Z0-9]+$\",\n \"regex_cue\": \"Please enter a valid value\"\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(string(body))
}HttpResponse<String> response = Unirest.patch("https://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attribute_display_name\": \"Custom Attribute\",\n \"attribute_display_type\": 0,\n \"attribute_description\": \"This is a custom attribute\",\n \"attribute_key\": \"custom_attribute\",\n \"attribute_values\": [\n \"value1\",\n \"value2\"\n ],\n \"attribute_model\": 0,\n \"regex_pattern\": \"^[a-zA-Z0-9]+$\",\n \"regex_cue\": \"Please enter a valid value\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://chat.chatclean.com.br/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}")
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 \"attribute_display_name\": \"Custom Attribute\",\n \"attribute_display_type\": 0,\n \"attribute_description\": \"This is a custom attribute\",\n \"attribute_key\": \"custom_attribute\",\n \"attribute_values\": [\n \"value1\",\n \"value2\"\n ],\n \"attribute_model\": 0,\n \"regex_pattern\": \"^[a-zA-Z0-9]+$\",\n \"regex_cue\": \"Please enter a valid value\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"attribute_display_name": "<string>",
"attribute_display_type": "<string>",
"attribute_description": "<string>",
"attribute_key": "<string>",
"regex_pattern": "<string>",
"regex_cue": "<string>",
"attribute_values": "<string>",
"attribute_model": "<string>",
"default_value": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Authorizations
userBearerAuthuserApiKey
Path Parameters
Body
application/json
Response
Success

