Organizações
Update an organization
Atualiza os campos enviados. customFields é mesclado com os campos já salvos. Organizações excluídas não podem ser alteradas.
PATCH
/
v1
/
organizations
/
{id}
Update an organization
curl --request PATCH \
--url https://platform.kinbox.com.br/v1/organizations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"legalName": "<string>",
"avatar": "<string>",
"cnpj": "<string>",
"website": "<string>",
"phone": "<string>",
"email": "<string>",
"address": {
"street": "<string>",
"number": "<string>",
"complement": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"segment": "<string>",
"description": "<string>",
"customFields": {},
"operatorId": 123
}
'import requests
url = "https://platform.kinbox.com.br/v1/organizations/{id}"
payload = {
"name": "<string>",
"legalName": "<string>",
"avatar": "<string>",
"cnpj": "<string>",
"website": "<string>",
"phone": "<string>",
"email": "<string>",
"address": {
"street": "<string>",
"number": "<string>",
"complement": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"segment": "<string>",
"description": "<string>",
"customFields": {},
"operatorId": 123
}
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({
name: '<string>',
legalName: '<string>',
avatar: '<string>',
cnpj: '<string>',
website: '<string>',
phone: '<string>',
email: '<string>',
address: {
street: '<string>',
number: '<string>',
complement: '<string>',
district: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
},
segment: '<string>',
description: '<string>',
customFields: {},
operatorId: 123
})
};
fetch('https://platform.kinbox.com.br/v1/organizations/{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://platform.kinbox.com.br/v1/organizations/{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' => '<string>',
'legalName' => '<string>',
'avatar' => '<string>',
'cnpj' => '<string>',
'website' => '<string>',
'phone' => '<string>',
'email' => '<string>',
'address' => [
'street' => '<string>',
'number' => '<string>',
'complement' => '<string>',
'district' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>'
],
'segment' => '<string>',
'description' => '<string>',
'customFields' => [
],
'operatorId' => 123
]),
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://platform.kinbox.com.br/v1/organizations/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"legalName\": \"<string>\",\n \"avatar\": \"<string>\",\n \"cnpj\": \"<string>\",\n \"website\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"complement\": \"<string>\",\n \"district\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"segment\": \"<string>\",\n \"description\": \"<string>\",\n \"customFields\": {},\n \"operatorId\": 123\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://platform.kinbox.com.br/v1/organizations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"legalName\": \"<string>\",\n \"avatar\": \"<string>\",\n \"cnpj\": \"<string>\",\n \"website\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"complement\": \"<string>\",\n \"district\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"segment\": \"<string>\",\n \"description\": \"<string>\",\n \"customFields\": {},\n \"operatorId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.kinbox.com.br/v1/organizations/{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 \"name\": \"<string>\",\n \"legalName\": \"<string>\",\n \"avatar\": \"<string>\",\n \"cnpj\": \"<string>\",\n \"website\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"complement\": \"<string>\",\n \"district\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"segment\": \"<string>\",\n \"description\": \"<string>\",\n \"customFields\": {},\n \"operatorId\": 123\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"id": 42,
"workspaceId": 123,
"legalName": "<string>",
"avatar": "<string>",
"cnpj": "<string>",
"website": "<string>",
"domain": "<string>",
"phone": "<string>",
"email": "<string>",
"address": {
"street": "<string>",
"number": "<string>",
"complement": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"segment": "<string>",
"description": "<string>",
"customFields": {},
"deletedAt": "2023-11-07T05:31:56Z",
"contactsCount": 123,
"operatorId": 123
}Authorizations
Body
application/json
Response
200 - application/json
⌘I
Update an organization
curl --request PATCH \
--url https://platform.kinbox.com.br/v1/organizations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"legalName": "<string>",
"avatar": "<string>",
"cnpj": "<string>",
"website": "<string>",
"phone": "<string>",
"email": "<string>",
"address": {
"street": "<string>",
"number": "<string>",
"complement": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"segment": "<string>",
"description": "<string>",
"customFields": {},
"operatorId": 123
}
'import requests
url = "https://platform.kinbox.com.br/v1/organizations/{id}"
payload = {
"name": "<string>",
"legalName": "<string>",
"avatar": "<string>",
"cnpj": "<string>",
"website": "<string>",
"phone": "<string>",
"email": "<string>",
"address": {
"street": "<string>",
"number": "<string>",
"complement": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"segment": "<string>",
"description": "<string>",
"customFields": {},
"operatorId": 123
}
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({
name: '<string>',
legalName: '<string>',
avatar: '<string>',
cnpj: '<string>',
website: '<string>',
phone: '<string>',
email: '<string>',
address: {
street: '<string>',
number: '<string>',
complement: '<string>',
district: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
},
segment: '<string>',
description: '<string>',
customFields: {},
operatorId: 123
})
};
fetch('https://platform.kinbox.com.br/v1/organizations/{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://platform.kinbox.com.br/v1/organizations/{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' => '<string>',
'legalName' => '<string>',
'avatar' => '<string>',
'cnpj' => '<string>',
'website' => '<string>',
'phone' => '<string>',
'email' => '<string>',
'address' => [
'street' => '<string>',
'number' => '<string>',
'complement' => '<string>',
'district' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>'
],
'segment' => '<string>',
'description' => '<string>',
'customFields' => [
],
'operatorId' => 123
]),
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://platform.kinbox.com.br/v1/organizations/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"legalName\": \"<string>\",\n \"avatar\": \"<string>\",\n \"cnpj\": \"<string>\",\n \"website\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"complement\": \"<string>\",\n \"district\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"segment\": \"<string>\",\n \"description\": \"<string>\",\n \"customFields\": {},\n \"operatorId\": 123\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://platform.kinbox.com.br/v1/organizations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"legalName\": \"<string>\",\n \"avatar\": \"<string>\",\n \"cnpj\": \"<string>\",\n \"website\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"complement\": \"<string>\",\n \"district\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"segment\": \"<string>\",\n \"description\": \"<string>\",\n \"customFields\": {},\n \"operatorId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.kinbox.com.br/v1/organizations/{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 \"name\": \"<string>\",\n \"legalName\": \"<string>\",\n \"avatar\": \"<string>\",\n \"cnpj\": \"<string>\",\n \"website\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"complement\": \"<string>\",\n \"district\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"segment\": \"<string>\",\n \"description\": \"<string>\",\n \"customFields\": {},\n \"operatorId\": 123\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"id": 42,
"workspaceId": 123,
"legalName": "<string>",
"avatar": "<string>",
"cnpj": "<string>",
"website": "<string>",
"domain": "<string>",
"phone": "<string>",
"email": "<string>",
"address": {
"street": "<string>",
"number": "<string>",
"complement": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"segment": "<string>",
"description": "<string>",
"customFields": {},
"deletedAt": "2023-11-07T05:31:56Z",
"contactsCount": 123,
"operatorId": 123
}