Negócios (Deals)
O recurso Negócio (deal) representa uma oportunidade de venda. Cada negócio pertence a um pipeline (pipeline_id) e ocupa um estágio (stage_id) até ser ganho ou perdido. A empresa (tenant) é resolvida automaticamente a partir do token — ver Autenticação.
Identificadores de negócio usam o prefixo deal_ (ex.: deal_01J9Z3K8). Os códigos de erro são detalhados em Erros e os limites de requisição em Rate limiting.
Esquema do recurso
Seção intitulada “Esquema do recurso”| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
id | string | leitura | Identificador prefixado (deal_). |
title | string | sim | Título do negócio. Entre 2 e 150 caracteres. |
value | integer | não | Valor em centavos. Padrão: 0. Ex.: 1500000 = R$ 15.000,00. |
currency | string | não | Código da moeda (ISO 4217). Padrão: BRL. |
probability | integer | não | Probabilidade de fechamento, de 0 a 100. |
status | string | leitura | Situação do negócio: open, won ou lost. |
pipeline_id | string | sim | Pipeline ao qual o negócio pertence (pipe_). |
stage_id | string | sim | Estágio atual do negócio (stg_). Deve pertencer ao pipeline. |
contact_id | string | não | Contato vinculado (cont_). Deve pertencer à mesma empresa. |
company_id | string | não | Empresa CRM vinculada (comp_). Deve pertencer à mesma empresa. |
owner_id | string | não | Usuário responsável (user_). Deve pertencer à mesma empresa. |
expected_close_date | string (date) | não | Data prevista de fechamento (YYYY-MM-DD). |
won_at | string (ISO-8601) | leitura | Data/hora em que foi ganho. null enquanto não ganho. |
lost_at | string (ISO-8601) | leitura | Data/hora em que foi perdido. null enquanto não perdido. |
lost_reason | string | leitura | Motivo da perda. null enquanto não perdido. |
tags | string[] | não | Lista de etiquetas. |
created_at | string (ISO-8601) | leitura | Data de criação. |
updated_at | string (ISO-8601) | leitura | Data da última atualização. |
Listar negócios
Seção intitulada “Listar negócios”Retorna a coleção paginada de negócios. Aceita os parâmetros comuns de paginação, busca e ordenação, além dos filtros específicos abaixo.
Listar negócios
Lista os negócios da empresa com paginação, busca e filtros.
Parâmetros de query
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
page | integer | — | Página atual (padrão: 1). |
per_page | integer | — | Itens por página (padrão: 20, máx: 100). |
search | string | — | Busca textual no título do negócio. |
sort | string | — | Campo de ordenação (ex.: value, probability, created_at). |
direction | string | — | Direção da ordenação: asc ou desc. |
status | string | — | Filtra por situação: open, won ou lost. |
pipeline_id | string | — | Filtra pelos negócios de um pipeline. |
stage_id | string | — | Filtra pelos negócios de um estágio. |
contact_id | string | — | Filtra pelos negócios de um contato. |
company_id | string | — | Filtra pelos negócios de uma empresa CRM. |
owner_id | string | — | Filtra pelos negócios de um responsável. |
curl -X GET https://api.maestron.com.br/v1/crm/deals \
-H "Authorization: Bearer SEU_TOKEN" <?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.maestron.com.br/v1/crm/deals', [
'headers' => [
'Authorization' => 'Bearer SEU_TOKEN',
'Accept' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true); import requests
headers = {"Authorization": "Bearer SEU_TOKEN"}
response = requests.get(
"https://api.maestron.com.br/v1/crm/deals",
headers=headers,
)
data = response.json() const response = await fetch("https://api.maestron.com.br/v1/crm/deals", {
method: "GET",
headers: {
"Authorization": "Bearer SEU_TOKEN",
},
});
const data = await response.json(); using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "SEU_TOKEN");
var response = await client.GetAsync("https://api.maestron.com.br/v1/crm/deals");
var data = await response.Content.ReadAsStringAsync(); GET /crm/deals HTTP/1.1
Host: api.maestron.com.br
Authorization: Bearer SEU_TOKEN Respostas
{
"message": "Negócios listados.",
"data": [
{
"id": "deal_01J9Z3K8",
"title": "Licença Enterprise - Acme Corp",
"value": 1500000,
"currency": "BRL",
"probability": 60,
"status": "open",
"pipeline_id": "pipe_01J9Z3K8",
"stage_id": "stg_01J9Z3K8",
"contact_id": "cont_01J9Z3K8",
"company_id": "comp_01J9Z3K8",
"owner_id": "user_01J9Z3K8",
"expected_close_date": "2026-07-31",
"won_at": null,
"lost_at": null,
"lost_reason": null,
"tags": [
"enterprise",
"renovação"
],
"created_at": "2026-06-20T14:30:00Z",
"updated_at": "2026-06-20T14:30:00Z"
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 1,
"last_page": 1
}
} {
"message": "Não autenticado."
} Obter um negócio
Seção intitulada “Obter um negócio”Retorna um único negócio pelo seu identificador.
Obter negócio
Retorna os detalhes de um negócio específico.
Parâmetros de caminho
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
id | string | Sim | Identificador do negócio (deal_). |
curl -X GET https://api.maestron.com.br/v1/crm/deals/{id} \
-H "Authorization: Bearer SEU_TOKEN" <?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.maestron.com.br/v1/crm/deals/{id}', [
'headers' => [
'Authorization' => 'Bearer SEU_TOKEN',
'Accept' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true); import requests
headers = {"Authorization": "Bearer SEU_TOKEN"}
response = requests.get(
"https://api.maestron.com.br/v1/crm/deals/{id}",
headers=headers,
)
data = response.json() const response = await fetch("https://api.maestron.com.br/v1/crm/deals/{id}", {
method: "GET",
headers: {
"Authorization": "Bearer SEU_TOKEN",
},
});
const data = await response.json(); using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "SEU_TOKEN");
var response = await client.GetAsync("https://api.maestron.com.br/v1/crm/deals/{id}");
var data = await response.Content.ReadAsStringAsync(); GET /crm/deals/{id} HTTP/1.1
Host: api.maestron.com.br
Authorization: Bearer SEU_TOKEN Respostas
{
"message": "Negócio retornado.",
"data": {
"id": "deal_01J9Z3K8",
"title": "Licença Enterprise - Acme Corp",
"value": 1500000,
"currency": "BRL",
"probability": 60,
"status": "open",
"pipeline_id": "pipe_01J9Z3K8",
"stage_id": "stg_01J9Z3K8",
"contact_id": "cont_01J9Z3K8",
"company_id": "comp_01J9Z3K8",
"owner_id": "user_01J9Z3K8",
"expected_close_date": "2026-07-31",
"won_at": null,
"lost_at": null,
"lost_reason": null,
"tags": [
"enterprise",
"renovação"
],
"created_at": "2026-06-20T14:30:00Z",
"updated_at": "2026-06-20T14:30:00Z"
}
} {
"message": "Não autenticado."
} {
"message": "Negócio não encontrado."
} Criar negócio
Seção intitulada “Criar negócio”Cria um novo negócio. Os campos title, pipeline_id e stage_id são obrigatórios. O stage_id informado deve pertencer ao pipeline_id informado.
Criar negócio
Cria um novo negócio em um pipeline e estágio.
Corpo (body)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
title | string | Sim | Título do negócio. Entre 2 e 150 caracteres. |
value | integer | — | Valor em centavos. Padrão: 0. |
currency | string | — | Código da moeda (ISO 4217). Padrão: BRL. |
probability | integer | — | Probabilidade de fechamento, de 0 a 100. |
pipeline_id | string | Sim | Pipeline do negócio (pipe_). |
stage_id | string | Sim | Estágio do negócio (stg_), pertencente ao pipeline. |
contact_id | string | — | Contato vinculado (cont_). |
company_id | string | — | Empresa CRM vinculada (comp_). |
owner_id | string | — | Usuário responsável (user_). |
expected_close_date | string | — | Data prevista de fechamento (YYYY-MM-DD). |
tags | string[] | — | Lista de etiquetas. |
curl -X POST https://api.maestron.com.br/v1/crm/deals \
-H "Authorization: Bearer SEU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Licença Enterprise - Acme Corp",
"value": 1500000,
"currency": "BRL",
"probability": 60,
"pipeline_id": "pipe_01J9Z3K8",
"stage_id": "stg_01J9Z3K8",
"contact_id": "cont_01J9Z3K8",
"company_id": "comp_01J9Z3K8",
"owner_id": "user_01J9Z3K8",
"expected_close_date": "2026-07-31",
"tags": [
"enterprise",
"renovação"
]
}' <?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.maestron.com.br/v1/crm/deals', [
'headers' => [
'Authorization' => 'Bearer SEU_TOKEN',
'Accept' => 'application/json',
],
'json' => [
'title' => 'Licença Enterprise - Acme Corp',
'value' => 1500000,
'currency' => 'BRL',
'probability' => 60,
'pipeline_id' => 'pipe_01J9Z3K8',
'stage_id' => 'stg_01J9Z3K8',
'contact_id' => 'cont_01J9Z3K8',
'company_id' => 'comp_01J9Z3K8',
'owner_id' => 'user_01J9Z3K8',
'expected_close_date' => '2026-07-31',
'tags' => enterprise,renovação,
],
]);
$data = json_decode($response->getBody(), true); import requests
headers = {"Authorization": "Bearer SEU_TOKEN"}
payload = {
"title": "Licença Enterprise - Acme Corp",
"value": 1500000,
"currency": "BRL",
"probability": 60,
"pipeline_id": "pipe_01J9Z3K8",
"stage_id": "stg_01J9Z3K8",
"contact_id": "cont_01J9Z3K8",
"company_id": "comp_01J9Z3K8",
"owner_id": "user_01J9Z3K8",
"expected_close_date": "2026-07-31",
"tags": enterprise,renovação,
}
response = requests.post(
"https://api.maestron.com.br/v1/crm/deals",
headers=headers,
json=payload,
)
data = response.json() const response = await fetch("https://api.maestron.com.br/v1/crm/deals", {
method: "POST",
headers: {
"Authorization": "Bearer SEU_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"title": "Licença Enterprise - Acme Corp",
"value": 1500000,
"currency": "BRL",
"probability": 60,
"pipeline_id": "pipe_01J9Z3K8",
"stage_id": "stg_01J9Z3K8",
"contact_id": "cont_01J9Z3K8",
"company_id": "comp_01J9Z3K8",
"owner_id": "user_01J9Z3K8",
"expected_close_date": "2026-07-31",
"tags": [
"enterprise",
"renovação"
]
}),
});
const data = await response.json(); using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "SEU_TOKEN");
var payload = new StringContent(
"{\"title\":\"Licença Enterprise - Acme Corp\",\"value\":1500000,\"currency\":\"BRL\",\"probability\":60,\"pipeline_id\":\"pipe_01J9Z3K8\",\"stage_id\":\"stg_01J9Z3K8\",\"contact_id\":\"cont_01J9Z3K8\",\"company_id\":\"comp_01J9Z3K8\",\"owner_id\":\"user_01J9Z3K8\",\"expected_close_date\":\"2026-07-31\",\"tags\":[\"enterprise\",\"renovação\"]}",
System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.maestron.com.br/v1/crm/deals", payload);
var data = await response.Content.ReadAsStringAsync(); POST /crm/deals HTTP/1.1
Host: api.maestron.com.br
Authorization: Bearer SEU_TOKEN
Content-Type: application/json
{
"title": "Licença Enterprise - Acme Corp",
"value": 1500000,
"currency": "BRL",
"probability": 60,
"pipeline_id": "pipe_01J9Z3K8",
"stage_id": "stg_01J9Z3K8",
"contact_id": "cont_01J9Z3K8",
"company_id": "comp_01J9Z3K8",
"owner_id": "user_01J9Z3K8",
"expected_close_date": "2026-07-31",
"tags": [
"enterprise",
"renovação"
]
} Respostas
{
"message": "Negócio criado.",
"data": {
"id": "deal_01J9Z3K8",
"title": "Licença Enterprise - Acme Corp",
"value": 1500000,
"currency": "BRL",
"probability": 60,
"status": "open",
"pipeline_id": "pipe_01J9Z3K8",
"stage_id": "stg_01J9Z3K8",
"contact_id": "cont_01J9Z3K8",
"company_id": "comp_01J9Z3K8",
"owner_id": "user_01J9Z3K8",
"expected_close_date": "2026-07-31",
"won_at": null,
"lost_at": null,
"lost_reason": null,
"tags": [
"enterprise",
"renovação"
],
"created_at": "2026-06-20T14:30:00Z",
"updated_at": "2026-06-20T14:30:00Z"
}
} {
"message": "Não autenticado."
} {
"message": "Os dados informados são inválidos.",
"errors": {
"title": [
"O campo título é obrigatório."
],
"pipeline_id": [
"O campo pipeline_id é obrigatório."
],
"stage_id": [
"O estágio informado não pertence ao pipeline."
],
"probability": [
"A probabilidade deve estar entre 0 e 100."
]
}
} Atualizar negócio
Seção intitulada “Atualizar negócio”Atualiza parcialmente um negócio. Envie apenas os campos a alterar.
Atualizar negócio
Atualiza parcialmente os dados de um negócio.
Parâmetros de caminho
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
id | string | Sim | Identificador do negócio (deal_). |
Corpo (body)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
title | string | — | Título do negócio. Entre 2 e 150 caracteres. |
value | integer | — | Valor em centavos. |
currency | string | — | Código da moeda (ISO 4217). |
probability | integer | — | Probabilidade de fechamento, de 0 a 100. |
contact_id | string | — | Contato vinculado (cont_). |
company_id | string | — | Empresa CRM vinculada (comp_). |
owner_id | string | — | Usuário responsável (user_). |
expected_close_date | string | — | Data prevista de fechamento (YYYY-MM-DD). |
tags | string[] | — | Lista de etiquetas. |
curl -X PATCH https://api.maestron.com.br/v1/crm/deals/{id} \
-H "Authorization: Bearer SEU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Licença Enterprise - Acme Corp (revisado)",
"value": 1800000,
"probability": 75
}' <?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PATCH', 'https://api.maestron.com.br/v1/crm/deals/{id}', [
'headers' => [
'Authorization' => 'Bearer SEU_TOKEN',
'Accept' => 'application/json',
],
'json' => [
'title' => 'Licença Enterprise - Acme Corp (revisado)',
'value' => 1800000,
'probability' => 75,
],
]);
$data = json_decode($response->getBody(), true); import requests
headers = {"Authorization": "Bearer SEU_TOKEN"}
payload = {
"title": "Licença Enterprise - Acme Corp (revisado)",
"value": 1800000,
"probability": 75,
}
response = requests.patch(
"https://api.maestron.com.br/v1/crm/deals/{id}",
headers=headers,
json=payload,
)
data = response.json() const response = await fetch("https://api.maestron.com.br/v1/crm/deals/{id}", {
method: "PATCH",
headers: {
"Authorization": "Bearer SEU_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"title": "Licença Enterprise - Acme Corp (revisado)",
"value": 1800000,
"probability": 75
}),
});
const data = await response.json(); using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "SEU_TOKEN");
var payload = new StringContent(
"{\"title\":\"Licença Enterprise - Acme Corp (revisado)\",\"value\":1800000,\"probability\":75}",
System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(new HttpRequestMessage(
new HttpMethod("PATCH"), "https://api.maestron.com.br/v1/crm/deals/{id}") { Content = payload });
var data = await response.Content.ReadAsStringAsync(); PATCH /crm/deals/{id} HTTP/1.1
Host: api.maestron.com.br
Authorization: Bearer SEU_TOKEN
Content-Type: application/json
{
"title": "Licença Enterprise - Acme Corp (revisado)",
"value": 1800000,
"probability": 75
} Respostas
{
"message": "Negócio atualizado.",
"data": {
"id": "deal_01J9Z3K8",
"title": "Licença Enterprise - Acme Corp (revisado)",
"value": 1800000,
"currency": "BRL",
"probability": 75,
"status": "open",
"pipeline_id": "pipe_01J9Z3K8",
"stage_id": "stg_01J9Z3K8",
"contact_id": "cont_01J9Z3K8",
"company_id": "comp_01J9Z3K8",
"owner_id": "user_01J9Z3K8",
"expected_close_date": "2026-07-31",
"won_at": null,
"lost_at": null,
"lost_reason": null,
"tags": [
"enterprise",
"renovação"
],
"created_at": "2026-06-20T14:30:00Z",
"updated_at": "2026-06-20T15:10:00Z"
}
} {
"message": "Não autenticado."
} {
"message": "Negócio não encontrado."
} {
"message": "Os dados informados são inválidos.",
"errors": {
"probability": [
"A probabilidade deve estar entre 0 e 100."
]
}
} Remover negócio
Seção intitulada “Remover negócio”Remove um negócio.
Remover negócio
Remove um negócio permanentemente.
Parâmetros de caminho
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
id | string | Sim | Identificador do negócio (deal_). |
curl -X DELETE https://api.maestron.com.br/v1/crm/deals/{id} \
-H "Authorization: Bearer SEU_TOKEN" <?php
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://api.maestron.com.br/v1/crm/deals/{id}', [
'headers' => [
'Authorization' => 'Bearer SEU_TOKEN',
'Accept' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true); import requests
headers = {"Authorization": "Bearer SEU_TOKEN"}
response = requests.delete(
"https://api.maestron.com.br/v1/crm/deals/{id}",
headers=headers,
)
data = response.json() const response = await fetch("https://api.maestron.com.br/v1/crm/deals/{id}", {
method: "DELETE",
headers: {
"Authorization": "Bearer SEU_TOKEN",
},
});
const data = await response.json(); using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "SEU_TOKEN");
var response = await client.DeleteAsync("https://api.maestron.com.br/v1/crm/deals/{id}");
var data = await response.Content.ReadAsStringAsync(); DELETE /crm/deals/{id} HTTP/1.1
Host: api.maestron.com.br
Authorization: Bearer SEU_TOKEN Respostas
{
"message": "Negócio removido."
} {
"message": "Não autenticado."
} {
"message": "Negócio não encontrado."
} Mover negócio de estágio
Seção intitulada “Mover negócio de estágio”Move o negócio para outro estágio. O stage_id informado deve pertencer ao mesmo pipeline do negócio. A resposta retorna o negócio atualizado com o novo stage_id.
Mover negócio de estágio
Move o negócio para outro estágio do mesmo pipeline.
Parâmetros de caminho
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
id | string | Sim | Identificador do negócio (deal_). |
Corpo (body)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
stage_id | string | Sim | Estágio de destino (stg_), pertencente ao pipeline do negócio. |
curl -X PATCH https://api.maestron.com.br/v1/crm/deals/{id}/stage \
-H "Authorization: Bearer SEU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"stage_id": "stg_02K0A4L9"
}' <?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PATCH', 'https://api.maestron.com.br/v1/crm/deals/{id}/stage', [
'headers' => [
'Authorization' => 'Bearer SEU_TOKEN',
'Accept' => 'application/json',
],
'json' => [
'stage_id' => 'stg_02K0A4L9',
],
]);
$data = json_decode($response->getBody(), true); import requests
headers = {"Authorization": "Bearer SEU_TOKEN"}
payload = {
"stage_id": "stg_02K0A4L9",
}
response = requests.patch(
"https://api.maestron.com.br/v1/crm/deals/{id}/stage",
headers=headers,
json=payload,
)
data = response.json() const response = await fetch("https://api.maestron.com.br/v1/crm/deals/{id}/stage", {
method: "PATCH",
headers: {
"Authorization": "Bearer SEU_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"stage_id": "stg_02K0A4L9"
}),
});
const data = await response.json(); using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "SEU_TOKEN");
var payload = new StringContent(
"{\"stage_id\":\"stg_02K0A4L9\"}",
System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(new HttpRequestMessage(
new HttpMethod("PATCH"), "https://api.maestron.com.br/v1/crm/deals/{id}/stage") { Content = payload });
var data = await response.Content.ReadAsStringAsync(); PATCH /crm/deals/{id}/stage HTTP/1.1
Host: api.maestron.com.br
Authorization: Bearer SEU_TOKEN
Content-Type: application/json
{
"stage_id": "stg_02K0A4L9"
} Respostas
{
"message": "Negócio movido de estágio.",
"data": {
"id": "deal_01J9Z3K8",
"title": "Licença Enterprise - Acme Corp",
"value": 1500000,
"currency": "BRL",
"probability": 60,
"status": "open",
"pipeline_id": "pipe_01J9Z3K8",
"stage_id": "stg_02K0A4L9",
"contact_id": "cont_01J9Z3K8",
"company_id": "comp_01J9Z3K8",
"owner_id": "user_01J9Z3K8",
"expected_close_date": "2026-07-31",
"won_at": null,
"lost_at": null,
"lost_reason": null,
"tags": [
"enterprise",
"renovação"
],
"created_at": "2026-06-20T14:30:00Z",
"updated_at": "2026-06-20T16:00:00Z"
}
} {
"message": "Não autenticado."
} {
"message": "Negócio não encontrado."
} {
"message": "O estágio não pertence ao pipeline do negócio."
} {
"message": "Os dados informados são inválidos.",
"errors": {
"stage_id": [
"O campo stage_id é obrigatório."
]
}
} Marcar negócio como ganho
Seção intitulada “Marcar negócio como ganho”Marca o negócio como ganho. A situação (status) passa a won, probability é definida como 100 e won_at é preenchido com a data/hora da operação.
Marcar como ganho
Marca o negócio como ganho.
Parâmetros de caminho
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
id | string | Sim | Identificador do negócio (deal_). |
curl -X POST https://api.maestron.com.br/v1/crm/deals/{id}/win \
-H "Authorization: Bearer SEU_TOKEN" <?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.maestron.com.br/v1/crm/deals/{id}/win', [
'headers' => [
'Authorization' => 'Bearer SEU_TOKEN',
'Accept' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true); import requests
headers = {"Authorization": "Bearer SEU_TOKEN"}
response = requests.post(
"https://api.maestron.com.br/v1/crm/deals/{id}/win",
headers=headers,
)
data = response.json() const response = await fetch("https://api.maestron.com.br/v1/crm/deals/{id}/win", {
method: "POST",
headers: {
"Authorization": "Bearer SEU_TOKEN",
},
});
const data = await response.json(); using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "SEU_TOKEN");
var response = await client.PostAsync("https://api.maestron.com.br/v1/crm/deals/{id}/win", null);
var data = await response.Content.ReadAsStringAsync(); POST /crm/deals/{id}/win HTTP/1.1
Host: api.maestron.com.br
Authorization: Bearer SEU_TOKEN Respostas
{
"message": "Negócio marcado como ganho.",
"data": {
"id": "deal_01J9Z3K8",
"title": "Licença Enterprise - Acme Corp",
"value": 1500000,
"currency": "BRL",
"probability": 100,
"status": "won",
"pipeline_id": "pipe_01J9Z3K8",
"stage_id": "stg_02K0A4L9",
"contact_id": "cont_01J9Z3K8",
"company_id": "comp_01J9Z3K8",
"owner_id": "user_01J9Z3K8",
"expected_close_date": "2026-07-31",
"won_at": "2026-06-20T17:00:00Z",
"lost_at": null,
"lost_reason": null,
"tags": [
"enterprise",
"renovação"
],
"created_at": "2026-06-20T14:30:00Z",
"updated_at": "2026-06-20T17:00:00Z"
}
} {
"message": "Não autenticado."
} {
"message": "Negócio não encontrado."
} {
"message": "O negócio já está encerrado."
} Marcar negócio como perdido
Seção intitulada “Marcar negócio como perdido”Marca o negócio como perdido. A situação (status) passa a lost, probability é definida como 0 e lost_at é preenchido com a data/hora da operação. O campo lost_reason é opcional.
Marcar como perdido
Marca o negócio como perdido.
Parâmetros de caminho
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
id | string | Sim | Identificador do negócio (deal_). |
Corpo (body)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
lost_reason | string | — | Motivo da perda. |
curl -X POST https://api.maestron.com.br/v1/crm/deals/{id}/lose \
-H "Authorization: Bearer SEU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"lost_reason": "Preço acima do orçamento disponível."
}' <?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.maestron.com.br/v1/crm/deals/{id}/lose', [
'headers' => [
'Authorization' => 'Bearer SEU_TOKEN',
'Accept' => 'application/json',
],
'json' => [
'lost_reason' => 'Preço acima do orçamento disponível.',
],
]);
$data = json_decode($response->getBody(), true); import requests
headers = {"Authorization": "Bearer SEU_TOKEN"}
payload = {
"lost_reason": "Preço acima do orçamento disponível.",
}
response = requests.post(
"https://api.maestron.com.br/v1/crm/deals/{id}/lose",
headers=headers,
json=payload,
)
data = response.json() const response = await fetch("https://api.maestron.com.br/v1/crm/deals/{id}/lose", {
method: "POST",
headers: {
"Authorization": "Bearer SEU_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"lost_reason": "Preço acima do orçamento disponível."
}),
});
const data = await response.json(); using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "SEU_TOKEN");
var payload = new StringContent(
"{\"lost_reason\":\"Preço acima do orçamento disponível.\"}",
System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.maestron.com.br/v1/crm/deals/{id}/lose", payload);
var data = await response.Content.ReadAsStringAsync(); POST /crm/deals/{id}/lose HTTP/1.1
Host: api.maestron.com.br
Authorization: Bearer SEU_TOKEN
Content-Type: application/json
{
"lost_reason": "Preço acima do orçamento disponível."
} Respostas
{
"message": "Negócio marcado como perdido.",
"data": {
"id": "deal_01J9Z3K8",
"title": "Licença Enterprise - Acme Corp",
"value": 1500000,
"currency": "BRL",
"probability": 0,
"status": "lost",
"pipeline_id": "pipe_01J9Z3K8",
"stage_id": "stg_02K0A4L9",
"contact_id": "cont_01J9Z3K8",
"company_id": "comp_01J9Z3K8",
"owner_id": "user_01J9Z3K8",
"expected_close_date": "2026-07-31",
"won_at": null,
"lost_at": "2026-06-20T17:05:00Z",
"lost_reason": "Preço acima do orçamento disponível.",
"tags": [
"enterprise",
"renovação"
],
"created_at": "2026-06-20T14:30:00Z",
"updated_at": "2026-06-20T17:05:00Z"
}
} {
"message": "Não autenticado."
} {
"message": "Negócio não encontrado."
} {
"message": "O negócio já está encerrado."
}