Ir para o conteúdo

Atualizar campo personalizado

PATCH/api/v1/custom-fields/{id}

Atualiza parcialmente a definição de um campo e retorna o resultado. Exige settings.custom_fields.

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/custom-fields/$ID" \
  --header "Authorization: Bearer $PIPEFACIL_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "placeholder": "Informe o segmento da empresa"
}'
JavaScript
const response = await fetch(`https://pipefacil-server.matchsales.com.br/api/v1/custom-fields/${process.env.ID}`, {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.PIPEFACIL_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "placeholder": "Informe o segmento da empresa"
}),
});

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/custom-fields/{os.environ['ID']}",
    headers={"Authorization": f"Bearer {os.environ['PIPEFACIL_API_KEY']}"},
    json=json.loads("{\n  \"placeholder\": \"Informe o segmento da empresa\"\n}"),
)
response.raise_for_status()
data = response.json() if response.content else None

Parâmetros

NomeLocalTipoObrigatórioDescrição
idpathstringSimIdentificador do campo personalizado.

Corpo da requisição

Content-Type: application/json · obrigatório

{
  "placeholder": "Informe o segmento da empresa"
}
CampoTipoObrigatório no objetoDescrição
namestringNãoAceita null. Até 255 caracteres.
descriptionstringNãoAceita null. Até 1000 caracteres.
placeholderstringNãoOmitir ou enviar nulo preserva o valor atual; texto em branco limpa o campo. Aceita null. Até 255 caracteres.
optionsarrayNãoAceita null.
configobjectNãoConfiguração por tipo de campo. Para event, informe event com título, duração e configuração da reunião. member_field usa fieldSlug para ler um membro a partir de um campo members do lead. Aceita null.
config.eventEventFieldConfigNão—
config.event.titlestringSimAté 255 caracteres.
config.event.descriptionstringNãoAceita null. Até 2000 caracteres.
config.event.durationMinutesintegerSimMínimo: 1. Máximo: 1440.
config.event.conferenceModestringNãoValores: none, google_meet, custom_field. Aceita null.
config.event.conferenceFieldSlugstringNãoAceita null.
config.event.recordWithBotbooleanNãoAceita null.
config.event.attendeesarrayNãoAceita null.
config.event.attendees[].typestringNãoValores: lead_contact, deal_co_owner, member, contact, member_field.
config.event.attendees[].userIdstringNãoAceita null.
config.event.attendees[].contactIdstringNãoAceita null.
config.event.attendees[].fieldSlugstringNãoSlug do campo members cujo usuário será convidado. Lido novamente quando o campo mudar. Aceita null.
config.event.attendees[].labelstringNãoRótulo usado pelo editor; não determina a identidade do convidado. Aceita null. Até 255 caracteres.
isRequiredbooleanNãoAceita null.
apiOnlybooleanNãoDefine se os valores dos negócios só podem ser alterados por /api/v1. Aceita null.
displayOrderintegerNãoAceita null. Mínimo: 0.
sectionstringNãoAceita null. Até 255 caracteres.
visibilityRuleobjectNãoSubstitui a regra. Omitir ou enviar nulo preserva a regra atual. Aceita null.
visibilityRule.parentFieldIdstringSim—
visibilityRule.valuesarraySim—
clearVisibilityRulebooleanNãoQuando verdadeiro, remove a regra de visibilidade. Não envie junto com visibilityRule: isso resulta em 422. Aceita null.
Esquema OpenAPI
{
  "type": "object",
  "description": "Todos os campos são opcionais. Tipo, slug e entidade são imutáveis após a criação e não são aceitos nesta atualização.",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "nullable": true
    },
    "description": {
      "type": "string",
      "maxLength": 1000,
      "nullable": true
    },
    "placeholder": {
      "type": "string",
      "maxLength": 255,
      "nullable": true,
      "description": "Omitir ou enviar nulo preserva o valor atual; texto em branco limpa o campo."
    },
    "options": {
      "type": "array",
      "nullable": true,
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "config": {
      "type": "object",
      "additionalProperties": true,
      "nullable": true,
      "properties": {
        "event": {
          "$ref": "#/components/schemas/EventFieldConfig"
        }
      },
      "description": "Configuração por tipo de campo. Para event, informe event com título, duração e configuração da reunião. member_field usa fieldSlug para ler um membro a partir de um campo members do lead."
    },
    "isRequired": {
      "type": "boolean",
      "nullable": true
    },
    "apiOnly": {
      "type": "boolean",
      "nullable": true,
      "description": "Define se os valores dos negócios só podem ser alterados por /api/v1."
    },
    "displayOrder": {
      "type": "integer",
      "minimum": 0,
      "nullable": true
    },
    "section": {
      "type": "string",
      "maxLength": 255,
      "nullable": true
    },
    "visibilityRule": {
      "allOf": [
        {
          "$ref": "#/components/schemas/CustomFieldVisibilityRule"
        }
      ],
      "nullable": true,
      "description": "Substitui a regra. Omitir ou enviar nulo preserva a regra atual."
    },
    "clearVisibilityRule": {
      "type": "boolean",
      "nullable": true,
      "description": "Quando verdadeiro, remove a regra de visibilidade. Não envie junto com visibilityRule: isso resulta em 422."
    }
  },
  "example": {
    "placeholder": "Informe o segmento da empresa"
  }
}

Respostas

200Sucesso
CampoTipoDescrição
dataCustomFieldDefinition—
data.idstring—
data.entityTypestring—
data.namestring—
data.slugstring—
data.descriptionstringAceita null.
data.placeholderstringTexto de exemplo exibido no campo vazio. Aceita null.
data.fieldTypestring—
data.optionsarrayOpções de seleção. Em select e multi_select, ficam na definição. Em members, são calculadas a partir dos membros do workspace a cada leitura; value é o userId do membro. Aceita null.
data.options[].valuestring—
data.options[].labelstring—
data.options[].colorstringAceita null.
data.options[].imagestringURL da foto. Somente para members. Aceita null.
data.options[].inactivebooleanSomente para members. Verdadeiro para membro desativado. Ele permanece na lista para resolver nomes de valores anteriores. Não o ofereça para novas escolhas nem altere valores já salvos por causa dessa marcação.
data.configobjectConfiguração por tipo de campo. Para event, informe event com título, duração e configuração da reunião. member_field usa fieldSlug para ler um membro a partir de um campo members do lead. Aceita null.
data.config.eventEventFieldConfig—
data.config.event.titlestringAté 255 caracteres.
data.config.event.descriptionstringAceita null. Até 2000 caracteres.
data.config.event.durationMinutesintegerMínimo: 1. Máximo: 1440.
data.config.event.conferenceModestringValores: none, google_meet, custom_field. Aceita null.
data.config.event.conferenceFieldSlugstringAceita null.
data.config.event.recordWithBotbooleanAceita null.
data.config.event.attendeesarrayAceita null.
data.config.event.attendees[].typestringValores: lead_contact, deal_co_owner, member, contact, member_field.
data.config.event.attendees[].userIdstringAceita null.
data.config.event.attendees[].contactIdstringAceita null.
data.config.event.attendees[].fieldSlugstringSlug do campo members cujo usuário será convidado. Lido novamente quando o campo mudar. Aceita null.
data.config.event.attendees[].labelstringRótulo usado pelo editor; não determina a identidade do convidado. Aceita null. Até 255 caracteres.
data.isRequiredboolean—
data.apiOnlybooleanValores dos negócios são somente leitura no aplicativo e podem ser alterados por /api/v1.
data.displayOrderinteger—
data.sectionstringAceita null.
data.pipelineConfigobjectAceita null.
data.createdAtstringFormato: date-time.
data.updatedAtstringFormato: date-time.
data.visibilityRuleobjectAceita null.
data.visibilityRule.parentFieldIdstring—
data.visibilityRule.valuesarray—
messagestringAceita null.
Esquema OpenAPI
{
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/components/schemas/CustomFieldDefinition"
    },
    "message": {
      "type": "string",
      "nullable": true
    }
  }
}
400Falha de validação dos campos; `fieldErrors` contém os erros.
CampoTipoDescriçã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"
  ]
}
401Chave ausente, malformada, desconhecida, revogada ou expirada, ou membro emissor inativo.
CampoTipoDescriçã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"
  ]
}
403Autenticado, mas sem acesso: falta de permissão (`FORBIDDEN`), recurso desligado no workspace (`FEATURE_DISABLED`) ou tentativa de acessar uma agenda não permitida.
CampoTipoDescriçã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"
  ]
}
404Recurso não encontrado ou fora da visibilidade do membro.
CampoTipoDescriçã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"
  ]
}
409Conflito 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.
CampoTipoDescriçã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"
  ]
}
429Limite de requisições excedido por workspace ou IP.
CampoTipoDescriçã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"
  ]
}

Precisa de ajuda?

Encontrou um problema ou ficou com uma dúvida? Fale com a equipe pelo WhatsApp.

Chamar no WhatsApp