Adicionar unidade a um grupo
Adiciona uma unidade a um grupo.
POST
/
api
/
v2
/
empresa
/
company
/
group
/
add
cURL
curl --request POST \
--url https://api.sults.com.br/api/v2/empresa/company/group/add \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"companyId": 12,
"groupId": 4
}'import requests
url = "https://api.sults.com.br/api/v2/empresa/company/group/add"
payload = {
"companyId": 12,
"groupId": 4
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json",
}
resposta = requests.post(url, json=payload, headers=headers)
print(resposta.status_code)
print(resposta.text)const resposta = await fetch("https://api.sults.com.br/api/v2/empresa/company/group/add", {
method: "POST",
headers: {
Authorization: "<api-key>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"companyId": 12,
"groupId": 4
}),
});
console.log(resposta.status, await resposta.text());<?php
$corpo = <<<'JSON'
{
"companyId": 12,
"groupId": 4
}
JSON;
$ch = curl_init("https://api.sults.com.br/api/v2/empresa/company/group/add");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: <api-key>",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $corpo);
$resposta = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status . PHP_EOL . $resposta . PHP_EOL;using System.Net.Http;
using System.Text;
var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "<api-key>");
var corpo = """
{
"companyId": 12,
"groupId": 4
}
""";
var resposta = await http.PostAsync(
"https://api.sults.com.br/api/v2/empresa/company/group/add",
new StringContent(corpo, Encoding.UTF8, "application/json"));
Console.WriteLine((int)resposta.StatusCode);
Console.WriteLine(await resposta.Content.ReadAsStringAsync());No body{
"error": "'groupId' is required.",
"dateTime": "2026-11-13T14:20:00Z"
}{
"error": "Acesso não autorizado."
}{
"error": "Unauthorized",
"dateTime": "2026-11-13T14:20:00Z"
}{
"error": "Not Found",
"dateTime": "2026-11-13T14:20:00Z"
}<string>{
"error": "Internal Server Error",
"dateTime": "2026-11-13T14:20:00Z"
}Authorizations
Body
application/json
Response
Unidade adicionada ao grupo, sem corpo adicional.
A resposta não tem corpo.
Was this page helpful?
⌘I
cURL
curl --request POST \
--url https://api.sults.com.br/api/v2/empresa/company/group/add \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"companyId": 12,
"groupId": 4
}'import requests
url = "https://api.sults.com.br/api/v2/empresa/company/group/add"
payload = {
"companyId": 12,
"groupId": 4
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json",
}
resposta = requests.post(url, json=payload, headers=headers)
print(resposta.status_code)
print(resposta.text)const resposta = await fetch("https://api.sults.com.br/api/v2/empresa/company/group/add", {
method: "POST",
headers: {
Authorization: "<api-key>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"companyId": 12,
"groupId": 4
}),
});
console.log(resposta.status, await resposta.text());<?php
$corpo = <<<'JSON'
{
"companyId": 12,
"groupId": 4
}
JSON;
$ch = curl_init("https://api.sults.com.br/api/v2/empresa/company/group/add");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: <api-key>",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $corpo);
$resposta = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status . PHP_EOL . $resposta . PHP_EOL;using System.Net.Http;
using System.Text;
var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "<api-key>");
var corpo = """
{
"companyId": 12,
"groupId": 4
}
""";
var resposta = await http.PostAsync(
"https://api.sults.com.br/api/v2/empresa/company/group/add",
new StringContent(corpo, Encoding.UTF8, "application/json"));
Console.WriteLine((int)resposta.StatusCode);
Console.WriteLine(await resposta.Content.ReadAsStringAsync());No body{
"error": "'groupId' is required.",
"dateTime": "2026-11-13T14:20:00Z"
}{
"error": "Acesso não autorizado."
}{
"error": "Unauthorized",
"dateTime": "2026-11-13T14:20:00Z"
}{
"error": "Not Found",
"dateTime": "2026-11-13T14:20:00Z"
}<string>{
"error": "Internal Server Error",
"dateTime": "2026-11-13T14:20:00Z"
}