https://api.atys.pro/api/v1/crm/,
respondem JSON e têm contrato estável: mudanças incompatíveis só entram numa versão nova.
Como funciona
Tudo o que a equipe faz no CRM da Atys também pode ser feito pela API: montar o funil, criar e mover negócios, registrar notas e tarefas, transferir entre pipelines, agendar mensagens e consultar os relatórios. Cada chamada passa pelas mesmas regras da plataforma: o histórico do negócio registra a ação, as automações disparam e os webhooks são enviados.
A página segue a ordem em que o CRM é usado:
- Conhecer o funil — pipelines, etapas e campos e os catálogos com os ids que as outras chamadas pedem.
- Configurar o funil — tipos, pipelines, etapas, campos, etiquetas, motivos de perda e gatilhos.
- Trabalhar os negócios — criar, listar, editar, mover, ganhar ou perder, arquivar.
- Acompanhar — notas, tarefas e histórico.
- Operações avançadas — transferir, clonar, associar a outros pipelines, importar em lote, agendar mensagens, documentos e anexos.
- Analisar — relatórios e indicadores do funil.
Autenticação e permissões
Use uma chave de API com as permissões de CRM que a integração precisa:
| Permissão da chave | Libera |
|---|---|
| Consultar CRM | Todos os GET: pipelines, catálogos, negócios, notas, tarefas, histórico, agendamentos, documentos e relatórios. |
| Configurar o CRM | Criar, editar e excluir pipelines, etapas, tarefas padrão, campos, etiquetas, motivos de perda e gatilhos. |
| Criar, editar e mover negócios do CRM | Tudo o que muda negócios e o acompanhamento deles: criar, editar, mover, ganhar/perder, arquivar, transferir, clonar, importar, notas, tarefas, agendamentos e documentos. |
| Excluir negócios do CRM | DELETE de negócio. Separada de propósito: só dê se a integração realmente exclui. |
A chave enxerga os mesmos pipelines e negócios que o usuário API enxerga na plataforma, e só faz o que as permissões dele permitem. Para listar negócios de outros responsáveis ou sem responsável, dê ao usuário API as permissões Ver negócios de outro responsável e Ver negócios sem responsável.
Consultar pipelines, etapas e campos
O ponto de partida de toda integração: os ids das etapas e dos campos personalizados vêm daqui.
As etapas vêm em ordem; is_won e is_lost marcam as etapas de ganho e de perda.
Os custom_fields são os campos que o negócio pode ter nesse pipeline (o "Valor" do negócio
é um deles). A chave só vê os pipelines a que o usuário API tem acesso.
Exemplos de código — listar pipelines com etapas e campos
curl "https://api.atys.pro/api/v1/crm/pipelines" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/pipelines',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/pipelines', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/pipelines", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 12,
"name": "Vendas B2B",
"description": "Funil comercial",
"stages": [
{
"id": 101,
"name": "Novo",
"order": 1,
"color": "#3283c5",
"is_won": false,
"is_lost": false
},
{
"id": 102,
"name": "Proposta",
"order": 2,
"color": "#f59e0b",
"is_won": false,
"is_lost": false
},
{
"id": 103,
"name": "Ganho",
"order": 3,
"color": "#10b981",
"is_won": true,
"is_lost": false
},
{
"id": 104,
"name": "Perdido",
"order": 4,
"color": "#ef4444",
"is_won": false,
"is_lost": true
}
],
"custom_fields": [
{
"id": 55,
"name": "Valor",
"type": "number",
"options": null,
"mandatory": false
}
]
}
]
}
Etiquetas, usuários, origens e prioridades
Os ids que criar e editar negócio pedem. As etiquetas são as
que o usuário API pode usar na tela; uma etiqueta fora dessa lista é recusada com invalid_tag.
Os usuários são os ativos da empresa (para owner_ids e assignee_id).
Exemplos de código — etiquetas de negócio (tag_ids)
curl "https://api.atys.pro/api/v1/crm/tags" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/tags', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/tags',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/tags');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/tags', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/tags", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 9,
"name": "VIP",
"description": null,
"color": "#f59e0b"
}
]
}
Exemplos de código — usuários da empresa (owner_ids, assignee_id)
curl "https://api.atys.pro/api/v1/crm/users" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/users', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/users',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/users');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/users', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/users", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 77,
"name": "Carlos Vendedor",
"email": "carlos@empresa.com"
}
]
}
Exemplos de código — origens do negócio (source_id)
curl "https://api.atys.pro/api/v1/crm/sources" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/sources', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/sources',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/sources');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/sources', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/sources", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 1,
"name": "Manual",
"description": null
},
{
"id": 3,
"name": "Site",
"description": null
}
]
}
Exemplos de código — prioridades (priority_id)
curl "https://api.atys.pro/api/v1/crm/priorities" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/priorities', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/priorities',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/priorities');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/priorities', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/priorities", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 1,
"name": "Baixa",
"description": null
},
{
"id": 2,
"name": "Média",
"description": null
},
{
"id": 3,
"name": "Alta",
"description": null
}
]
}
Motivos de perda
Use o id em perder ou ao mover para uma etapa de perda.
Exemplos de código — listar motivos de perda
curl "https://api.atys.pro/api/v1/crm/lost-reasons" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/lost-reasons', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/lost-reasons',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/lost-reasons');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/lost-reasons', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/lost-reasons", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 4,
"name": "Preço",
"description": null
},
{
"id": 5,
"name": "Concorrente",
"description": null
}
]
}
404.
Tipos de pipeline
Todo pipeline pertence a um tipo da empresa (Vendas, Pós-venda, Suporte…). O tipo nasce de um modelo
(base_type_id, veja a lista em GET /pipeline-base-types): ao criar um pipeline,
as etapas padrão vêm do modelo. O modelo 1 — Funil de Vendas ainda cria as etapas
obrigatórias Lead novo, Ganho e Perdido e os campos obrigatórios
Valor do Negócio e Data de conversão para cliente. Sem base_type_id, o tipo
é 18 — Customizado. O nome não pode se repetir na empresa, e um tipo com pipelines não é excluído.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string (100) | Sim | Nome do tipo, único na empresa. |
description | string (200) | Não | Descrição curta. |
group | string (100) | Não | Agrupamento na tela; default o grupo do modelo. Só na criação. |
base_type_id | integer | Não | Modelo de origem; default 18 (Customizado). Só na criação. |
Exemplos de código — listar tipos de pipeline
curl "https://api.atys.pro/api/v1/crm/pipeline-types" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/pipeline-types', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/pipeline-types',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipeline-types');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/pipeline-types', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/pipeline-types", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 3,
"name": "Vendas",
"description": "Funil comercial",
"group": "Comercial e Cliente",
"order": 1,
"base_type": {
"id": 1,
"name": "Funil de Vendas"
}
}
]
}
Exemplos de código — modelos de tipo de pipeline
curl "https://api.atys.pro/api/v1/crm/pipeline-base-types" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/pipeline-base-types', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/pipeline-base-types',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipeline-base-types');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/pipeline-base-types', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/pipeline-base-types", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 1,
"name": "Funil de Vendas",
"group": "Comercial e Cliente",
"description": null
},
{
"id": 18,
"name": "Customizado",
"group": "Customizado",
"description": null
}
]
}
Exemplos de código — criar tipo de pipeline
curl -X POST "https://api.atys.pro/api/v1/crm/pipeline-types" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Vendas",
"description": "Funil comercial",
"base_type_id": 1
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/pipeline-types', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Vendas",
"description": "Funil comercial",
"base_type_id": 1
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/pipeline-types',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'Vendas',
'description': 'Funil comercial',
'base_type_id': 1
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipeline-types');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Vendas',
'description' => 'Funil comercial',
'base_type_id' => 1
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/pipeline-types', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'Vendas',
'description' => 'Funil comercial',
'base_type_id' => 1
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Vendas",
"description": "Funil comercial",
"base_type_id": 1
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/pipeline-types", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 3,
"name": "Vendas",
"description": "Funil comercial",
"group": "Comercial e Cliente",
"order": 1,
"base_type": {
"id": 1,
"name": "Funil de Vendas"
}
}
}
Exemplos de código — editar tipo de pipeline
curl -X PATCH "https://api.atys.pro/api/v1/crm/pipeline-types/3" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Vendas B2B"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/pipeline-types/3', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Vendas B2B"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/pipeline-types/3',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'Vendas B2B'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipeline-types/3');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Vendas B2B'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/pipeline-types/3', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'Vendas B2B'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Vendas B2B"
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/pipeline-types/3", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 3,
"name": "Vendas B2B",
"description": "Funil comercial",
"group": "Comercial e Cliente",
"order": 1,
"base_type": {
"id": 1,
"name": "Funil de Vendas"
}
}
}
Reordenar recebe todos os tipos da empresa, na ordem nova; faltou ou sobrou um id, invalid_order.
Exemplos de código — reordenar tipos de pipeline
curl -X POST "https://api.atys.pro/api/v1/crm/pipeline-types/reorder" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"ids": [5, 3]
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/pipeline-types/reorder', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"ids": [5, 3]
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/pipeline-types/reorder',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'ids': [5, 3]
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipeline-types/reorder');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'ids' => [5, 3]
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/pipeline-types/reorder', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'ids' => [5, 3]
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"ids": [5, 3]
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/pipeline-types/reorder", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 5,
"name": "Pós-venda",
"description": "Funil comercial",
"group": "Comercial e Cliente",
"order": 1,
"base_type": {
"id": 1,
"name": "Funil de Vendas"
}
},
{
"id": 3,
"name": "Vendas",
"description": "Funil comercial",
"group": "Comercial e Cliente",
"order": 2,
"base_type": {
"id": 1,
"name": "Funil de Vendas"
}
}
]
}
Exemplos de código — excluir tipo de pipeline
curl -X DELETE "https://api.atys.pro/api/v1/crm/pipeline-types/5" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/pipeline-types/5', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/pipeline-types/5',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipeline-types/5');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/pipeline-types/5', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/pipeline-types/5", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Criar e editar pipelines
Ao criar, o usuário API e os administradores da empresa entram na equipe do pipeline, e as etapas padrão
do tipo são criadas (create_default_stages: false cria só as obrigatórias do funil de vendas).
Duplicar copia etapas, campos, tarefas padrão, obrigatórios por etapa, equipe e etiquetas — sem os negócios.
Arquivar tira o pipeline da lista GET /pipelines e do kanban; só um pipeline arquivado pode ser
excluído (pipeline_not_archived).
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string (100) | Sim | Nome do pipeline. |
type_id | integer | Sim | Tipo de pipeline da empresa (tipos). |
description | string (200) | Não | Descrição curta. |
create_default_stages | boolean | Não | Default true. Só na criação. |
Exemplos de código — ver pipeline (inclusive arquivado)
curl "https://api.atys.pro/api/v1/crm/pipelines/12" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/pipelines/12',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/pipelines/12', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/pipelines/12", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 12,
"name": "Vendas B2B",
"description": "Funil comercial",
"stages": [
{
"id": 101,
"pipeline_id": 12,
"name": "Lead novo",
"description": "Lead novo",
"color": "#1976d2",
"order": 1,
"max_days_in_stage": null,
"is_won": false,
"is_lost": false,
"is_protected": true
},
{
"id": 102,
"pipeline_id": 12,
"name": "Ganho",
"description": "Ganho",
"color": "#4caf50",
"order": 2,
"max_days_in_stage": null,
"is_won": true,
"is_lost": false,
"is_protected": true
},
{
"id": 103,
"pipeline_id": 12,
"name": "Perdido",
"description": "Perdido",
"color": "#f44336",
"order": 3,
"max_days_in_stage": null,
"is_won": false,
"is_lost": true,
"is_protected": true
}
],
"custom_fields": [
{
"id": 55,
"pipeline_id": 12,
"name": "Valor do Negócio",
"type": "price",
"description": "Valor do Negócio",
"options": null,
"order": 1,
"mandatory": true
},
{
"id": 56,
"pipeline_id": 12,
"name": "Data de conversão para cliente",
"type": "date",
"description": "Data em que o lead foi convertido em cliente.",
"options": null,
"order": 2,
"mandatory": true
}
],
"type_id": 3,
"archived": false
}
}
Exemplos de código — criar pipeline
curl -X POST "https://api.atys.pro/api/v1/crm/pipelines" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Vendas B2B",
"description": "Funil comercial",
"type_id": 3,
"create_default_stages": false
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Vendas B2B",
"description": "Funil comercial",
"type_id": 3,
"create_default_stages": false
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/pipelines',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'Vendas B2B',
'description': 'Funil comercial',
'type_id': 3,
'create_default_stages': False
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Vendas B2B',
'description' => 'Funil comercial',
'type_id' => 3,
'create_default_stages' => false
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/pipelines', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'Vendas B2B',
'description' => 'Funil comercial',
'type_id' => 3,
'create_default_stages' => false
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Vendas B2B",
"description": "Funil comercial",
"type_id": 3,
"create_default_stages": false
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/pipelines", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 12,
"name": "Vendas B2B",
"description": "Funil comercial",
"stages": [
{
"id": 101,
"pipeline_id": 12,
"name": "Lead novo",
"description": "Lead novo",
"color": "#1976d2",
"order": 1,
"max_days_in_stage": null,
"is_won": false,
"is_lost": false,
"is_protected": true
},
{
"id": 102,
"pipeline_id": 12,
"name": "Ganho",
"description": "Ganho",
"color": "#4caf50",
"order": 2,
"max_days_in_stage": null,
"is_won": true,
"is_lost": false,
"is_protected": true
},
{
"id": 103,
"pipeline_id": 12,
"name": "Perdido",
"description": "Perdido",
"color": "#f44336",
"order": 3,
"max_days_in_stage": null,
"is_won": false,
"is_lost": true,
"is_protected": true
}
],
"custom_fields": [
{
"id": 55,
"pipeline_id": 12,
"name": "Valor do Negócio",
"type": "price",
"description": "Valor do Negócio",
"options": null,
"order": 1,
"mandatory": true
},
{
"id": 56,
"pipeline_id": 12,
"name": "Data de conversão para cliente",
"type": "date",
"description": "Data em que o lead foi convertido em cliente.",
"options": null,
"order": 2,
"mandatory": true
}
],
"type_id": 3,
"archived": false
}
}
Exemplos de código — editar pipeline
curl -X PATCH "https://api.atys.pro/api/v1/crm/pipelines/12" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Vendas B2B 2027"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Vendas B2B 2027"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/pipelines/12',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'Vendas B2B 2027'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Vendas B2B 2027'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/pipelines/12', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'Vendas B2B 2027'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Vendas B2B 2027"
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/pipelines/12", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 12,
"name": "Vendas B2B 2027",
"description": "Funil comercial",
"type_id": 3,
"archived": false,
"stages": "…",
"custom_fields": "…"
}
}
Exemplos de código — duplicar pipeline
curl -X POST "https://api.atys.pro/api/v1/crm/pipelines/12/duplicate" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Vendas B2B (cópia)"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/duplicate', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Vendas B2B (cópia)"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/pipelines/12/duplicate',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'Vendas B2B (cópia)'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/duplicate');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Vendas B2B (cópia)'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/pipelines/12/duplicate', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'Vendas B2B (cópia)'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Vendas B2B (cópia)"
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/pipelines/12/duplicate", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 13,
"name": "Vendas B2B (cópia)",
"description": "Funil comercial",
"type_id": 3,
"archived": false,
"stages": "…",
"custom_fields": "…"
}
}
Exemplos de código — arquivar pipeline
curl -X POST "https://api.atys.pro/api/v1/crm/pipelines/12/archive" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/archive', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/pipelines/12/archive',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/archive');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/pipelines/12/archive', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/pipelines/12/archive", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 12,
"name": "Vendas B2B",
"archived": true,
"…": "…"
}
}
Exemplos de código — desarquivar pipeline
curl -X POST "https://api.atys.pro/api/v1/crm/pipelines/12/unarchive" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/unarchive', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/pipelines/12/unarchive',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/unarchive');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/pipelines/12/unarchive', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/pipelines/12/unarchive", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 12,
"name": "Vendas B2B",
"archived": false,
"…": "…"
}
}
Exemplos de código — excluir pipeline arquivado
curl -X DELETE "https://api.atys.pro/api/v1/crm/pipelines/12" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/pipelines/12',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/pipelines/12', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/pipelines/12", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Equipe e etiquetas do pipeline
A equipe é quem vê o pipeline no CRM. O PUT substitui a lista inteira e precisa
manter pelo menos um gestor ou administrador; só um administrador da empresa altera a equipe. As etiquetas do
pipeline são as etiquetas de negócio sugeridas nele (PUT com [] limpa).
PUT o deixar de fora, o pipeline some de GET /crm/pipelines e ele e os negócios
dele passam a responder 404 para a chave. O id do usuário API aparece no GET da equipe
abaixo (o catálogo de usuários lista só as pessoas da empresa). Comece sempre pelo
GET e envie a lista atual com as mudanças.
Exemplos de código — equipe do pipeline
curl "https://api.atys.pro/api/v1/crm/pipelines/12/users" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/users', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/pipelines/12/users',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/users');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/pipelines/12/users', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/pipelines/12/users", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 77,
"name": "Carlos Vendedor",
"email": "carlos@empresa.com"
}
]
}
Exemplos de código — definir a equipe do pipeline
curl -X PUT "https://api.atys.pro/api/v1/crm/pipelines/12/users" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"user_ids": [77, 81]
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/users', {
method: 'PUT',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"user_ids": [77, 81]
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.put(
'https://api.atys.pro/api/v1/crm/pipelines/12/users',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'user_ids': [77, 81]
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/users');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'user_ids' => [77, 81]
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PUT', 'v1/crm/pipelines/12/users', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'user_ids' => [77, 81]
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"user_ids": [77, 81]
}`)
req, _ := http.NewRequest("PUT", "https://api.atys.pro/api/v1/crm/pipelines/12/users", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 77,
"name": "Carlos Vendedor",
"email": "carlos@empresa.com"
},
{
"id": 81,
"name": "Ana Gestora",
"email": "ana@empresa.com"
}
]
}
Exemplos de código — etiquetas do pipeline
curl "https://api.atys.pro/api/v1/crm/pipelines/12/tags" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/tags', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/pipelines/12/tags',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/tags');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/pipelines/12/tags', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/pipelines/12/tags", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 9,
"name": "VIP",
"description": null,
"color": "#f59e0b"
}
]
}
Exemplos de código — definir as etiquetas do pipeline
curl -X PUT "https://api.atys.pro/api/v1/crm/pipelines/12/tags" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"tag_ids": [9]
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/tags', {
method: 'PUT',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tag_ids": [9]
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.put(
'https://api.atys.pro/api/v1/crm/pipelines/12/tags',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'tag_ids': [9]
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/tags');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'tag_ids' => [9]
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PUT', 'v1/crm/pipelines/12/tags', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'tag_ids' => [9]
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"tag_ids": [9]
}`)
req, _ := http.NewRequest("PUT", "https://api.atys.pro/api/v1/crm/pipelines/12/tags", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 9,
"name": "VIP",
"description": null,
"color": "#f59e0b"
}
]
}
Etapas
Etapa nova entra no fim do pipeline; para mudar a posição, reordene enviando todas as etapas.
As etapas com is_protected: true (Lead novo, Ganho e Perdido do funil de vendas) aceitam cor e
descrição, mas não mudam de nome nem são excluídas (protected_stage). Atenção: excluir uma etapa
exclui junto os negócios que estão só nela, como na plataforma.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string (100) | Sim | Nome da etapa. |
color | string | Não | Hexadecimal #RRGGBB; default #1976d2. |
description | string (300) | Não | Descrição curta. |
max_days_in_stage | integer | Não | Tempo máximo, em dias, que o negócio deve ficar na etapa. |
Exemplos de código — criar etapa
curl -X POST "https://api.atys.pro/api/v1/crm/pipelines/12/stages" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Proposta",
"color": "#f59e0b",
"max_days_in_stage": 7
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/stages', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Proposta",
"color": "#f59e0b",
"max_days_in_stage": 7
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/pipelines/12/stages',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'Proposta',
'color': '#f59e0b',
'max_days_in_stage': 7
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/stages');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Proposta',
'color' => '#f59e0b',
'max_days_in_stage' => 7
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/pipelines/12/stages', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'Proposta',
'color' => '#f59e0b',
'max_days_in_stage' => 7
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Proposta",
"color": "#f59e0b",
"max_days_in_stage": 7
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/pipelines/12/stages", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 104,
"pipeline_id": 12,
"name": "Proposta",
"description": "",
"color": "#f59e0b",
"order": 4,
"max_days_in_stage": 7,
"is_won": false,
"is_lost": false,
"is_protected": false
}
}
Exemplos de código — editar etapa
curl -X PATCH "https://api.atys.pro/api/v1/crm/stages/104" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Proposta enviada"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/stages/104', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Proposta enviada"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/stages/104',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'Proposta enviada'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/stages/104');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Proposta enviada'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/stages/104', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'Proposta enviada'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Proposta enviada"
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/stages/104", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 104,
"pipeline_id": 12,
"name": "Proposta enviada",
"description": "",
"color": "#f59e0b",
"order": 4,
"max_days_in_stage": 7,
"is_won": false,
"is_lost": false,
"is_protected": false
}
}
Exemplos de código — reordenar etapas
curl -X POST "https://api.atys.pro/api/v1/crm/pipelines/12/stages/reorder" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"stage_ids": [101, 104, 102, 103]
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/stages/reorder', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"stage_ids": [101, 104, 102, 103]
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/pipelines/12/stages/reorder',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'stage_ids': [101, 104, 102, 103]
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/stages/reorder');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'stage_ids' => [101, 104, 102, 103]
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/pipelines/12/stages/reorder', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'stage_ids' => [101, 104, 102, 103]
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"stage_ids": [101, 104, 102, 103]
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/pipelines/12/stages/reorder", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 12,
"name": "Vendas B2B",
"stages": "… na ordem nova",
"…": "…"
}
}
Exemplos de código — excluir etapa
curl -X DELETE "https://api.atys.pro/api/v1/crm/stages/104" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/stages/104', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/stages/104',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/stages/104');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/stages/104', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/stages/104", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Tarefas padrão da etapa
Toda vez que um negócio entra na etapa, ele ganha estas tarefas. days_after_entry define o prazo
(dias depois da entrada); is_required: true impede o negócio de sair da etapa com a tarefa aberta.
Na criação, apply_to_existing_businesses cria a tarefa também nos negócios que já estão na etapa; na
edição, update_open_business_tasks leva a mudança às tarefas ainda abertas.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string (100) | Sim | Título da tarefa. |
description | string | Não | Instruções. |
is_required | boolean | Não | Default false. |
days_after_entry | integer | Não | Prazo em dias a partir da entrada na etapa. |
apply_to_existing_businesses | boolean | Não | Criar também nos negócios que já estão na etapa. |
update_open_business_tasks | boolean | Não | Só no PATCH: atualizar as tarefas abertas já criadas. |
Exemplos de código — listar tarefas padrão da etapa
curl "https://api.atys.pro/api/v1/crm/stages/104/tasks" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/stages/104/tasks', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/stages/104/tasks',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/stages/104/tasks');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/stages/104/tasks', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/stages/104/tasks", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 31,
"stage_id": 104,
"name": "Enviar proposta",
"description": null,
"order": 1,
"is_required": true,
"days_after_entry": 2
}
]
}
Exemplos de código — criar tarefa padrão
curl -X POST "https://api.atys.pro/api/v1/crm/stages/104/tasks" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Enviar proposta",
"is_required": true,
"days_after_entry": 2,
"apply_to_existing_businesses": true
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/stages/104/tasks', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Enviar proposta",
"is_required": true,
"days_after_entry": 2,
"apply_to_existing_businesses": true
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/stages/104/tasks',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'Enviar proposta',
'is_required': True,
'days_after_entry': 2,
'apply_to_existing_businesses': True
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/stages/104/tasks');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Enviar proposta',
'is_required' => true,
'days_after_entry' => 2,
'apply_to_existing_businesses' => true
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/stages/104/tasks', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'Enviar proposta',
'is_required' => true,
'days_after_entry' => 2,
'apply_to_existing_businesses' => true
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Enviar proposta",
"is_required": true,
"days_after_entry": 2,
"apply_to_existing_businesses": true
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/stages/104/tasks", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 31,
"stage_id": 104,
"name": "Enviar proposta",
"description": null,
"order": 1,
"is_required": true,
"days_after_entry": 2
}
}
Exemplos de código — editar tarefa padrão
curl -X PATCH "https://api.atys.pro/api/v1/crm/stage-tasks/31" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"days_after_entry": 3,
"update_open_business_tasks": true
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/stage-tasks/31', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"days_after_entry": 3,
"update_open_business_tasks": true
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/stage-tasks/31',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'days_after_entry': 3,
'update_open_business_tasks': True
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/stage-tasks/31');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'days_after_entry' => 3,
'update_open_business_tasks' => true
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/stage-tasks/31', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'days_after_entry' => 3,
'update_open_business_tasks' => true
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"days_after_entry": 3,
"update_open_business_tasks": true
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/stage-tasks/31", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 31,
"stage_id": 104,
"name": "Enviar proposta",
"description": null,
"order": 1,
"is_required": true,
"days_after_entry": 3
}
}
Exemplos de código — excluir tarefa padrão
curl -X DELETE "https://api.atys.pro/api/v1/crm/stage-tasks/31" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/stage-tasks/31', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/stage-tasks/31',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/stage-tasks/31');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/stage-tasks/31', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/stage-tasks/31", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Campos personalizados
Os campos que os negócios do pipeline têm. Ao criar, cada negócio do pipeline ganha o campo vazio. Campos com
mandatory: true são do sistema e não se editam nem excluem (protected_field).
Excluir apaga o valor do campo em todos os negócios: consulte antes o uso. Reordenar recebe todos os campos do pipeline.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string (100) | Sim | Nome do campo. |
type | string | Sim | text, textarea, number, price, percentage, date, email, cpf_cnpj, cep, phone, checkbox ou select. |
options | string[] | Com select | Opções do campo de seleção. |
description | string (200) | Não | Ajuda exibida no negócio. |
Exemplos de código — criar campo personalizado
curl -X POST "https://api.atys.pro/api/v1/crm/pipelines/12/custom-fields" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Canal",
"type": "select",
"options": ["Site", "Indicação"]
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/custom-fields', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Canal",
"type": "select",
"options": ["Site", "Indicação"]
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/pipelines/12/custom-fields',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'Canal',
'type': 'select',
'options': ['Site', 'Indicação']
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/custom-fields');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Canal',
'type' => 'select',
'options' => ['Site', 'Indicação']
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/pipelines/12/custom-fields', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'Canal',
'type' => 'select',
'options' => ['Site', 'Indicação']
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Canal",
"type": "select",
"options": ["Site", "Indicação"]
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/pipelines/12/custom-fields", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 57,
"pipeline_id": 12,
"name": "Canal",
"type": "select",
"description": null,
"options": [
"Site",
"Indicação"
],
"order": 3,
"mandatory": false
}
}
Exemplos de código — editar campo personalizado
curl -X PATCH "https://api.atys.pro/api/v1/crm/custom-fields/57" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"options": ["Site", "Indicação", "Evento"]
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/custom-fields/57', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"options": ["Site", "Indicação", "Evento"]
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/custom-fields/57',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'options': ['Site', 'Indicação', 'Evento']
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/custom-fields/57');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'options' => ['Site', 'Indicação', 'Evento']
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/custom-fields/57', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'options' => ['Site', 'Indicação', 'Evento']
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"options": ["Site", "Indicação", "Evento"]
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/custom-fields/57", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 57,
"pipeline_id": 12,
"name": "Canal",
"type": "select",
"description": null,
"options": [
"Site",
"Indicação",
"Evento"
],
"order": 3,
"mandatory": false
}
}
Exemplos de código — uso do campo (antes de excluir)
curl "https://api.atys.pro/api/v1/crm/custom-fields/57/usage" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/custom-fields/57/usage', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/custom-fields/57/usage',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/custom-fields/57/usage');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/custom-fields/57/usage', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/custom-fields/57/usage", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"businesses_with_data": 42,
"archived_with_data": 3
}
}
Exemplos de código — reordenar campos
curl -X POST "https://api.atys.pro/api/v1/crm/pipelines/12/custom-fields/reorder" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"field_ids": [55, 57, 56]
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/custom-fields/reorder', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"field_ids": [55, 57, 56]
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/pipelines/12/custom-fields/reorder',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'field_ids': [55, 57, 56]
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/custom-fields/reorder');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'field_ids' => [55, 57, 56]
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/pipelines/12/custom-fields/reorder', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'field_ids' => [55, 57, 56]
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"field_ids": [55, 57, 56]
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/pipelines/12/custom-fields/reorder", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 12,
"name": "Vendas B2B",
"custom_fields": "… na ordem nova",
"…": "…"
}
}
Exemplos de código — excluir campo personalizado
curl -X DELETE "https://api.atys.pro/api/v1/crm/custom-fields/57" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/custom-fields/57', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/custom-fields/57',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/custom-fields/57');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/custom-fields/57', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/custom-fields/57", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Campos obrigatórios por etapa
Campos que o negócio precisa ter preenchidos para entrar na etapa; sem eles, mover responde
mandatory_fields_missing. O PUT substitui a lista da etapa (as outras etapas ficam
como estão) e só aceita campos do mesmo pipeline (unknown_custom_field).
Exemplos de código — obrigatórios da etapa
curl "https://api.atys.pro/api/v1/crm/stages/102/mandatory-fields" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/stages/102/mandatory-fields', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/stages/102/mandatory-fields',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/stages/102/mandatory-fields');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/stages/102/mandatory-fields', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/stages/102/mandatory-fields", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 55,
"pipeline_id": 12,
"name": "Valor do Negócio",
"type": "price",
"description": "Valor do Negócio",
"options": null,
"order": 1,
"mandatory": true
}
]
}
Exemplos de código — definir obrigatórios da etapa
curl -X PUT "https://api.atys.pro/api/v1/crm/stages/102/mandatory-fields" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"field_ids": [55, 57]
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/stages/102/mandatory-fields', {
method: 'PUT',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"field_ids": [55, 57]
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.put(
'https://api.atys.pro/api/v1/crm/stages/102/mandatory-fields',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'field_ids': [55, 57]
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/stages/102/mandatory-fields');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'field_ids' => [55, 57]
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PUT', 'v1/crm/stages/102/mandatory-fields', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'field_ids' => [55, 57]
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"field_ids": [55, 57]
}`)
req, _ := http.NewRequest("PUT", "https://api.atys.pro/api/v1/crm/stages/102/mandatory-fields", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 55,
"pipeline_id": 12,
"name": "Valor do Negócio",
"type": "price",
"description": "Valor do Negócio",
"options": null,
"order": 1,
"mandatory": true
},
{
"id": 57,
"pipeline_id": 12,
"name": "Canal",
"type": "select",
"description": null,
"options": [
"Site",
"Indicação"
],
"order": 3,
"mandatory": false
}
]
}
Etiquetas de negócio
Crie e edite as etiquetas que aparecem em GET /tags. Sem
sector_ids nem user_ids, a etiqueta vale para todos; com vínculo, só os usuários do
setor (ou os colaboradores indicados) a veem e usam. Enviar a lista no PATCH substitui o vínculo.
Uma etiqueta usada na configuração de um workflow não é excluída (409 tag_in_use_by_workflow).
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string (50) | Sim | Nome da etiqueta. |
color | string | Sim | Hexadecimal #RRGGBB. |
description | string (400) | Não | Descrição. |
sector_ids | integer[] | Não | Setores da empresa que veem a etiqueta. |
user_ids | integer[] | Não | Colaboradores da empresa que veem a etiqueta. |
Exemplos de código — criar etiqueta de negócio
curl -X POST "https://api.atys.pro/api/v1/crm/tags" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "VIP",
"color": "#f59e0b"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/tags', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "VIP",
"color": "#f59e0b"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/tags',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'VIP',
'color': '#f59e0b'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/tags');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'VIP',
'color' => '#f59e0b'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/tags', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'VIP',
'color' => '#f59e0b'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "VIP",
"color": "#f59e0b"
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/tags", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 9,
"name": "VIP",
"description": null,
"color": "#f59e0b",
"sector_ids": [],
"user_ids": []
}
}
Exemplos de código — editar etiqueta de negócio
curl -X PATCH "https://api.atys.pro/api/v1/crm/tags/9" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"color": "#10b981",
"sector_ids": [4]
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/tags/9', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"color": "#10b981",
"sector_ids": [4]
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/tags/9',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'color': '#10b981',
'sector_ids': [4]
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/tags/9');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'color' => '#10b981',
'sector_ids' => [4]
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/tags/9', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'color' => '#10b981',
'sector_ids' => [4]
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"color": "#10b981",
"sector_ids": [4]
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/tags/9", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 9,
"name": "VIP",
"description": null,
"color": "#10b981",
"sector_ids": [
4
],
"user_ids": []
}
}
Exemplos de código — excluir etiqueta de negócio
curl -X DELETE "https://api.atys.pro/api/v1/crm/tags/9" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/tags/9', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/tags/9',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/tags/9');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/tags/9', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/tags/9", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Cadastrar motivos de perda
O nome não se repete na empresa, sem diferenciar maiúsculas (duplicate_name). Para tirar um motivo
de uso sem perder o histórico, envie is_active: false: ele sai de
GET /lost-reasons, mas os negócios já perdidos continuam com ele.
Excluir também preserva o motivo nos negócios já perdidos.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string (100) | Sim | Nome do motivo. |
description | string (200) | Não | Descrição. |
order | integer | Não | Posição na lista; default no fim. |
is_active | boolean | Não | Default true. |
Exemplos de código — criar motivo de perda
curl -X POST "https://api.atys.pro/api/v1/crm/lost-reasons" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Preço",
"description": "Acima do orçamento"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/lost-reasons', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Preço",
"description": "Acima do orçamento"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/lost-reasons',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'Preço',
'description': 'Acima do orçamento'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/lost-reasons');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Preço',
'description' => 'Acima do orçamento'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/lost-reasons', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'Preço',
'description' => 'Acima do orçamento'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Preço",
"description": "Acima do orçamento"
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/lost-reasons", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 4,
"name": "Preço",
"description": "Acima do orçamento",
"order": 1,
"is_active": true
}
}
Exemplos de código — editar ou desativar motivo de perda
curl -X PATCH "https://api.atys.pro/api/v1/crm/lost-reasons/4" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"is_active": false
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/lost-reasons/4', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"is_active": false
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/lost-reasons/4',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'is_active': False
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/lost-reasons/4');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'is_active' => false
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/lost-reasons/4', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'is_active' => false
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"is_active": false
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/lost-reasons/4", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 4,
"name": "Preço",
"description": "Acima do orçamento",
"order": 1,
"is_active": false
}
}
Exemplos de código — excluir motivo de perda
curl -X DELETE "https://api.atys.pro/api/v1/crm/lost-reasons/4" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/lost-reasons/4', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/lost-reasons/4',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/lost-reasons/4');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/lost-reasons/4', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/lost-reasons/4", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Gatilhos por mensagem
Quando o atendente envia uma mensagem (pela Atys ou pelo celular) que contém a phrase — sem
diferenciar maiúsculas nem acentos —, a ação roda no negócio aberto do contato. Desative com
is_active: false para pausar sem excluir.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string (120) | Sim | Nome da regra. |
phrase | string (3–255) | Sim | Trecho procurado na mensagem. |
action_type | string | Sim | move_stage (mover para stage_id), assign_tag (aplicar tag_id), assign_sender (tornar o atendente responsável) ou workflow_only (só dispara workflows). |
stage_id | integer | Com move_stage | Etapa de destino; o pipeline da regra passa a ser o da etapa. |
lost_reason_id | integer | Não | Motivo usado quando a etapa de destino é de perda. |
tag_id | integer | Com assign_tag | Etiqueta de negócio. |
pipeline_id | integer | Não | Limita a regra aos negócios desse pipeline (nas ações sem etapa). |
is_active | boolean | Não | Default true. |
Exemplos de código — listar gatilhos
curl "https://api.atys.pro/api/v1/crm/message-triggers?is_active=1" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/message-triggers?is_active=1', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/message-triggers?is_active=1',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/message-triggers?is_active=1');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/message-triggers', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'query' => [
'is_active' => 1
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/message-triggers?is_active=1", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 7,
"name": "Pedido confirmado",
"phrase": "pedido confirmado",
"action_type": "move_stage",
"pipeline_id": 12,
"stage_id": 102,
"tag_id": null,
"lost_reason_id": null,
"is_active": true,
"created_at": "2026-11-04T15:20:00-03:00",
"updated_at": "2026-11-04T15:20:00-03:00"
}
]
}
Exemplos de código — ver gatilho
curl "https://api.atys.pro/api/v1/crm/message-triggers/7" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/message-triggers/7', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/message-triggers/7',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/message-triggers/7');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/message-triggers/7', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/message-triggers/7", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 7,
"name": "Pedido confirmado",
"phrase": "pedido confirmado",
"action_type": "move_stage",
"pipeline_id": 12,
"stage_id": 102,
"tag_id": null,
"lost_reason_id": null,
"is_active": true,
"created_at": "2026-11-04T15:20:00-03:00",
"updated_at": "2026-11-04T15:20:00-03:00"
}
}
Exemplos de código — criar gatilho
curl -X POST "https://api.atys.pro/api/v1/crm/message-triggers" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Pedido confirmado",
"phrase": "pedido confirmado",
"action_type": "move_stage",
"stage_id": 102
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/message-triggers', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Pedido confirmado",
"phrase": "pedido confirmado",
"action_type": "move_stage",
"stage_id": 102
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/message-triggers',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'Pedido confirmado',
'phrase': 'pedido confirmado',
'action_type': 'move_stage',
'stage_id': 102
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/message-triggers');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Pedido confirmado',
'phrase' => 'pedido confirmado',
'action_type' => 'move_stage',
'stage_id' => 102
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/message-triggers', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'Pedido confirmado',
'phrase' => 'pedido confirmado',
'action_type' => 'move_stage',
'stage_id' => 102
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Pedido confirmado",
"phrase": "pedido confirmado",
"action_type": "move_stage",
"stage_id": 102
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/message-triggers", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 7,
"name": "Pedido confirmado",
"phrase": "pedido confirmado",
"action_type": "move_stage",
"pipeline_id": 12,
"stage_id": 102,
"tag_id": null,
"lost_reason_id": null,
"is_active": true,
"created_at": "2026-11-04T15:20:00-03:00",
"updated_at": "2026-11-04T15:20:00-03:00"
}
}
Exemplos de código — editar gatilho
curl -X PATCH "https://api.atys.pro/api/v1/crm/message-triggers/7" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"is_active": false
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/message-triggers/7', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"is_active": false
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/message-triggers/7',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'is_active': False
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/message-triggers/7');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'is_active' => false
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/message-triggers/7', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'is_active' => false
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"is_active": false
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/message-triggers/7", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 7,
"name": "Pedido confirmado",
"phrase": "pedido confirmado",
"action_type": "move_stage",
"pipeline_id": 12,
"stage_id": 102,
"tag_id": null,
"lost_reason_id": null,
"is_active": false,
"created_at": "2026-11-04T15:20:00-03:00",
"updated_at": "2026-11-04T15:20:00-03:00"
}
}
Exemplos de código — excluir gatilho
curl -X DELETE "https://api.atys.pro/api/v1/crm/message-triggers/7" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/message-triggers/7', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/message-triggers/7',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/message-triggers/7');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/message-triggers/7', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/message-triggers/7", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Criar negócio
Sem stage_id o negócio entra na primeira etapa do pipeline. O histórico registra a criação,
as automações da etapa disparam e o webhook crm.business.created é enviado.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
title | string (300) | Sim | Título do negócio. |
pipeline_id | integer | Sim | Pipeline de destino (pipelines). |
stage_id | integer | Não | Etapa inicial; default a primeira do pipeline. |
description | string (300) | Não | Descrição curta. |
contact_ids | integer[] | Não | Contatos da empresa vinculados ao negócio. |
owner_ids | integer[] | Não | Usuários responsáveis (usuários). |
tag_ids | integer[] | Não | Etiquetas do negócio (etiquetas). |
custom_fields | array | Não | [{"field_id": 55, "value": "1500"}] — ids de pipelines. |
priority_id / source_id | integer | Não | Prioridade e origem (catálogos). |
note | string | Não | Primeira nota do negócio. |
Exemplos de código — criar negócio
curl -X POST "https://api.atys.pro/api/v1/crm/businesses" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"title": "Pedido 123",
"pipeline_id": 12,
"contact_ids": [3021],
"owner_ids": [77],
"tag_ids": [9],
"custom_fields": [
{
"field_id": 55,
"value": "1500"
}
],
"note": "Lead vindo do ERP"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"title": "Pedido 123",
"pipeline_id": 12,
"contact_ids": [3021],
"owner_ids": [77],
"tag_ids": [9],
"custom_fields": [
{
"field_id": 55,
"value": "1500"
}
],
"note": "Lead vindo do ERP"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'title': 'Pedido 123',
'pipeline_id': 12,
'contact_ids': [3021],
'owner_ids': [77],
'tag_ids': [9],
'custom_fields': [
{
'field_id': 55,
'value': '1500'
}
],
'note': 'Lead vindo do ERP'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Pedido 123',
'pipeline_id' => 12,
'contact_ids' => [3021],
'owner_ids' => [77],
'tag_ids' => [9],
'custom_fields' => [
[
'field_id' => 55,
'value' => '1500'
]
],
'note' => 'Lead vindo do ERP'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'title' => 'Pedido 123',
'pipeline_id' => 12,
'contact_ids' => [3021],
'owner_ids' => [77],
'tag_ids' => [9],
'custom_fields' => [
[
'field_id' => 55,
'value' => '1500'
]
],
'note' => 'Lead vindo do ERP'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"title": "Pedido 123",
"pipeline_id": 12,
"contact_ids": [3021],
"owner_ids": [77],
"tag_ids": [9],
"custom_fields": [
{
"field_id": 55,
"value": "1500"
}
],
"note": "Lead vindo do ERP"
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 8841,
"title": "Pedido 123",
"description": null,
"score": null,
"archived": false,
"sold_at": null,
"canceled_at": null,
"priority_id": 2,
"source": {
"id": 1,
"name": "Manual"
},
"pipeline": {
"id": 12,
"name": "Vendas B2B"
},
"stage": {
"id": 101,
"name": "Novo"
},
"created_at": "2026-11-04T15:20:00-03:00",
"status": "open",
"lost_reason": null,
"contacts": [
{
"id": 3021,
"name": "Maria Cliente"
}
],
"owners": [
{
"id": 77,
"name": "Carlos Vendedor"
}
],
"tags": [
{
"id": 9,
"name": "VIP",
"color": "#f59e0b"
}
],
"custom_fields": [
{
"field_id": 55,
"name": "Valor",
"type": "number",
"value": "1500"
}
],
"updated_at": "2026-11-04T15:20:00-03:00"
}
}
Listar negócios
| Parâmetro | Tipo | Descrição |
|---|---|---|
pipeline_id | integer | Só negócios deste pipeline. |
stage_id | integer | Só negócios nesta etapa. |
contact_id | integer | Só negócios deste contato. |
status | string | open, won ou lost. |
archived | boolean | Default false. |
updated_since | data ISO 8601 | Alterados a partir desta data — use para sincronização incremental. |
page / per_page | integer | Paginação; per_page de 1 a 100 (default 25). |
Exemplos de código — listar negócios com filtros
curl "https://api.atys.pro/api/v1/crm/businesses?pipeline_id=12&status=open&per_page=50" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses?pipeline_id=12&status=open&per_page=50', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses?pipeline_id=12&status=open&per_page=50',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses?pipeline_id=12&status=open&per_page=50');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'query' => [
'pipeline_id' => 12,
'status' => 'open',
'per_page' => 50
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses?pipeline_id=12&status=open&per_page=50", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 8841,
"title": "Pedido 123",
"status": "open",
"...": "..."
}
],
"meta": {
"page": 1,
"per_page": 50,
"total": 1,
"last_page": 1
}
}
Ver um negócio
A base deste objeto é a mesma do payload dos webhooks crm.business.*.
status é open, won (com sold_at) ou lost
(com canceled_at e lost_reason).
Exemplos de código — detalhe do negócio
curl "https://api.atys.pro/api/v1/crm/businesses/8841" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses/8841',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses/8841', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses/8841", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 8841,
"title": "Pedido 123",
"description": null,
"score": null,
"archived": false,
"sold_at": null,
"canceled_at": null,
"priority_id": 2,
"source": {
"id": 1,
"name": "Manual"
},
"pipeline": {
"id": 12,
"name": "Vendas B2B"
},
"stage": {
"id": 101,
"name": "Novo"
},
"created_at": "2026-11-04T15:20:00-03:00",
"status": "open",
"lost_reason": null,
"contacts": [
{
"id": 3021,
"name": "Maria Cliente"
}
],
"owners": [
{
"id": 77,
"name": "Carlos Vendedor"
}
],
"tags": [
{
"id": 9,
"name": "VIP",
"color": "#f59e0b"
}
],
"custom_fields": [
{
"field_id": 55,
"name": "Valor",
"type": "number",
"value": "1500"
}
],
"updated_at": "2026-11-04T15:20:00-03:00"
}
}
Editar negócio
Envie só o que muda: title, description, priority_id,
source_id, custom_fields, contact_ids, owner_ids e
tag_ids. As três listas substituem a atual (envie [] para
limpar). A etapa não muda por aqui: use mover.
Exemplos de código — editar negócio
curl -X PATCH "https://api.atys.pro/api/v1/crm/businesses/8841" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"title": "Pedido 123 (revisado)",
"custom_fields": [
{
"field_id": 55,
"value": "1800"
}
]
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"title": "Pedido 123 (revisado)",
"custom_fields": [
{
"field_id": 55,
"value": "1800"
}
]
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/businesses/8841',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'title': 'Pedido 123 (revisado)',
'custom_fields': [
{
'field_id': 55,
'value': '1800'
}
]
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Pedido 123 (revisado)',
'custom_fields' => [
[
'field_id' => 55,
'value' => '1800'
]
]
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/businesses/8841', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'title' => 'Pedido 123 (revisado)',
'custom_fields' => [
[
'field_id' => 55,
'value' => '1800'
]
]
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"title": "Pedido 123 (revisado)",
"custom_fields": [
{
"field_id": 55,
"value": "1800"
}
]
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/businesses/8841", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 8841,
"title": "Pedido 123 (revisado)",
"description": null,
"score": null,
"archived": false,
"sold_at": null,
"canceled_at": null,
"priority_id": 2,
"source": {
"id": 1,
"name": "Manual"
},
"pipeline": {
"id": 12,
"name": "Vendas B2B"
},
"stage": {
"id": 101,
"name": "Novo"
},
"created_at": "2026-11-04T15:20:00-03:00",
"status": "open",
"lost_reason": null,
"contacts": [
{
"id": 3021,
"name": "Maria Cliente"
}
],
"owners": [
{
"id": 77,
"name": "Carlos Vendedor"
}
],
"tags": [
{
"id": 9,
"name": "VIP",
"color": "#f59e0b"
}
],
"custom_fields": [
{
"field_id": 55,
"name": "Valor",
"type": "number",
"value": "1500"
}
],
"updated_at": "2026-11-04T15:20:00-03:00"
}
}
Mover de etapa
Body: stage_id (obrigatório) e, se a etapa for de perda, lost_reason_id.
Valem as regras da etapa configuradas na plataforma: campos obrigatórios e tarefas obrigatórias
pendentes impedem a movimentação (422, ver erros).
Exemplos de código — mover para outra etapa
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/move" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"stage_id": 102
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/move', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"stage_id": 102
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/move',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'stage_id': 102
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/move');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'stage_id' => 102
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/move', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'stage_id' => 102
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"stage_id": 102
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/move", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 8841,
"title": "Pedido 123",
"description": null,
"score": null,
"archived": false,
"sold_at": null,
"canceled_at": null,
"priority_id": 2,
"source": {
"id": 1,
"name": "Manual"
},
"pipeline": {
"id": 12,
"name": "Vendas B2B"
},
"stage": {
"id": 102,
"name": "Proposta"
},
"created_at": "2026-11-04T15:20:00-03:00",
"status": "open",
"lost_reason": null,
"contacts": [
{
"id": 3021,
"name": "Maria Cliente"
}
],
"owners": [
{
"id": 77,
"name": "Carlos Vendedor"
}
],
"tags": [
{
"id": 9,
"name": "VIP",
"color": "#f59e0b"
}
],
"custom_fields": [
{
"field_id": 55,
"name": "Valor",
"type": "number",
"value": "1500"
}
],
"updated_at": "2026-11-04T15:20:00-03:00"
}
}
Ganhar e perder
Atalhos que movem o negócio para a etapa de ganho (is_won) ou de perda (is_lost)
do pipeline dele. Perder aceita lost_reason_id (motivos de perda).
Exemplos de código — marcar como ganho
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/win" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/win', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/win',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/win');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/win', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/win", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 8841,
"title": "Pedido 123",
"description": null,
"score": null,
"archived": false,
"sold_at": "2026-11-05T10:00:00-03:00",
"canceled_at": null,
"priority_id": 2,
"source": {
"id": 1,
"name": "Manual"
},
"pipeline": {
"id": 12,
"name": "Vendas B2B"
},
"stage": {
"id": 103,
"name": "Ganho"
},
"created_at": "2026-11-04T15:20:00-03:00",
"status": "won",
"lost_reason": null,
"contacts": [
{
"id": 3021,
"name": "Maria Cliente"
}
],
"owners": [
{
"id": 77,
"name": "Carlos Vendedor"
}
],
"tags": [
{
"id": 9,
"name": "VIP",
"color": "#f59e0b"
}
],
"custom_fields": [
{
"field_id": 55,
"name": "Valor",
"type": "number",
"value": "1500"
}
],
"updated_at": "2026-11-04T15:20:00-03:00"
}
}
Exemplos de código — marcar como perdido
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/lose" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"lost_reason_id": 4
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/lose', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"lost_reason_id": 4
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/lose',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'lost_reason_id': 4
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/lose');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'lost_reason_id' => 4
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/lose', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'lost_reason_id' => 4
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"lost_reason_id": 4
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/lose", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 8841,
"title": "Pedido 123",
"description": null,
"score": null,
"archived": false,
"sold_at": null,
"canceled_at": "2026-11-05T10:00:00-03:00",
"priority_id": 2,
"source": {
"id": 1,
"name": "Manual"
},
"pipeline": {
"id": 12,
"name": "Vendas B2B"
},
"stage": {
"id": 101,
"name": "Novo"
},
"created_at": "2026-11-04T15:20:00-03:00",
"status": "lost",
"lost_reason": {
"id": 4,
"name": "Preço"
},
"contacts": [
{
"id": 3021,
"name": "Maria Cliente"
}
],
"owners": [
{
"id": 77,
"name": "Carlos Vendedor"
}
],
"tags": [
{
"id": 9,
"name": "VIP",
"color": "#f59e0b"
}
],
"custom_fields": [
{
"field_id": 55,
"name": "Valor",
"type": "number",
"value": "1500"
}
],
"updated_at": "2026-11-04T15:20:00-03:00"
}
}
Arquivar e excluir
Arquivar tira o negócio do funil sem perder nada; ele continua acessível em
GET /businesses?archived=true. Excluir exige a permissão Excluir negócios do CRM
na chave.
Exemplos de código — arquivar negócio
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/archive" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/archive', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/archive',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/archive');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/archive', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/archive", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 8841,
"title": "Pedido 123",
"description": null,
"score": null,
"archived": true,
"sold_at": null,
"canceled_at": null,
"priority_id": 2,
"source": {
"id": 1,
"name": "Manual"
},
"pipeline": {
"id": 12,
"name": "Vendas B2B"
},
"stage": {
"id": 101,
"name": "Novo"
},
"created_at": "2026-11-04T15:20:00-03:00",
"status": "open",
"lost_reason": null,
"contacts": [
{
"id": 3021,
"name": "Maria Cliente"
}
],
"owners": [
{
"id": 77,
"name": "Carlos Vendedor"
}
],
"tags": [
{
"id": 9,
"name": "VIP",
"color": "#f59e0b"
}
],
"custom_fields": [
{
"field_id": 55,
"name": "Valor",
"type": "number",
"value": "1500"
}
],
"updated_at": "2026-11-04T15:20:00-03:00"
}
}
Exemplos de código — desarquivar negócio
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/unarchive" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/unarchive', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/unarchive',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/unarchive');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/unarchive', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/unarchive", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 8841,
"title": "Pedido 123",
"description": null,
"score": null,
"archived": false,
"sold_at": null,
"canceled_at": null,
"priority_id": 2,
"source": {
"id": 1,
"name": "Manual"
},
"pipeline": {
"id": 12,
"name": "Vendas B2B"
},
"stage": {
"id": 101,
"name": "Novo"
},
"created_at": "2026-11-04T15:20:00-03:00",
"status": "open",
"lost_reason": null,
"contacts": [
{
"id": 3021,
"name": "Maria Cliente"
}
],
"owners": [
{
"id": 77,
"name": "Carlos Vendedor"
}
],
"tags": [
{
"id": 9,
"name": "VIP",
"color": "#f59e0b"
}
],
"custom_fields": [
{
"field_id": 55,
"name": "Valor",
"type": "number",
"value": "1500"
}
],
"updated_at": "2026-11-04T15:20:00-03:00"
}
}
Exemplos de código — excluir negócio
curl -X DELETE "https://api.atys.pro/api/v1/crm/businesses/8841" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/businesses/8841',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/businesses/8841', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/businesses/8841", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Notas
Body: text (obrigatório, até 10.000 caracteres). A nota aparece no negócio com o usuário API
como autor e dispara as automações de atividade. Notas geradas pela plataforma ("system": true)
não podem ser editadas nem excluídas (note_locked). A listagem vem da mais recente para a mais
antiga e aceita page e per_page.
Exemplos de código — criar nota
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/notes" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"text": "Cliente pediu proposta com 5% de desconto."
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/notes', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"text": "Cliente pediu proposta com 5% de desconto."
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/notes',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'text': 'Cliente pediu proposta com 5% de desconto.'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/notes');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'text' => 'Cliente pediu proposta com 5% de desconto.'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/notes', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'text' => 'Cliente pediu proposta com 5% de desconto.'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"text": "Cliente pediu proposta com 5% de desconto."
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/notes", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 5120,
"business_id": 8841,
"text": "Cliente pediu proposta com 5% de desconto.",
"author": {
"id": 90,
"name": "Integração ERP"
},
"system": false,
"created_at": "2026-11-04T16:02:11-03:00",
"updated_at": "2026-11-04T16:02:11-03:00"
}
}
Exemplos de código — listar notas
curl "https://api.atys.pro/api/v1/crm/businesses/8841/notes" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/notes', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses/8841/notes',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/notes');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses/8841/notes', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses/8841/notes", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 5120,
"business_id": 8841,
"text": "Cliente pediu proposta com 5% de desconto.",
"author": {
"id": 90,
"name": "Integração ERP"
},
"system": false,
"created_at": "2026-11-04T16:02:11-03:00",
"updated_at": "2026-11-04T16:02:11-03:00"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
}
}
Exemplos de código — editar nota
curl -X PATCH "https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"text": "Desconto aprovado: 5%."
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"text": "Desconto aprovado: 5%."
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'text': 'Desconto aprovado: 5%.'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'text' => 'Desconto aprovado: 5%.'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/businesses/8841/notes/5120', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'text' => 'Desconto aprovado: 5%.'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"text": "Desconto aprovado: 5%."
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 5120,
"business_id": 8841,
"text": "Desconto aprovado: 5%.",
"author": {
"id": 90,
"name": "Integração ERP"
},
"system": false,
"created_at": "2026-11-04T16:02:11-03:00",
"updated_at": "2026-11-04T16:02:11-03:00"
}
}
Exemplos de código — excluir nota
curl -X DELETE "https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/businesses/8841/notes/5120', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Tarefas
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
title | string (255) | Sim | O que fazer. |
type | string | Não | call, email, meeting, whatsapp, visit, followup ou other. |
due_at | data ISO 8601 | Não | Prazo. Tarefas vencidas geram o aviso de atraso da plataforma. |
assignee_id | integer | Não | Responsável pela tarefa (usuários); default o usuário API. |
description | string | Não | Detalhes. |
No PATCH envie só o que muda. Tarefas obrigatórias da etapa bloqueiam o mover
enquanto estiverem abertas: conclua-as com /complete. A listagem aceita
status=open|completed.
Exemplos de código — criar tarefa
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/tasks" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"title": "Ligar para confirmar o pedido",
"type": "call",
"due_at": "2026-11-10T10:00:00-03:00",
"assignee_id": 77
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/tasks', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"title": "Ligar para confirmar o pedido",
"type": "call",
"due_at": "2026-11-10T10:00:00-03:00",
"assignee_id": 77
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/tasks',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'title': 'Ligar para confirmar o pedido',
'type': 'call',
'due_at': '2026-11-10T10:00:00-03:00',
'assignee_id': 77
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/tasks');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Ligar para confirmar o pedido',
'type' => 'call',
'due_at' => '2026-11-10T10:00:00-03:00',
'assignee_id' => 77
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/tasks', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'title' => 'Ligar para confirmar o pedido',
'type' => 'call',
'due_at' => '2026-11-10T10:00:00-03:00',
'assignee_id' => 77
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"title": "Ligar para confirmar o pedido",
"type": "call",
"due_at": "2026-11-10T10:00:00-03:00",
"assignee_id": 77
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/tasks", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 731,
"business_id": 8841,
"title": "Ligar para confirmar o pedido",
"type": "call",
"description": null,
"due_at": "2026-11-10T10:00:00-03:00",
"completed_at": null,
"status": "open",
"assignee": {
"id": 77,
"name": "Carlos Vendedor"
},
"created_at": "2026-11-04T16:05:40-03:00",
"updated_at": "2026-11-04T16:05:40-03:00"
}
}
Exemplos de código — listar tarefas
curl "https://api.atys.pro/api/v1/crm/businesses/8841/tasks?status=open" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/tasks?status=open', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses/8841/tasks?status=open',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/tasks?status=open');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses/8841/tasks', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'query' => [
'status' => 'open'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses/8841/tasks?status=open", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 731,
"business_id": 8841,
"title": "Ligar para confirmar o pedido",
"type": "call",
"description": null,
"due_at": "2026-11-10T10:00:00-03:00",
"completed_at": null,
"status": "open",
"assignee": {
"id": 77,
"name": "Carlos Vendedor"
},
"created_at": "2026-11-04T16:05:40-03:00",
"updated_at": "2026-11-04T16:05:40-03:00"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
}
}
Exemplos de código — editar tarefa
curl -X PATCH "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"due_at": "2026-11-12T14:00:00-03:00"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"due_at": "2026-11-12T14:00:00-03:00"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'due_at': '2026-11-12T14:00:00-03:00'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'due_at' => '2026-11-12T14:00:00-03:00'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/businesses/8841/tasks/731', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'due_at' => '2026-11-12T14:00:00-03:00'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"due_at": "2026-11-12T14:00:00-03:00"
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 731,
"business_id": 8841,
"title": "Ligar para confirmar o pedido",
"type": "call",
"description": null,
"due_at": "2026-11-12T14:00:00-03:00",
"completed_at": null,
"status": "open",
"assignee": {
"id": 77,
"name": "Carlos Vendedor"
},
"created_at": "2026-11-04T16:05:40-03:00",
"updated_at": "2026-11-04T16:05:40-03:00"
}
}
Exemplos de código — concluir tarefa
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/complete" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/complete', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/complete',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/complete');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/tasks/731/complete', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/complete", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 731,
"business_id": 8841,
"title": "Ligar para confirmar o pedido",
"type": "call",
"description": null,
"due_at": "2026-11-10T10:00:00-03:00",
"completed_at": "2026-11-10T09:40:00-03:00",
"status": "completed",
"assignee": {
"id": 77,
"name": "Carlos Vendedor"
},
"created_at": "2026-11-04T16:05:40-03:00",
"updated_at": "2026-11-04T16:05:40-03:00"
}
}
Exemplos de código — reabrir tarefa
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/reopen" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/reopen', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/reopen',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/reopen');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/tasks/731/reopen', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/reopen", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 731,
"business_id": 8841,
"title": "Ligar para confirmar o pedido",
"type": "call",
"description": null,
"due_at": "2026-11-10T10:00:00-03:00",
"completed_at": null,
"status": "open",
"assignee": {
"id": 77,
"name": "Carlos Vendedor"
},
"created_at": "2026-11-04T16:05:40-03:00",
"updated_at": "2026-11-04T16:05:40-03:00"
}
}
Exemplos de código — excluir tarefa
curl -X DELETE "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/businesses/8841/tasks/731', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Histórico
Tudo o que aconteceu no negócio, mais recente primeiro — feito na tela, por automação ou pela API.
Somente leitura. type identifica a ação (por exemplo BUSINESS_CREATED,
TASK_COMPLETED); aceita page e per_page.
Exemplos de código — linha do tempo do negócio
curl "https://api.atys.pro/api/v1/crm/businesses/8841/history" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/history', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses/8841/history',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/history');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses/8841/history', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses/8841/history", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 99012,
"business_id": 8841,
"type": "TASK_COMPLETED",
"category": "task",
"description": "Usuário Integração ERP concluiu a tarefa: Ligar para confirmar o pedido",
"pipeline": {
"id": 12,
"name": "Vendas B2B"
},
"user": {
"id": 90,
"name": "Integração ERP"
},
"created_at": "2026-11-04T16:30:00-03:00"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 7,
"last_page": 1
}
}
Pipelines do negócio
Um negócio pode estar em mais de um pipeline ao mesmo tempo (por exemplo, Vendas e
Pós-venda). Esta consulta mostra em quais ele está e a etapa atual em cada um.
original marca o pipeline em que o negócio nasceu (ou para onde foi transferido por último).
Exemplos de código — pipelines em que o negócio está
curl "https://api.atys.pro/api/v1/crm/businesses/8841/pipelines" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/pipelines', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses/8841/pipelines',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/pipelines');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses/8841/pipelines', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses/8841/pipelines", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"pipeline": {
"id": 12,
"name": "Vendas"
},
"stage": {
"id": 150,
"name": "Proposta",
"is_won": false,
"is_lost": false
},
"original": true,
"entered_at": "2026-11-02T10:15:00-03:00"
},
{
"pipeline": {
"id": 15,
"name": "Pós-venda"
},
"stage": {
"id": 201,
"name": "Onboarding",
"is_won": false,
"is_lost": false
},
"original": false,
"entered_at": "2026-11-04T16:20:00-03:00"
}
]
}
Transferir entre pipelines
Move o negócio de um pipeline para outro, como o botão Transferir da plataforma: o pipeline de origem deixa de ter o negócio, e notas, tarefas manuais, agendamentos e histórico passam para o destino. Para trocar de etapa dentro do mesmo pipeline, use mover.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
pipeline_id | integer | Sim | Pipeline de destino. Precisa ser visível para o usuário API. |
stage_id | integer | Não | Etapa do pipeline de destino. Sem ela, entra na primeira etapa aberta. |
from_pipeline_id | integer | Não | Pipeline de origem, se o negócio estiver em mais de um. Default: o primeiro. |
owner_ids | array de integer | Não | Responsáveis no destino. Sem o campo, mantém os da origem; [] transfere sem responsável. Todos precisam ver o pipeline de destino. |
tag_ids | array de integer | Não | Etiquetas no destino. Sem o campo, mantém as da origem. Precisam estar vinculadas ao pipeline de destino. |
custom_fields_mode | string | Não | auto (default) copia os campos de mesmo nome e tipo; selected copia só os de custom_field_ids, criando no destino os que faltarem; none não copia nada. |
custom_field_ids | array de integer | Com selected | Campos do pipeline de origem a levar. |
Em todos os modos, os valores da origem ficam registrados numa nota do sistema no negócio. Responsável
sem acesso ao destino ou etiqueta não vinculada devolvem transfer_rejected e nada muda.
Exemplos de código — transferir negócio
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/transfer" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"pipeline_id": 15,
"stage_id": 201,
"owner_ids": [77],
"custom_fields_mode": "auto"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/transfer', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"pipeline_id": 15,
"stage_id": 201,
"owner_ids": [77],
"custom_fields_mode": "auto"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/transfer',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'pipeline_id': 15,
'stage_id': 201,
'owner_ids': [77],
'custom_fields_mode': 'auto'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/transfer');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'pipeline_id' => 15,
'stage_id' => 201,
'owner_ids' => [77],
'custom_fields_mode' => 'auto'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/transfer', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'pipeline_id' => 15,
'stage_id' => 201,
'owner_ids' => [77],
'custom_fields_mode' => 'auto'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"pipeline_id": 15,
"stage_id": 201,
"owner_ids": [77],
"custom_fields_mode": "auto"
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/transfer", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 8841,
"title": "Pedido 123 — Loja Centro",
"pipeline": {
"id": 15,
"name": "Pós-venda"
},
"stage": {
"id": 201,
"name": "Onboarding"
},
"status": "open",
"owners": [
{
"id": 77,
"name": "Carlos Vendedor"
}
]
}
}
Clonar negócio
Cria um negócio novo a partir de outro, em qualquer pipeline visível: copia contatos, responsáveis,
etiquetas, campos personalizados, notas, tarefas (reabertas) e histórico. O original não muda.
Body: title e pipeline_id (obrigatórios) e stage_id (opcional,
default a primeira etapa aberta). Responde 201 com o negócio novo.
Exemplos de código — clonar negócio
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/clone" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"title": "Pedido 124 — Loja Centro",
"pipeline_id": 12,
"stage_id": 150
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/clone', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"title": "Pedido 124 — Loja Centro",
"pipeline_id": 12,
"stage_id": 150
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/clone',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'title': 'Pedido 124 — Loja Centro',
'pipeline_id': 12,
'stage_id': 150
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/clone');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Pedido 124 — Loja Centro',
'pipeline_id' => 12,
'stage_id' => 150
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/clone', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'title' => 'Pedido 124 — Loja Centro',
'pipeline_id' => 12,
'stage_id' => 150
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"title": "Pedido 124 — Loja Centro",
"pipeline_id": 12,
"stage_id": 150
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/clone", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 8902,
"title": "Pedido 124 — Loja Centro",
"pipeline": {
"id": 12,
"name": "Vendas"
},
"stage": {
"id": 150,
"name": "Proposta"
},
"status": "open",
"owners": [
{
"id": 77,
"name": "Carlos Vendedor"
}
]
}
}
Associar a outros pipelines
Diferente de transferir, associar mantém o negócio onde está e o coloca também em outro
pipeline — é o "Associar a outro pipeline" da plataforma. Os responsáveis do pipeline atual são copiados
e os campos de mesmo nome e tipo herdam o valor. Body: pipeline_id e stage_id
(opcional). A resposta é a lista atualizada de pipelines do negócio.
Exemplos de código — associar a outro pipeline
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/pipelines" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"pipeline_id": 15,
"stage_id": 201
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/pipelines', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"pipeline_id": 15,
"stage_id": 201
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/pipelines',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'pipeline_id': 15,
'stage_id': 201
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/pipelines');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'pipeline_id' => 15,
'stage_id' => 201
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/pipelines', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'pipeline_id' => 15,
'stage_id' => 201
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"pipeline_id": 15,
"stage_id": 201
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/pipelines", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"pipeline": {
"id": 12,
"name": "Vendas"
},
"stage": {
"id": 150,
"name": "Proposta",
"is_won": false,
"is_lost": false
},
"original": true,
"entered_at": "2026-11-02T10:15:00-03:00"
},
{
"pipeline": {
"id": 15,
"name": "Pós-venda"
},
"stage": {
"id": 201,
"name": "Onboarding",
"is_won": false,
"is_lost": false
},
"original": false,
"entered_at": "2026-11-04T16:20:00-03:00"
}
]
}
Para tirar o negócio de um pipeline, informe o id do pipeline. Saem junto as notas, tarefas, agendamentos,
campos e histórico daquele pipeline. O negócio precisa continuar em pelo menos um (last_pipeline).
Exemplos de código — remover de um pipeline
curl -X DELETE "https://api.atys.pro/api/v1/crm/businesses/8841/pipelines/15" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/pipelines/15', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/businesses/8841/pipelines/15',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/pipelines/15');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/businesses/8841/pipelines/15', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/businesses/8841/pipelines/15", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Importação em lote
Cria até 100 negócios por chamada num pipeline, cada um pela mesma regra do
criar negócio (histórico, automações, webhooks). stage_id vale para o
lote inteiro (default: a primeira etapa aberta). Cada item aceita os campos do criar: title,
description, contact_ids, owner_ids, tag_ids,
priority_id, source_id, custom_fields e note.
A resposta é 200 mesmo com falhas: data traz um resultado por item, na ordem
enviada (index), com o id criado ou o error. Item com erro não
grava nada e não impede os demais; reenvie só os que falharam.
Exemplos de código — importar negócios
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/import" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"pipeline_id": 12,
"stage_id": 150,
"businesses": [
{
"title": "Pedido 125",
"contact_ids": [5120],
"owner_ids": [77],
"custom_fields": [
{
"field_id": 55,
"value": "1500"
}
]
},
{
"title": "Pedido 126",
"owner_ids": [999]
}
]
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/import', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"pipeline_id": 12,
"stage_id": 150,
"businesses": [
{
"title": "Pedido 125",
"contact_ids": [5120],
"owner_ids": [77],
"custom_fields": [
{
"field_id": 55,
"value": "1500"
}
]
},
{
"title": "Pedido 126",
"owner_ids": [999]
}
]
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/import',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'pipeline_id': 12,
'stage_id': 150,
'businesses': [
{
'title': 'Pedido 125',
'contact_ids': [5120],
'owner_ids': [77],
'custom_fields': [
{
'field_id': 55,
'value': '1500'
}
]
},
{
'title': 'Pedido 126',
'owner_ids': [999]
}
]
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/import');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'pipeline_id' => 12,
'stage_id' => 150,
'businesses' => [
[
'title' => 'Pedido 125',
'contact_ids' => [5120],
'owner_ids' => [77],
'custom_fields' => [
[
'field_id' => 55,
'value' => '1500'
]
]
],
[
'title' => 'Pedido 126',
'owner_ids' => [999]
]
]
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/import', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'pipeline_id' => 12,
'stage_id' => 150,
'businesses' => [
[
'title' => 'Pedido 125',
'contact_ids' => [5120],
'owner_ids' => [77],
'custom_fields' => [
[
'field_id' => 55,
'value' => '1500'
]
]
],
[
'title' => 'Pedido 126',
'owner_ids' => [999]
]
]
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"pipeline_id": 12,
"stage_id": 150,
"businesses": [
{
"title": "Pedido 125",
"contact_ids": [5120],
"owner_ids": [77],
"custom_fields": [
{
"field_id": 55,
"value": "1500"
}
]
},
{
"title": "Pedido 126",
"owner_ids": [999]
}
]
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/import", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"index": 0,
"id": 8903
},
{
"index": 1,
"error": {
"code": "invalid_owner",
"message": "Responsável não encontrado na empresa."
}
}
],
"meta": {
"total": 2,
"created": 1,
"failed": 1
}
}
Precisa que o usuário API tenha a permissão Importar negócios do CRM.
Bloquear usuários
Esconde o negócio de usuários específicos da equipe, como em Visibilidade do negócio na
plataforma. A lista mostra quem vê o pipeline do negócio, com blocked e
responsible. O PUT substitui a lista inteira de bloqueados ([]
libera todos).
Exemplos de código — usuários e bloqueios
curl "https://api.atys.pro/api/v1/crm/businesses/8841/blocked-users" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/blocked-users', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses/8841/blocked-users',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/blocked-users');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses/8841/blocked-users', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses/8841/blocked-users", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 77,
"name": "Carlos Vendedor",
"email": "carlos@loja.com.br",
"blocked": false,
"responsible": true
},
{
"id": 81,
"name": "Ana Suporte",
"email": "ana@loja.com.br",
"blocked": true,
"responsible": false
}
]
}
Exemplos de código — definir usuários bloqueados
curl -X PUT "https://api.atys.pro/api/v1/crm/businesses/8841/blocked-users" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"user_ids": [81]
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/blocked-users', {
method: 'PUT',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"user_ids": [81]
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.put(
'https://api.atys.pro/api/v1/crm/businesses/8841/blocked-users',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'user_ids': [81]
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/blocked-users');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'user_ids' => [81]
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PUT', 'v1/crm/businesses/8841/blocked-users', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'user_ids' => [81]
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"user_ids": [81]
}`)
req, _ := http.NewRequest("PUT", "https://api.atys.pro/api/v1/crm/businesses/8841/blocked-users", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 77,
"name": "Carlos Vendedor",
"email": "carlos@loja.com.br",
"blocked": false,
"responsible": true
},
{
"id": 81,
"name": "Ana Suporte",
"email": "ana@loja.com.br",
"blocked": true,
"responsible": false
}
]
}
| Erro | Quando |
|---|---|
invalid_user | Usuário que não é da empresa. |
user_not_in_pipeline | Usuário que nem vê o pipeline do negócio. |
responsible_cannot_be_blocked | Responsável do negócio — remova-o dos responsáveis antes. |
last_visible_user | Bloquearia todo mundo: ao menos um usuário precisa ver o negócio. |
Origem do negócio
De onde o lead veio: first é o primeiro ponto de contato (de preferência um com campanha) e
last, o mais recente — campanha, conjunto, anúncio, palavra-chave, UTMs e, quando houver, o
criativo. As duas pontas vêm null quando o negócio não tem atribuição.
Exemplos de código — origem do negócio
curl "https://api.atys.pro/api/v1/crm/businesses/8841/origin" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/origin', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses/8841/origin',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/origin');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses/8841/origin', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses/8841/origin", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"first": {
"touchpoint_id": 5521,
"captured_at": "2026-10-30T14:02:00-03:00",
"channel_type": "whatsapp",
"platform": "meta",
"campaign_name": "Black Friday 2026",
"adset_name": "Remarketing 30d",
"ad_name": "Vídeo depoimento",
"keyword": null,
"headline": "Até 40% off",
"source_url": null,
"utm_source": "facebook",
"utm_medium": "paid",
"external_campaign_id": "120210000000001",
"external_ad_id": "120210000000077",
"creative": null
},
"last": {
"touchpoint_id": 5600,
"captured_at": "2026-11-03T09:12:00-03:00",
"channel_type": "site",
"platform": "google",
"campaign_name": "Pesquisa Marca",
"adset_name": null,
"ad_name": null,
"keyword": "loja centro",
"headline": "Até 40% off",
"source_url": null,
"utm_source": "google",
"utm_medium": "cpc",
"external_campaign_id": "120210000000001",
"external_ad_id": "120210000000077",
"creative": null
}
}
}
As campanhas que trouxeram leads para a empresa no último ano, para montar filtros e relatórios:
Exemplos de código — campanhas de origem
curl "https://api.atys.pro/api/v1/crm/origin-campaigns" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/origin-campaigns', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/origin-campaigns',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/origin-campaigns');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/origin-campaigns', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/origin-campaigns", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"platform": "meta",
"name": "Black Friday 2026",
"leads": 184,
"last_seen": "2026-11-04 15:40:00",
"status": "ACTIVE",
"effective_status": "ACTIVE"
}
]
}
Agendamentos de WhatsApp
Agenda uma mensagem de WhatsApp para contatos do negócio, enviada pelo canal escolhido no horário
marcado — o mesmo agendamento da aba WhatsApp do negócio. Variáveis como
{{nome}} são trocadas no envio. Para enviar já, use o horário atual.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
channel_id | integer | Sim | Canal de WhatsApp da empresa (WhatsApp). |
contact_ids | array de integer | Sim | Destinatários (1 a 50). |
message | string | Sem template | Texto da mensagem. |
template_id | integer | Não | Template aprovado (API oficial), com variable_values e button_variable_values. |
scheduled_to | data ISO 8601 | Sim | Quando enviar. |
status: pending, processing, completed,
partial (parte dos contatos falhou) ou failed. Só agendamentos
pending podem ser editados (schedule_not_pending). No PATCH envie
só o que muda. Anexos em agendamentos ainda são feitos só pela plataforma; os que já existem são mantidos.
Exemplos de código — agendar whatsapp
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"channel_id": 44,
"contact_ids": [5120],
"message": "Olá, {{nome}}! Sua proposta está pronta.",
"scheduled_to": "2026-11-10T09:00:00-03:00"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"channel_id": 44,
"contact_ids": [5120],
"message": "Olá, {{nome}}! Sua proposta está pronta.",
"scheduled_to": "2026-11-10T09:00:00-03:00"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'channel_id': 44,
'contact_ids': [5120],
'message': 'Olá, {{nome}}! Sua proposta está pronta.',
'scheduled_to': '2026-11-10T09:00:00-03:00'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'channel_id' => 44,
'contact_ids' => [5120],
'message' => 'Olá, {{nome}}! Sua proposta está pronta.',
'scheduled_to' => '2026-11-10T09:00:00-03:00'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/whatsapp-schedules', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'channel_id' => 44,
'contact_ids' => [5120],
'message' => 'Olá, {{nome}}! Sua proposta está pronta.',
'scheduled_to' => '2026-11-10T09:00:00-03:00'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"channel_id": 44,
"contact_ids": [5120],
"message": "Olá, {{nome}}! Sua proposta está pronta.",
"scheduled_to": "2026-11-10T09:00:00-03:00"
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 3310,
"business_id": 8841,
"pipeline_id": 12,
"channel_id": 44,
"message": "Olá, {{nome}}! Sua proposta está pronta.",
"template_id": null,
"variable_values": null,
"button_variable_values": null,
"scheduled_to": "2026-11-10T09:00:00-03:00",
"status": "pending",
"processed_at": null,
"error_message": null,
"contacts": [
{
"id": 5120,
"name": "Maria Cliente"
}
],
"files": [],
"author": {
"id": 90,
"name": "Integração ERP"
},
"created_at": "2026-11-04T16:30:00-03:00",
"updated_at": "2026-11-04T16:30:00-03:00"
}
}
Exemplos de código — listar agendamentos de whatsapp
curl "https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses/8841/whatsapp-schedules', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 3310,
"business_id": 8841,
"pipeline_id": 12,
"channel_id": 44,
"message": "Olá, {{nome}}! Sua proposta está pronta.",
"template_id": null,
"variable_values": null,
"button_variable_values": null,
"scheduled_to": "2026-11-10T09:00:00-03:00",
"status": "pending",
"processed_at": null,
"error_message": null,
"contacts": [
{
"id": 5120,
"name": "Maria Cliente"
}
],
"files": [],
"author": {
"id": 90,
"name": "Integração ERP"
},
"created_at": "2026-11-04T16:30:00-03:00",
"updated_at": "2026-11-04T16:30:00-03:00"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
}
}
Exemplos de código — editar agendamento de whatsapp
curl -X PATCH "https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules/3310" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"scheduled_to": "2026-11-11T14:00:00-03:00"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules/3310', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"scheduled_to": "2026-11-11T14:00:00-03:00"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules/3310',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'scheduled_to': '2026-11-11T14:00:00-03:00'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules/3310');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'scheduled_to' => '2026-11-11T14:00:00-03:00'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/businesses/8841/whatsapp-schedules/3310', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'scheduled_to' => '2026-11-11T14:00:00-03:00'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"scheduled_to": "2026-11-11T14:00:00-03:00"
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules/3310", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 3310,
"business_id": 8841,
"pipeline_id": 12,
"channel_id": 44,
"message": "Olá, {{nome}}! Sua proposta está pronta.",
"template_id": null,
"variable_values": null,
"button_variable_values": null,
"scheduled_to": "2026-11-11T14:00:00-03:00",
"status": "pending",
"processed_at": null,
"error_message": null,
"contacts": [
{
"id": 5120,
"name": "Maria Cliente"
}
],
"files": [],
"author": {
"id": 90,
"name": "Integração ERP"
},
"created_at": "2026-11-04T16:30:00-03:00",
"updated_at": "2026-11-04T16:30:00-03:00"
}
}
Exemplos de código — cancelar agendamento de whatsapp
curl -X DELETE "https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules/3310" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules/3310', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules/3310',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules/3310');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/businesses/8841/whatsapp-schedules/3310', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/businesses/8841/whatsapp-schedules/3310", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Agendamentos de e-mail
Agenda um e-mail para contatos do negócio, enviado pelos domínios validados da empresa. O remetente
(sender) precisa ser um dos endereços de GET /crm/email-senders.
Exemplos de código — remetentes disponíveis
curl "https://api.atys.pro/api/v1/crm/email-senders" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/email-senders', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/email-senders',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/email-senders');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/email-senders', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/email-senders", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"email": "vendas@loja.com.br",
"domain_id": 9
}
]
}
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
sender | Sim | Remetente (invalid_sender se não for da empresa). | |
subject | string | Sim | Assunto; aceita variáveis. |
message | string (HTML) | Sim | Corpo do e-mail; aceita variáveis. |
contact_ids | array de integer | Sim | Destinatários (1 a 50). Contato sem e-mail é pulado no envio. |
scheduled_to | data ISO 8601 | Sim | Quando enviar. |
reply_to | Não | Endereço de resposta. |
status é pending até o envio e sent depois; só pending pode ser editado.
Exemplos de código — agendar e-mail
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"sender": "vendas@loja.com.br",
"reply_to": "carlos@loja.com.br",
"subject": "Sua proposta, {{nome}}",
"message": "<p>Segue a proposta combinada.</p>",
"contact_ids": [5120],
"scheduled_to": "2026-11-10T09:00:00-03:00"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"sender": "vendas@loja.com.br",
"reply_to": "carlos@loja.com.br",
"subject": "Sua proposta, {{nome}}",
"message": "<p>Segue a proposta combinada.</p>",
"contact_ids": [5120],
"scheduled_to": "2026-11-10T09:00:00-03:00"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'sender': 'vendas@loja.com.br',
'reply_to': 'carlos@loja.com.br',
'subject': 'Sua proposta, {{nome}}',
'message': '<p>Segue a proposta combinada.</p>',
'contact_ids': [5120],
'scheduled_to': '2026-11-10T09:00:00-03:00'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'sender' => 'vendas@loja.com.br',
'reply_to' => 'carlos@loja.com.br',
'subject' => 'Sua proposta, {{nome}}',
'message' => '<p>Segue a proposta combinada.</p>',
'contact_ids' => [5120],
'scheduled_to' => '2026-11-10T09:00:00-03:00'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/email-schedules', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'sender' => 'vendas@loja.com.br',
'reply_to' => 'carlos@loja.com.br',
'subject' => 'Sua proposta, {{nome}}',
'message' => '<p>Segue a proposta combinada.</p>',
'contact_ids' => [5120],
'scheduled_to' => '2026-11-10T09:00:00-03:00'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"sender": "vendas@loja.com.br",
"reply_to": "carlos@loja.com.br",
"subject": "Sua proposta, {{nome}}",
"message": "<p>Segue a proposta combinada.</p>",
"contact_ids": [5120],
"scheduled_to": "2026-11-10T09:00:00-03:00"
}`)
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 912,
"business_id": 8841,
"pipeline_id": 12,
"sender": "vendas@loja.com.br",
"reply_to": "carlos@loja.com.br",
"subject": "Sua proposta, {{nome}}",
"message": "<p>Segue a proposta combinada.</p>",
"scheduled_to": "2026-11-10T09:00:00-03:00",
"status": "pending",
"contacts": [
{
"id": 5120,
"name": "Maria Cliente"
}
],
"files": [],
"created_at": "2026-11-04T16:31:00-03:00",
"updated_at": "2026-11-04T16:31:00-03:00"
}
}
Exemplos de código — listar agendamentos de e-mail
curl "https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses/8841/email-schedules', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 912,
"business_id": 8841,
"pipeline_id": 12,
"sender": "vendas@loja.com.br",
"reply_to": "carlos@loja.com.br",
"subject": "Sua proposta, {{nome}}",
"message": "<p>Segue a proposta combinada.</p>",
"scheduled_to": "2026-11-10T09:00:00-03:00",
"status": "pending",
"contacts": [
{
"id": 5120,
"name": "Maria Cliente"
}
],
"files": [],
"created_at": "2026-11-04T16:31:00-03:00",
"updated_at": "2026-11-04T16:31:00-03:00"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
}
}
Exemplos de código — editar agendamento de e-mail
curl -X PATCH "https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules/912" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"subject": "Proposta revisada, {{nome}}"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules/912', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"subject": "Proposta revisada, {{nome}}"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules/912',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'subject': 'Proposta revisada, {{nome}}'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules/912');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'subject' => 'Proposta revisada, {{nome}}'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/businesses/8841/email-schedules/912', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'subject' => 'Proposta revisada, {{nome}}'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"subject": "Proposta revisada, {{nome}}"
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules/912", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 912,
"business_id": 8841,
"pipeline_id": 12,
"sender": "vendas@loja.com.br",
"reply_to": "carlos@loja.com.br",
"subject": "Proposta revisada, {{nome}}",
"message": "<p>Segue a proposta combinada.</p>",
"scheduled_to": "2026-11-10T09:00:00-03:00",
"status": "pending",
"contacts": [
{
"id": 5120,
"name": "Maria Cliente"
}
],
"files": [],
"created_at": "2026-11-04T16:31:00-03:00",
"updated_at": "2026-11-04T16:31:00-03:00"
}
}
Exemplos de código — cancelar agendamento de e-mail
curl -X DELETE "https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules/912" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules/912', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules/912',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules/912');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/businesses/8841/email-schedules/912', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/businesses/8841/email-schedules/912", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Pastas de documentos
A aba Documentos do negócio: pastas com nome, descrição e arquivos. Os arquivos vão para
o armazenamento da empresa (Google Drive, se conectado). Por envio: até 20 arquivos e 50 MB no total;
tipos aceitos: PDF, Office/OpenDocument, TXT, CSV, RTF, JPG, PNG, WEBP, HEIC e ZIP. Se um arquivo falhar,
nada do envio é gravado (document_rejected).
Criar a pasta aceita JSON (sem arquivos) ou multipart/form-data com name,
description e files[]:
Exemplos de código — criar pasta com arquivos
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/document-folders" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-F "name=Contratos" \
-F "description=Versões assinadas" \
-F "files[]=@contrato.pdf"
const form = new FormData();
form.append('name', 'Contratos');
form.append('description', 'Versões assinadas');
form.append('files[]', fileInput.files[0]); // ou new Blob([...]), 'contrato.pdf'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/document-folders', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
},
body: form // não defina Content-Type: o navegador/Node põe o boundary
});
const { data, error } = await response.json();
import os
import requests
with open('contrato.pdf', 'rb') as f:
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/document-folders',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
files={'files[]': f},
data={'name': 'Contratos', 'description': 'Versões assinadas'}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/document-folders');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
CURLOPT_POSTFIELDS => [
'name' => 'Contratos',
'description' => 'Versões assinadas',
'files[]' => new CURLFile('contrato.pdf'),
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/document-folders', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'multipart' => [
['name' => 'name', 'contents' => 'Contratos'],
['name' => 'description', 'contents' => 'Versões assinadas'],
['name' => 'files[]', 'contents' => fopen('contrato.pdf', 'r'), 'filename' => 'contrato.pdf'],
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"io"
"mime/multipart"
"net/http"
"os"
)
func main() {
var body bytes.Buffer
form := multipart.NewWriter(&body)
form.WriteField("name", "Contratos")
form.WriteField("description", "Versões assinadas")
part, _ := form.CreateFormFile("files[]", "contrato.pdf")
file, _ := os.Open("contrato.pdf")
defer file.Close()
io.Copy(part, file)
form.Close()
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/document-folders", &body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", form.FormDataContentType())
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 402,
"business_id": 8841,
"pipeline_id": 12,
"name": "Contratos",
"description": "Versões assinadas",
"author": {
"id": 90,
"name": "Integração ERP"
},
"files": [
{
"id": 7781,
"name": "contrato.pdf",
"size": 182044,
"url": "https://files.atys.pro/storage/files/company-310/crm-businesses-document-folders-files/402/contrato.pdf",
"created_at": "2026-11-04T16:40:00-03:00"
}
],
"created_at": "2026-11-04T16:40:00-03:00",
"updated_at": "2026-11-04T16:40:00-03:00"
}
}
Exemplos de código — listar pastas
curl "https://api.atys.pro/api/v1/crm/businesses/8841/document-folders" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/document-folders', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses/8841/document-folders',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/document-folders');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses/8841/document-folders', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses/8841/document-folders", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 402,
"business_id": 8841,
"pipeline_id": 12,
"name": "Contratos",
"description": "Versões assinadas",
"author": {
"id": 90,
"name": "Integração ERP"
},
"files": [
{
"id": 7781,
"name": "contrato.pdf",
"size": 182044,
"url": "https://files.atys.pro/storage/files/company-310/crm-businesses-document-folders-files/402/contrato.pdf",
"created_at": "2026-11-04T16:40:00-03:00"
}
],
"created_at": "2026-11-04T16:40:00-03:00",
"updated_at": "2026-11-04T16:40:00-03:00"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
}
}
Exemplos de código — renomear pasta
curl -X PATCH "https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Contratos 2026"
}'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Contratos 2026"
})
});
const { data, error } = await response.json();
import os
import requests
response = requests.patch(
'https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
json={
'name': 'Contratos 2026'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Contratos 2026'
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('PATCH', 'v1/crm/businesses/8841/document-folders/402', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'json' => [
'name' => 'Contratos 2026'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Contratos 2026"
}`)
req, _ := http.NewRequest("PATCH", "https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 402,
"business_id": 8841,
"pipeline_id": 12,
"name": "Contratos 2026",
"description": "Versões assinadas",
"author": {
"id": 90,
"name": "Integração ERP"
},
"files": [
{
"id": 7781,
"name": "contrato.pdf",
"size": 182044,
"url": "https://files.atys.pro/storage/files/company-310/crm-businesses-document-folders-files/402/contrato.pdf",
"created_at": "2026-11-04T16:40:00-03:00"
}
],
"created_at": "2026-11-04T16:40:00-03:00",
"updated_at": "2026-11-04T16:40:00-03:00"
}
}
Para acrescentar arquivos a uma pasta existente, envie files[] em multipart; a resposta é a pasta com todos os arquivos.
Exemplos de código — adicionar arquivos à pasta
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402/files" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-F "files[]=@aditivo.pdf"
const form = new FormData();
form.append('files[]', fileInput.files[0]); // ou new Blob([...]), 'aditivo.pdf'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402/files', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
},
body: form // não defina Content-Type: o navegador/Node põe o boundary
});
const { data, error } = await response.json();
import os
import requests
with open('aditivo.pdf', 'rb') as f:
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402/files',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
files={'files[]': f}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402/files');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
CURLOPT_POSTFIELDS => [
'files[]' => new CURLFile('aditivo.pdf'),
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/document-folders/402/files', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'multipart' => [
['name' => 'files[]', 'contents' => fopen('aditivo.pdf', 'r'), 'filename' => 'aditivo.pdf'],
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"io"
"mime/multipart"
"net/http"
"os"
)
func main() {
var body bytes.Buffer
form := multipart.NewWriter(&body)
part, _ := form.CreateFormFile("files[]", "aditivo.pdf")
file, _ := os.Open("aditivo.pdf")
defer file.Close()
io.Copy(part, file)
form.Close()
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402/files", &body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", form.FormDataContentType())
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 402,
"business_id": 8841,
"pipeline_id": 12,
"name": "Contratos",
"description": "Versões assinadas",
"author": {
"id": 90,
"name": "Integração ERP"
},
"files": [
{
"id": 7781,
"name": "contrato.pdf",
"size": 182044,
"url": "https://files.atys.pro/storage/files/company-310/crm-businesses-document-folders-files/402/contrato.pdf",
"created_at": "2026-11-04T16:40:00-03:00"
},
{
"id": 7790,
"name": "aditivo.pdf",
"size": 182044,
"url": "https://files.atys.pro/storage/files/company-310/crm-businesses-document-folders-files/402/contrato.pdf",
"created_at": "2026-11-04T16:40:00-03:00"
}
],
"created_at": "2026-11-04T16:40:00-03:00",
"updated_at": "2026-11-04T16:40:00-03:00"
}
}
Exemplos de código — remover arquivo da pasta
curl -X DELETE "https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402/files/7781" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402/files/7781', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402/files/7781',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402/files/7781');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/businesses/8841/document-folders/402/files/7781', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402/files/7781", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Exemplos de código — excluir pasta e arquivos
curl -X DELETE "https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/businesses/8841/document-folders/402', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/businesses/8841/document-folders/402", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Anexos de notas e tarefas
Anexe arquivos a uma nota ou tarefa, um por chamada, no campo
file em multipart/form-data. Mesmos tipos e limite das
pastas de documentos (invalid_file). Editar a nota ou a tarefa pela
API não mexe nos anexos. Notas geradas pela plataforma não recebem anexos (note_locked).
Exemplos de código — anexar arquivo à nota
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-F "file=@proposta.pdf"
const form = new FormData();
form.append('file', fileInput.files[0]); // ou new Blob([...]), 'proposta.pdf'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
},
body: form // não defina Content-Type: o navegador/Node põe o boundary
});
const { data, error } = await response.json();
import os
import requests
with open('proposta.pdf', 'rb') as f:
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
files={'file': f}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
CURLOPT_POSTFIELDS => [
'file' => new CURLFile('proposta.pdf'),
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/notes/5120/files', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'multipart' => [
['name' => 'file', 'contents' => fopen('proposta.pdf', 'r'), 'filename' => 'proposta.pdf'],
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"io"
"mime/multipart"
"net/http"
"os"
)
func main() {
var body bytes.Buffer
form := multipart.NewWriter(&body)
part, _ := form.CreateFormFile("file", "proposta.pdf")
file, _ := os.Open("proposta.pdf")
defer file.Close()
io.Copy(part, file)
form.Close()
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files", &body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", form.FormDataContentType())
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 655,
"name": "proposta.pdf",
"size": 98211,
"url": "https://files.atys.pro/storage/files/company-310/crm-businesses-observations-files/5120/proposta.pdf",
"created_at": "2026-11-04T16:45:00-03:00"
}
}
Exemplos de código — listar anexos da nota
curl "https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses/8841/notes/5120/files', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 655,
"name": "proposta.pdf",
"size": 98211,
"url": "https://files.atys.pro/storage/files/company-310/crm-businesses-observations-files/5120/proposta.pdf",
"created_at": "2026-11-04T16:45:00-03:00"
}
]
}
Exemplos de código — remover anexo da nota
curl -X DELETE "https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files/655" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files/655', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files/655',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files/655');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/businesses/8841/notes/5120/files/655', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/businesses/8841/notes/5120/files/655", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Nas tarefas é igual, trocando notes/{noteId} por tasks/{taskId}:
Exemplos de código — anexar arquivo à tarefa
curl -X POST "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json" \
-F "file=@contrato.pdf"
const form = new FormData();
form.append('file', fileInput.files[0]); // ou new Blob([...]), 'contrato.pdf'
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
},
body: form // não defina Content-Type: o navegador/Node põe o boundary
});
const { data, error } = await response.json();
import os
import requests
with open('contrato.pdf', 'rb') as f:
response = requests.post(
'https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
},
files={'file': f}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
CURLOPT_POSTFIELDS => [
'file' => new CURLFile('contrato.pdf'),
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('POST', 'v1/crm/businesses/8841/tasks/731/files', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'multipart' => [
['name' => 'file', 'contents' => fopen('contrato.pdf', 'r'), 'filename' => 'contrato.pdf'],
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"bytes"
"io"
"mime/multipart"
"net/http"
"os"
)
func main() {
var body bytes.Buffer
form := multipart.NewWriter(&body)
part, _ := form.CreateFormFile("file", "contrato.pdf")
file, _ := os.Open("contrato.pdf")
defer file.Close()
io.Copy(part, file)
form.Close()
req, _ := http.NewRequest("POST", "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files", &body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", form.FormDataContentType())
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"id": 702,
"name": "contrato.pdf",
"size": 98211,
"url": "https://files.atys.pro/storage/files/company-310/crm-businesses-tasks-files/731/contrato.pdf",
"created_at": "2026-11-04T16:45:00-03:00"
}
}
Exemplos de código — listar anexos da tarefa
curl "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/businesses/8841/tasks/731/files', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"id": 702,
"name": "contrato.pdf",
"size": 98211,
"url": "https://files.atys.pro/storage/files/company-310/crm-businesses-observations-files/5120/proposta.pdf",
"created_at": "2026-11-04T16:45:00-03:00"
}
]
}
Exemplos de código — remover anexo da tarefa
curl -X DELETE "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files/702" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files/702', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
console.log(response.status); // 204 = excluído
import os
import requests
response = requests.delete(
'https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files/702',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
print(response.status_code) # 204 = excluído
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files/702');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('DELETE', 'v1/crm/businesses/8841/tasks/731/files/702', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.atys.pro/api/v1/crm/businesses/8841/tasks/731/files/702", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
Métricas disponíveis
Os números da tela Relatórios do pipeline também estão na API, com o mesmo cálculo. Em vez
de um endpoint por gráfico, há um só: você escolhe a métrica pelo nome. Esta chamada lista as métricas que
o pipeline aceita, com a descrição e os filtros de cada uma. A chave só vê os pipelines a que o usuário API
tem acesso; pipeline de fora volta 404.
Exemplos de código — listar as métricas do pipeline
curl "https://api.atys.pro/api/v1/crm/pipelines/12/reports" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/reports', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/pipelines/12/reports',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/reports');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/pipelines/12/reports', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/pipelines/12/reports", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": [
{
"metric": "deal-kpi-summary",
"name": "Resumo de negócios",
"description": "Quantidade de negócios ganhos, perdidos e em aberto e valor somado das etapas abertas.",
"filters": [
"date_from",
"date_to",
"user_ids",
"stage_ids",
"source_ids",
"tag_ids",
"lost_reason_ids",
"priority_id",
"scope",
"archived"
]
},
{
"metric": "conversion-rate",
"name": "Taxa de conversão",
"description": "Negócios ganhos ÷ negócios do pipeline (decimal: 0.25 = 25%).",
"filters": [
"date_from",
"date_to",
"user_ids",
"stage_ids",
"source_ids",
"tag_ids",
"lost_reason_ids",
"priority_id",
"scope",
"archived"
]
},
{
"metric": "crm-volume",
"name": "Volume por etapa",
"description": "Entradas em cada etapa por dia (ou por hora, se o período tiver até 24 h). Período = data de entrada na etapa.",
"filters": [
"date_from",
"date_to"
]
}
],
"meta": {
"pipeline_id": 12
}
}
Consultar uma métrica
Troque {metric} pelo nome da métrica (tabela abaixo). A resposta traz o resultado em
data e, em meta, a métrica, o pipeline e os filtros que foram aplicados. O
conteúdo de data é o mesmo que a tela usa para desenhar o card ou o gráfico: KPIs vêm como
objeto com nomes em camelCase (globalConversion, wonDealCount...); gráficos vêm
no formato de séries da tela (por exemplo labels + data, ou
categories + series). Taxas de conversion-rate e loss-rate
são decimais (0.25 = 25%); as taxas por etapa e por responsável já vêm em porcentagem. Valores em dinheiro
usam o campo Valor do negócio, na mesma unidade gravada nele.
Exemplos de código — consultar uma métrica
curl "https://api.atys.pro/api/v1/crm/pipelines/12/reports/conversion-rate?date_from=2026-10-01&date_to=2026-10-31&user_ids=77%2C78" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/pipelines/12/reports/conversion-rate?date_from=2026-10-01&date_to=2026-10-31&user_ids=77%2C78', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/pipelines/12/reports/conversion-rate?date_from=2026-10-01&date_to=2026-10-31&user_ids=77%2C78',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/pipelines/12/reports/conversion-rate?date_from=2026-10-01&date_to=2026-10-31&user_ids=77%2C78');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/pipelines/12/reports/conversion-rate', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'query' => [
'date_from' => '2026-10-01',
'date_to' => '2026-10-31',
'user_ids' => '77,78'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/pipelines/12/reports/conversion-rate?date_from=2026-10-01&date_to=2026-10-31&user_ids=77%2C78", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"globalConversion": 0.3125,
"conversionTarget": 0.25,
"totalBusinesses": 48,
"wonBusinesses": 15
},
"meta": {
"metric": "conversion-rate",
"pipeline_id": 12,
"filters": {
"date_from": "2026-10-01",
"date_to": "2026-10-31",
"user_ids": [
77,
78
]
}
}
}
Um gráfico, por exemplo negócios por origem, sai assim:
{
"data": {
"data": [
21,
15,
12
],
"labels": [
"Site",
"WhatsApp",
"Manual"
]
},
"meta": {
"metric": "source-distribution",
"pipeline_id": 12,
"filters": {}
}
}
Filtros
Todos opcionais e combináveis, os mesmos do Filtro avançado da tela de relatórios. Listas
aceitam user_ids[]=77&user_ids[]=78 ou user_ids=77,78.
| Parâmetro | O que faz |
|---|---|
date_from, date_to | Período, sempre os dois juntos. Data (2026-10-01, dia inteiro) ou data e hora ISO 8601. Na maioria das métricas filtra pela data de criação do negócio; em follow-up é a data do envio e em crm-volume a data de entrada na etapa. |
user_ids | Só negócios de que algum desses usuários é responsável. |
stage_ids | Só negócios que estão nessas etapas. |
source_ids | Só negócios dessas origens (catálogo de origens). |
tag_ids | Só negócios com pelo menos uma dessas etiquetas. |
lost_reason_ids | Só negócios perdidos com esses motivos. |
priority_id | Só negócios dessa prioridade. |
scope | all (padrão), won (só negócios na etapa de ganho) ou lost (só na etapa de perda). |
archived | true calcula sobre os negócios arquivados em vez dos ativos. |
Métricas
Em Filtros, "Todos" = a tabela acima inteira; "Período" = só date_from e
date_to. Um nome fora desta lista volta 404 com o código unknown_report.
| metric | O que mede | Filtros |
|---|---|---|
deal-kpi-summary | Quantidade de negócios ganhos, perdidos e em aberto e valor somado das etapas abertas. | Todos |
total-business-count | Quantidade de negócios no pipeline. | Todos |
total-value-of-business | Soma e média do campo "Valor" de todos os negócios do pipeline. | Todos |
total-value-won-stage | Soma e média do valor dos negócios na etapa de ganho. | Todos |
total-value-lost-stage | Soma e média do valor dos negócios na etapa de perda. | Todos |
conversion-rate | Negócios ganhos ÷ negócios do pipeline (decimal: 0.25 = 25%). | Todos |
loss-rate | Negócios perdidos ÷ negócios do pipeline (decimal). | Todos |
average-ticket | Valor médio dos negócios ganhos. | Todos |
velocity | Tempo médio, em horas, da criação até a venda dos negócios ganhos. | Todos |
full-cycle-time | Tempo médio de ciclo, em horas, dos negócios ganhos e dos perdidos. | Todos |
business-count-by-stage | Quantidade de negócios em cada etapa (funil). | Todos |
revenue-by-stage | Valor somado dos negócios em cada etapa. | Todos |
stage-conversion | Dos negócios que entraram em cada etapa, quantos avançaram para uma etapa posterior (%). | Todos |
conversion-heatmap | Taxa de avanço por etapa e por semana. | Todos |
stage-duration | Mediana (e média) do tempo de permanência em cada etapa aberta. | Todos |
stage-time-distribution | Negócios por faixa de tempo de permanência em cada etapa. | Todos |
time-to-first-move | Tempo entre a criação do negócio e a primeira mudança de etapa. | Todos |
stalled-deals | Negócios parados numa etapa além do tempo esperado (média + 2 desvios, ou 7 dias). | Todos |
backward-movement-rate | Negócios que voltaram para uma etapa anterior ÷ negócios movimentados; reaberturas à parte. | Todos |
backward-movement-flow | Movimentações para trás por etapa de origem e destino. | Todos |
source-distribution | Quantidade de negócios por origem. | Todos |
won-source-distribution | Origem dos negócios na etapa de ganho. | Todos |
lost-source-distribution | Origem dos negócios na etapa de perda. | Todos |
business-count-by-tag | Quantidade de negócios por etiqueta (um negócio conta em cada etiqueta que tem). | Todos |
value-by-tag | Valor somado dos negócios por etiqueta. | Todos |
sales-by-campaign | Negócios, ganhos, perdidos e valor por campanha de origem (tráfego pago). | Todos |
business-count-by-user | Quantidade de negócios de cada responsável. | Todos |
revenue-by-user | Valor somado dos negócios de cada responsável. | Todos |
user-conversion-rate | Ganhos ÷ (ganhos + perdidos) de cada responsável (%). | Todos |
user-loss-rate | Perdidos ÷ (ganhos + perdidos) de cada responsável (%). | Todos |
stage-user-business-heatmap | Mapa de calor: quantidade de negócios por etapa (colunas) e responsável (linhas). | Todos |
follow-up | Tentativas, respostas e avanços do follow-up do agente de IA. Período = data do envio (padrão: últimos 30 dias). | Todos |
crm-volume | Entradas em cada etapa por dia (ou por hora, se o período tiver até 24 h). Período = data de entrada na etapa. | Período |
Os cards da tela que ainda mostram valores de exemplo (CAC/LTV, CPL por canal, satisfação, tendência,
cascata e motivos de perda do gráfico) não estão na API. Para os motivos de perda de verdade, filtre com
lost_reason_ids ou liste os negócios perdidos em listar negócios.
Indicadores gerais do CRM
Os indicadores de CRM do Painel geral: totais da empresa toda (não de um pipeline). Com
período, pipelines_count, businesses_count e a contagem por pipeline usam a data
de criação; average_ticket_won e average_cycle_hours_won usam a data da venda e
consideram só os pipelines do tipo funil de vendas. Sem período, tudo. Em
businesses_by_pipeline aparecem só os pipelines que o usuário API enxerga.
Exemplos de código — indicadores gerais do crm
curl "https://api.atys.pro/api/v1/crm/reports/summary?date_from=2026-10-01&date_to=2026-10-31" \
-H "Authorization: Bearer atys_live_SUA_CHAVE" \
-H "Accept: application/json"
const response = await fetch('https://api.atys.pro/api/v1/crm/reports/summary?date_from=2026-10-01&date_to=2026-10-31', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ATYS_API_KEY}`,
'Accept': 'application/json'
}
});
const { data, error } = await response.json();
import os
import requests
response = requests.get(
'https://api.atys.pro/api/v1/crm/reports/summary?date_from=2026-10-01&date_to=2026-10-31',
headers={
'Authorization': f"Bearer {os.environ['ATYS_API_KEY']}",
'Accept': 'application/json'
}
)
result = response.json()
<?php
$ch = curl_init('https://api.atys.pro/api/v1/crm/reports/summary?date_from=2026-10-01&date_to=2026-10-31');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('ATYS_API_KEY'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.atys.pro/api/']);
$response = $client->request('GET', 'v1/crm/reports/summary', [
'headers' => [
'Authorization' => 'Bearer '.getenv('ATYS_API_KEY'),
'Accept' => 'application/json',
],
'query' => [
'date_from' => '2026-10-01',
'date_to' => '2026-10-31'
],
]);
$result = json_decode($response->getBody(), true);
package main
import (
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.atys.pro/api/v1/crm/reports/summary?date_from=2026-10-01&date_to=2026-10-31", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ATYS_API_KEY"))
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
}
{
"data": {
"pipelines_count": 3,
"businesses_count": 214,
"average_ticket_won": 4850.5,
"average_cycle_hours_won": 196.400000000000005684341886080801486968994140625,
"businesses_by_pipeline": [
{
"pipeline_id": 12,
"name": "Vendas B2B",
"businesses_count": 132
},
{
"pipeline_id": 14,
"name": "Pós-venda",
"businesses_count": 82
}
]
},
"meta": {
"filters": {
"date_from": "2026-10-01",
"date_to": "2026-10-31"
}
}
}
Erros
Todo erro da v1 tem o mesmo formato: {"error": {"code", "message", "details"}}. Use o
code no seu tratamento; a message é para leitura humana.
422 validation_failed — dados inválidos
Campo obrigatório ausente ou com formato errado. details traz os erros por campo.
{
"error": {
"code": "validation_failed",
"message": "The title field is required.",
"details": { "title": ["The title field is required."] }
}
}
422 mandatory_fields_missing / required_tasks_pending
A etapa de destino exige campos ou tarefas que o negócio ainda não tem.
{
"error": {
"code": "mandatory_fields_missing",
"message": "Não é possível mover o negócio para a etapa \"Proposta\". Complete os campos obrigatórios.",
"details": {
"stage_name": "Proposta",
"missing_fields": [ { "id": 55, "name": "Valor" } ]
}
}
}
422 unknown_custom_field / invalid_owner / invalid_tag / invalid_assignee
Campo personalizado de outro pipeline, responsável ou dono de tarefa que não é da empresa, ou etiqueta que o usuário API não pode usar.
422 closing_stage_missing / note_locked
Pipeline sem etapa de ganho/perda, ou nota gerada pela plataforma (não editável).
404 not_found
O negócio, pipeline, etapa, nota ou tarefa não existe ou não é visível para a chave.
403 forbidden
A chave não tem a permissão de CRM necessária (por exemplo, excluir sem Excluir negócios do CRM), ou o usuário API não tem acesso ao módulo.
401 unauthenticated
Chave ausente, inválida, revogada ou expirada.
Webhooks
Para ser avisado em vez de consultar, assine os eventos do CRM em
Webhooks: crm.business.created,
crm.business.updated, crm.business.stage_changed, crm.business.won,
crm.business.lost e crm.business.archived. Ações feitas pela API também disparam
esses eventos e as automações (workflows) da plataforma — inclusive as que reagem a notas e tarefas.