PATCH /api/v1/deals/{seq}
Atualiza parcialmente o negócio e pode movê-lo entre etapas. Mover para uma etapa de perda exige um lostReason válido; mover para uma etapa de ganho encerra o negócio.
Exemplos A URL usa o servidor de produção. Defina PIPEFACIL_API_KEY e as variáveis de caminho (como SEQ ou ID) com os identificadores reais. Ajuste o corpo antes de executar: requisições de escrita alteram dados do workspace.
cURL curl --request PATCH \
--url "https://pipefacil-server.matchsales.com.br/api/v1/deals/ $SEQ " \
--header "Authorization: Bearer $PIPEFACIL_API_KEY " \
--header "Content-Type: application/json" \
--data '{
"notes": "Contato pediu uma proposta revisada."
}' JavaScript const response = await fetch ( `https://pipefacil-server.matchsales.com.br/api/v1/deals/${ process . env . SEQ }` , {
method: "PATCH" ,
headers: {
Authorization: `Bearer ${ process . env . PIPEFACIL_API_KEY }` ,
"Content-Type" : "application/json" ,
},
body: JSON . stringify ({
"notes" : "Contato pediu uma proposta revisada."
}),
});
if ( ! response.ok) throw new Error ( `HTTP ${ response . status }: ${ await response . text () }` );
const text = await response. text ();
const data = text ? JSON . parse (text) : null ; Python import os
import json
import requests
response = requests.request(
"PATCH" ,
f "https://pipefacil-server.matchsales.com.br/api/v1/deals/ { os.environ[ 'SEQ' ] } " ,
headers = { "Authorization" : f "Bearer { os.environ[ 'PIPEFACIL_API_KEY' ] } " },
json = json.loads( "{ \n \" notes \" : \" Contato pediu uma proposta revisada. \"\n }" ),
)
response.raise_for_status()
data = response.json() if response.content else None Parâmetros Nome Local Tipo Obrigatório Descrição seqpathintegerSim Número sequencial do negócio dentro do workspace.
Corpo da requisição Content-Type: application/json · obrigatório
{
"notes" : "Contato pediu uma proposta revisada."
} Campo Tipo Obrigatório no objeto Descrição namestringNão Aceita null. Até 255 caracteres. valuenumberNão Aceita null. Mínimo: 0. currencystringNão Aceita null. Até 3 caracteres. closeProbabilityintegerNão Aceita null. Mínimo: 0. Máximo: 100. expectedCloseAtstringNão Formato: date-time. Aceita null. stageIdstringNão Aceita null. companyIdstringNão Aceita null. responsibleUserIdstringNão Aceita null. coOwnerUserIdstringNão Aceita null. lostReasonstringNão Obrigatório ao mover para uma etapa de perda. Aceita null. Até 255 caracteres. notesstringNão Aceita null. Até 2000 caracteres. tagIdsarrayNão Aceita null. customFieldsobjectNão Aceita null. contactobjectNão Campos opcionais do contato para atualizar junto com o negócio. Aceita null. trackingobjectNão Aceita null. tracking.utmContentstringNão Aceita null. tracking.utmMediumstringNão Aceita null. tracking.utmCampaignstringNão Aceita null. tracking.utmSourcestringNão Aceita null. tracking.utmTermstringNão Aceita null. tracking.utmReferrerstringNão Aceita null. tracking.referrerstringNão Aceita null. tracking.gclientidstringNão Aceita null. tracking.gclidstringNão Aceita null. tracking.fbclidstringNão Aceita null. tracking.metaLeadIdstringNão Aceita null. tracking.fbpstringNão Aceita null. tracking.fbcstringNão Aceita null. tracking.clientIpAddressstringNão Aceita null. tracking.clientUserAgentstringNão Aceita null. tracking.ctwaClidstringNão Aceita null.
Esquema OpenAPI {
"type" : "object" ,
"properties" : {
"name" : {
"type" : "string" ,
"maxLength" : 255 ,
"nullable" : true
},
"value" : {
"type" : "number" ,
"minimum" : 0 ,
"nullable" : true
},
"currency" : {
"type" : "string" ,
"maxLength" : 3 ,
"nullable" : true
},
"closeProbability" : {
"type" : "integer" ,
"minimum" : 0 ,
"maximum" : 100 ,
"nullable" : true
},
"expectedCloseAt" : {
"type" : "string" ,
"format" : "date-time" ,
"nullable" : true
},
"stageId" : {
"type" : "string" ,
"nullable" : true
},
"companyId" : {
"type" : "string" ,
"nullable" : true
},
"responsibleUserId" : {
"type" : "string" ,
"nullable" : true
},
"coOwnerUserId" : {
"type" : "string" ,
"nullable" : true
},
"lostReason" : {
"type" : "string" ,
"maxLength" : 255 ,
"nullable" : true ,
"description" : "Obrigatório ao mover para uma etapa de perda."
},
"notes" : {
"type" : "string" ,
"maxLength" : 2000 ,
"nullable" : true
},
"tagIds" : {
"type" : "array" ,
"items" : {
"type" : "string"
},
"nullable" : true
},
"customFields" : {
"type" : "object" ,
"additionalProperties" : true ,
"nullable" : true
},
"contact" : {
"type" : "object" ,
"nullable" : true ,
"additionalProperties" : true ,
"description" : "Campos opcionais do contato para atualizar junto com o negócio."
},
"tracking" : {
"allOf" : [
{
"$ref" : "#/components/schemas/DealTracking"
}
],
"nullable" : true
}
},
"example" : {
"notes" : "Contato pediu uma proposta revisada."
}
} Respostas 200 Sucesso Campo Tipo Descrição dataDealResponseNegócio resumido retornado na criação ou atualização. data.idstring— data.seqinteger— data.namestring— data.contactIdstringAceita null. data.responsibleUserIdstring— data.companyIdstringAceita null. data.pipelineIdstring— data.stageIdstring— data.valuenumber— data.currencystring— data.closeProbabilityinteger— data.sourcestring— data.statusstringopen | won | lost data.coOwnerUserIdstringAceita null. data.expectedCloseAtstringFormato: date-time. Aceita null. data.stageChangedAtstringFormato: date-time. data.closedAtstringFormato: date-time. Aceita null. data.lostReasonstringAceita null. data.customFieldsobject— data.createdAtstringFormato: date-time. data.trackingobjectAceita null. data.tracking.utmContentstringAceita null. data.tracking.utmMediumstringAceita null. data.tracking.utmCampaignstringAceita null. data.tracking.utmSourcestringAceita null. data.tracking.utmTermstringAceita null. data.tracking.utmReferrerstringAceita null. data.tracking.referrerstringAceita null. data.tracking.gclientidstringAceita null. data.tracking.gclidstringAceita null. data.tracking.fbclidstringAceita null. data.tracking.metaLeadIdstringAceita null. data.tracking.fbpstringAceita null. data.tracking.fbcstringAceita null. data.tracking.clientIpAddressstringAceita null. data.tracking.clientUserAgentstringAceita null. data.tracking.ctwaClidstringAceita null. messagestringAceita null.
Esquema OpenAPI {
"type" : "object" ,
"properties" : {
"data" : {
"$ref" : "#/components/schemas/DealResponse"
},
"message" : {
"type" : "string" ,
"nullable" : true
}
}
} 400 Falha de validação dos campos; `fieldErrors` contém os erros. Campo Tipo Descrição errorstring— codestringValores: BAD_REQUEST, VALIDATION_ERROR, UNAUTHORIZED, FORBIDDEN, FEATURE_DISABLED, NOT_FOUND, CONFLICT, QUOTA_EXCEEDED, UNPROCESSABLE_ENTITY, INTERNAL_ERROR, SERVICE_UNAVAILABLE. requestIdstring— detailsstringAceita null. fieldErrorsarrayAceita null. fieldErrors[].fieldstring— fieldErrors[].messagestring—
Esquema OpenAPI {
"type" : "object" ,
"description" : "Formato padrão de erro. `details` e `fieldErrors` são omitidos quando ausentes." ,
"properties" : {
"error" : {
"type" : "string"
},
"code" : {
"type" : "string" ,
"enum" : [
"BAD_REQUEST" ,
"VALIDATION_ERROR" ,
"UNAUTHORIZED" ,
"FORBIDDEN" ,
"FEATURE_DISABLED" ,
"NOT_FOUND" ,
"CONFLICT" ,
"QUOTA_EXCEEDED" ,
"UNPROCESSABLE_ENTITY" ,
"INTERNAL_ERROR" ,
"SERVICE_UNAVAILABLE"
]
},
"requestId" : {
"type" : "string"
},
"details" : {
"type" : "string" ,
"nullable" : true
},
"fieldErrors" : {
"type" : "array" ,
"nullable" : true ,
"items" : {
"type" : "object" ,
"properties" : {
"field" : {
"type" : "string"
},
"message" : {
"type" : "string"
}
}
}
}
},
"required" : [
"error" ,
"code" ,
"requestId"
]
} 401 Chave ausente, malformada, desconhecida, revogada ou expirada, ou membro emissor inativo. Campo Tipo Descrição errorstring— codestringValores: BAD_REQUEST, VALIDATION_ERROR, UNAUTHORIZED, FORBIDDEN, FEATURE_DISABLED, NOT_FOUND, CONFLICT, QUOTA_EXCEEDED, UNPROCESSABLE_ENTITY, INTERNAL_ERROR, SERVICE_UNAVAILABLE. requestIdstring— detailsstringAceita null. fieldErrorsarrayAceita null. fieldErrors[].fieldstring— fieldErrors[].messagestring—
Esquema OpenAPI {
"type" : "object" ,
"description" : "Formato padrão de erro. `details` e `fieldErrors` são omitidos quando ausentes." ,
"properties" : {
"error" : {
"type" : "string"
},
"code" : {
"type" : "string" ,
"enum" : [
"BAD_REQUEST" ,
"VALIDATION_ERROR" ,
"UNAUTHORIZED" ,
"FORBIDDEN" ,
"FEATURE_DISABLED" ,
"NOT_FOUND" ,
"CONFLICT" ,
"QUOTA_EXCEEDED" ,
"UNPROCESSABLE_ENTITY" ,
"INTERNAL_ERROR" ,
"SERVICE_UNAVAILABLE"
]
},
"requestId" : {
"type" : "string"
},
"details" : {
"type" : "string" ,
"nullable" : true
},
"fieldErrors" : {
"type" : "array" ,
"nullable" : true ,
"items" : {
"type" : "object" ,
"properties" : {
"field" : {
"type" : "string"
},
"message" : {
"type" : "string"
}
}
}
}
},
"required" : [
"error" ,
"code" ,
"requestId"
]
} 404 Recurso não encontrado ou fora da visibilidade do membro. Campo Tipo Descrição errorstring— codestringValores: BAD_REQUEST, VALIDATION_ERROR, UNAUTHORIZED, FORBIDDEN, FEATURE_DISABLED, NOT_FOUND, CONFLICT, QUOTA_EXCEEDED, UNPROCESSABLE_ENTITY, INTERNAL_ERROR, SERVICE_UNAVAILABLE. requestIdstring— detailsstringAceita null. fieldErrorsarrayAceita null. fieldErrors[].fieldstring— fieldErrors[].messagestring—
Esquema OpenAPI {
"type" : "object" ,
"description" : "Formato padrão de erro. `details` e `fieldErrors` são omitidos quando ausentes." ,
"properties" : {
"error" : {
"type" : "string"
},
"code" : {
"type" : "string" ,
"enum" : [
"BAD_REQUEST" ,
"VALIDATION_ERROR" ,
"UNAUTHORIZED" ,
"FORBIDDEN" ,
"FEATURE_DISABLED" ,
"NOT_FOUND" ,
"CONFLICT" ,
"QUOTA_EXCEEDED" ,
"UNPROCESSABLE_ENTITY" ,
"INTERNAL_ERROR" ,
"SERVICE_UNAVAILABLE"
]
},
"requestId" : {
"type" : "string"
},
"details" : {
"type" : "string" ,
"nullable" : true
},
"fieldErrors" : {
"type" : "array" ,
"nullable" : true ,
"items" : {
"type" : "object" ,
"properties" : {
"field" : {
"type" : "string"
},
"message" : {
"type" : "string"
}
}
}
}
},
"required" : [
"error" ,
"code" ,
"requestId"
]
} 429 Limite de requisições excedido por workspace ou IP. Campo Tipo Descrição errorstring— codestringValores: BAD_REQUEST, VALIDATION_ERROR, UNAUTHORIZED, FORBIDDEN, FEATURE_DISABLED, NOT_FOUND, CONFLICT, QUOTA_EXCEEDED, UNPROCESSABLE_ENTITY, INTERNAL_ERROR, SERVICE_UNAVAILABLE. requestIdstring— detailsstringAceita null. fieldErrorsarrayAceita null. fieldErrors[].fieldstring— fieldErrors[].messagestring—
Esquema OpenAPI {
"type" : "object" ,
"description" : "Formato padrão de erro. `details` e `fieldErrors` são omitidos quando ausentes." ,
"properties" : {
"error" : {
"type" : "string"
},
"code" : {
"type" : "string" ,
"enum" : [
"BAD_REQUEST" ,
"VALIDATION_ERROR" ,
"UNAUTHORIZED" ,
"FORBIDDEN" ,
"FEATURE_DISABLED" ,
"NOT_FOUND" ,
"CONFLICT" ,
"QUOTA_EXCEEDED" ,
"UNPROCESSABLE_ENTITY" ,
"INTERNAL_ERROR" ,
"SERVICE_UNAVAILABLE"
]
},
"requestId" : {
"type" : "string"
},
"details" : {
"type" : "string" ,
"nullable" : true
},
"fieldErrors" : {
"type" : "array" ,
"nullable" : true ,
"items" : {
"type" : "object" ,
"properties" : {
"field" : {
"type" : "string"
},
"message" : {
"type" : "string"
}
}
}
}
},
"required" : [
"error" ,
"code" ,
"requestId"
]
}