PATCH /api/v1/contacts/{id}
Atualiza parcialmente um contato. Campos omitidos permanecem iguais; texto vazio limpa o valor. Exige contacts.edit.
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/contacts/ $ID " \
--header "Authorization: Bearer $PIPEFACIL_API_KEY " \
--header "Content-Type: application/json" \
--data '{
"firstName": "Ana",
"lastName": "Silva"
}' JavaScript const response = await fetch ( `https://pipefacil-server.matchsales.com.br/api/v1/contacts/${ process . env . ID }` , {
method: "PATCH" ,
headers: {
Authorization: `Bearer ${ process . env . PIPEFACIL_API_KEY }` ,
"Content-Type" : "application/json" ,
},
body: JSON . stringify ({
"firstName" : "Ana" ,
"lastName" : "Silva"
}),
});
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/contacts/ { os.environ[ 'ID' ] } " ,
headers = { "Authorization" : f "Bearer { os.environ[ 'PIPEFACIL_API_KEY' ] } " },
json = json.loads( "{ \n \" firstName \" : \" Ana \" , \n \" lastName \" : \" Silva \"\n }" ),
)
response.raise_for_status()
data = response.json() if response.content else None Parâmetros Nome Local Tipo Obrigatório Descrição idpathstringSim Identificador do contato.
Corpo da requisição Content-Type: application/json · obrigatório
{
"firstName" : "Ana" ,
"lastName" : "Silva"
} Campo Tipo Obrigatório no objeto Descrição phonestringNão Aceita null. Até 30 caracteres. customNamestringNão Aceito por compatibilidade. Dividido no primeiro espaço em firstName/lastName. Ignorado quando firstName ou lastName é enviado. Aceita null. Até 255 caracteres. firstNamestringNão Aceita null. Até 255 caracteres. lastNamestringNão Aceita null. Até 255 caracteres. emailstringNão Formato: email. Aceita null. Até 255 caracteres. instagramUsernamestringNão Aceita null. blockedbooleanNão Aceita null. notesstringNão Aceita null. Até 2000 caracteres. isInternalbooleanNão Aceita null.
Esquema OpenAPI {
"type" : "object" ,
"description" : "Todos os campos são opcionais. Omitir preserva o valor; ` \"\" ` limpa o campo." ,
"properties" : {
"phone" : {
"type" : "string" ,
"maxLength" : 30 ,
"pattern" : "^[0-9+() \\ - \\ s]*$" ,
"nullable" : true
},
"customName" : {
"type" : "string" ,
"maxLength" : 255 ,
"nullable" : true ,
"deprecated" : true ,
"description" : "Aceito por compatibilidade. Dividido no primeiro espaço em firstName/lastName. Ignorado quando firstName ou lastName é enviado."
},
"firstName" : {
"type" : "string" ,
"maxLength" : 255 ,
"nullable" : true
},
"lastName" : {
"type" : "string" ,
"maxLength" : 255 ,
"nullable" : true
},
"email" : {
"type" : "string" ,
"format" : "email" ,
"maxLength" : 255 ,
"nullable" : true
},
"instagramUsername" : {
"type" : "string" ,
"pattern" : "^(@?[A-Za-z0-9._]{1,30})?$" ,
"nullable" : true
},
"blocked" : {
"type" : "boolean" ,
"nullable" : true
},
"notes" : {
"type" : "string" ,
"maxLength" : 2000 ,
"nullable" : true
},
"isInternal" : {
"type" : "boolean" ,
"nullable" : true
}
},
"example" : {
"firstName" : "Ana" ,
"lastName" : "Silva"
}
} Respostas 200 Sucesso Campo Tipo Descrição dataContact— data.idstring— data.seqinteger— data.phonestring— data.namestringAceita null. data.customNamestringNome completo editável, calculado a partir de firstName + lastName. Aceita null. data.firstNamestringAceita null. data.lastNamestringAceita null. data.displayNamestring— data.avatarUrlstringAceita null. data.emailstringAceita null. data.blockedboolean— data.isInternalboolean— data.lastMessageAtstringFormato: date-time. Aceita null. data.lastActivityAtstringFormato: date-time. data.createdAtstringFormato: date-time. data.updatedAtstringFormato: date-time. data.instagramUsernamestringAceita null. messagestringAceita null.
Esquema OpenAPI {
"type" : "object" ,
"properties" : {
"data" : {
"$ref" : "#/components/schemas/Contact"
},
"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"
]
} 403 Autenticado, mas sem acesso: falta de permissão (`FORBIDDEN`), recurso desligado no workspace (`FEATURE_DISABLED`) ou tentativa de acessar uma agenda não permitida. 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"
]
} 409 Conflito de estado, como um negócio aberto duplicado para o contato/funil, ou limite do plano atingido (`QUOTA_EXCEEDED`), como na criação de um funil além da cota. 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"
]
}