Pular para o conteúdo principal
PATCH
/
api
/
v1
/
accounts
/
{account_id}
Atualizar conta
curl --request PATCH \
  --url https://airys.chat/api/v1/accounts/{account_id} \
  --header 'Content-Type: application/json' \
  --header 'api_access_token: <api-key>' \
  --data '
{
  "name": "My Account",
  "locale": "en",
  "domain": "example.com",
  "support_email": "support@example.com",
  "auto_resolve_after": 1440,
  "auto_resolve_message": "This conversation has been automatically resolved due to inactivity",
  "auto_resolve_ignore_waiting": false,
  "industry": "Technology",
  "company_size": "50-100",
  "timezone": "UTC"
}
'
import requests

url = "https://airys.chat/api/v1/accounts/{account_id}"

payload = {
"name": "My Account",
"locale": "en",
"domain": "example.com",
"support_email": "support@example.com",
"auto_resolve_after": 1440,
"auto_resolve_message": "This conversation has been automatically resolved due to inactivity",
"auto_resolve_ignore_waiting": False,
"industry": "Technology",
"company_size": "50-100",
"timezone": "UTC"
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My Account',
locale: 'en',
domain: 'example.com',
support_email: 'support@example.com',
auto_resolve_after: 1440,
auto_resolve_message: 'This conversation has been automatically resolved due to inactivity',
auto_resolve_ignore_waiting: false,
industry: 'Technology',
company_size: '50-100',
timezone: 'UTC'
})
};

fetch('https://airys.chat/api/v1/accounts/{account_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://airys.chat/api/v1/accounts/{account_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([
'name' => 'My Account',
'locale' => 'en',
'domain' => 'example.com',
'support_email' => 'support@example.com',
'auto_resolve_after' => 1440,
'auto_resolve_message' => 'This conversation has been automatically resolved due to inactivity',
'auto_resolve_ignore_waiting' => false,
'industry' => 'Technology',
'company_size' => '50-100',
'timezone' => 'UTC'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_access_token: <api-key>"
],
]);

$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://airys.chat/api/v1/accounts/{account_id}"

payload := strings.NewReader("{\n \"name\": \"My Account\",\n \"locale\": \"en\",\n \"domain\": \"example.com\",\n \"support_email\": \"support@example.com\",\n \"auto_resolve_after\": 1440,\n \"auto_resolve_message\": \"This conversation has been automatically resolved due to inactivity\",\n \"auto_resolve_ignore_waiting\": false,\n \"industry\": \"Technology\",\n \"company_size\": \"50-100\",\n \"timezone\": \"UTC\"\n}")

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

req.Header.Add("api_access_token", "<api-key>")
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://airys.chat/api/v1/accounts/{account_id}")
.header("api_access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Account\",\n \"locale\": \"en\",\n \"domain\": \"example.com\",\n \"support_email\": \"support@example.com\",\n \"auto_resolve_after\": 1440,\n \"auto_resolve_message\": \"This conversation has been automatically resolved due to inactivity\",\n \"auto_resolve_ignore_waiting\": false,\n \"industry\": \"Technology\",\n \"company_size\": \"50-100\",\n \"timezone\": \"UTC\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://airys.chat/api/v1/accounts/{account_id}")

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

request = Net::HTTP::Patch.new(url)
request["api_access_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My Account\",\n \"locale\": \"en\",\n \"domain\": \"example.com\",\n \"support_email\": \"support@example.com\",\n \"auto_resolve_after\": 1440,\n \"auto_resolve_message\": \"This conversation has been automatically resolved due to inactivity\",\n \"auto_resolve_ignore_waiting\": false,\n \"industry\": \"Technology\",\n \"company_size\": \"50-100\",\n \"timezone\": \"UTC\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "name": "<string>",
  "locale": "<string>",
  "domain": "<string>",
  "support_email": "<string>",
  "status": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "cache_keys": {},
  "features": {},
  "settings": {
    "auto_resolve_after": 123,
    "auto_resolve_message": "<string>",
    "auto_resolve_ignore_waiting": true
  },
  "custom_attributes": {
    "plan_name": "<string>",
    "subscribed_quantity": 123,
    "subscription_status": "<string>",
    "subscription_ends_on": "2023-12-25",
    "industry": "<string>",
    "company_size": "<string>",
    "timezone": "<string>",
    "logo": "<string>",
    "onboarding_step": "<string>",
    "marked_for_deletion_at": "2023-11-07T05:31:56Z",
    "marked_for_deletion_reason": "<string>"
  }
}
{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}
{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}
{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}

Autorizações

api_access_token
string
header
obrigatório

Este token pode ser obtido visitando a página de perfil ou por meio do console rails. Fornece acesso a endpoints com base nos níveis de permissões do usuário. Este token pode ser salvo por um sistema externo quando o usuário é criado via API, para realizar atividades em nome do usuário.

Parâmetros de caminho

account_id
integer
obrigatório

O ID numérico da conta

Corpo

name
string

Nome da conta

Exemplo:

"My Account"

locale
string

A localidade (locale) da conta

Exemplo:

"en"

domain
string

O domínio da conta

Exemplo:

"example.com"

support_email
string

O e-mail de suporte da conta

Exemplo:

"support@example.com"

auto_resolve_after
integer | null

Resolver conversas automaticamente após minutos especificados

Intervalo obrigatório: 10 <= x <= 1439856
Exemplo:

1440

auto_resolve_message
string | null

Mensagem a ser enviada ao resolver automaticamente

Exemplo:

"This conversation has been automatically resolved due to inactivity"

auto_resolve_ignore_waiting
boolean | null

Se deve ignorar conversas em espera para resolução automática

Exemplo:

false

industry
string

Tipo de setor (indústria)

Exemplo:

"Technology"

company_size
string

Tamanho da empresa

Exemplo:

"50-100"

timezone
string

Fuso horário da conta

Exemplo:

"UTC"

Resposta

Sucesso

id
number

ID da conta

name
string

Nome da conta

locale
string

A localidade (locale) da conta

domain
string

O domínio da conta

support_email
string

O e-mail de suporte da conta

status
string

O status da conta

created_at
string<date-time>

A data de criação da conta

cache_keys
object

Chaves de cache (cache keys) para a conta

features
object

Recursos ativados para a conta

settings
object

Configurações da conta

custom_attributes
object

Atributos personalizados da conta