Ver .md

custom_fields.update

Editar campo customizado de Contatos ou Oportunidades. Muda o nome de exibição, a descrição, as opções (só campos de seleção; valores já gravados que saírem das opções continuam guardados), required, filterable, pinned, unique, groupName (nulo ou vazio tira do grupo) e isActive. isActive: false é o "Excluir campo" da tela: o campo sai de formulários, filtros e relatórios, os valores continuam guardados e voltam ao reativar (true). A chave e o tipo não mudam.

  • Endpoint: POST https://app.atomiks.com.br/api/v1/custom_fields.update (corpo JSON)
  • Quem pode chamar: administrador da conta
  • Escopo da chave: crm:write
  • Grava dados: sim
  • Pela chave de API: sim
  • Ferramenta MCP: custom_fields_update
  • Ficha em JSON: https://app.atomiks.com.br/api/v1/openapi.json (operationId custom_fields.update)

Entrada

CampoTipoObrigatórioNota
entityType"leads" | "opportunities"sim
idstring (uuid)sim
displayNamestringnão
descriptionstring | nullnão
optionsstring | object[]não
requiredbooleannão
filterablebooleannão
pinnedbooleannão
uniquebooleannão
groupNamestring | nullnão
isActivebooleannão
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "entityType": {
      "type": "string",
      "enum": [
        "leads",
        "opportunities"
      ]
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "displayName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 300
        },
        {
          "type": "null"
        }
      ]
    },
    "options": {
      "maxItems": 50,
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "label"
            ]
          }
        ]
      }
    },
    "required": {
      "type": "boolean"
    },
    "filterable": {
      "type": "boolean"
    },
    "pinned": {
      "type": "boolean"
    },
    "unique": {
      "type": "boolean"
    },
    "groupName": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 60
        },
        {
          "type": "null"
        }
      ]
    },
    "isActive": {
      "type": "boolean"
    }
  },
  "required": [
    "entityType",
    "id"
  ]
}

Exemplo

curl -X POST https://app.atomiks.com.br/api/v1/custom_fields.update \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entityType":"leads","id":"00000000-0000-0000-0000-000000000000","displayName":"Cidade natal"}'

CLI:

node cli/atomiks.mjs custom_fields.update --json '{"entityType":"leads","id":"00000000-0000-0000-0000-000000000000","displayName":"Cidade natal"}'

MCP: ferramenta custom_fields_update com a mesma entrada.

Saída

Sucesso: {"data": ...} com o formato abaixo.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "objectId": {
      "type": "string"
    },
    "fieldName": {
      "type": "string"
    },
    "displayName": {
      "type": "string"
    },
    "fieldType": {
      "type": "string",
      "enum": [
        "text",
        "textarea",
        "number",
        "currency",
        "percentage",
        "date",
        "select",
        "multi_select",
        "radio",
        "link",
        "rating",
        "boolean",
        "file",
        "image"
      ]
    },
    "options": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "label",
              "value"
            ],
            "additionalProperties": false
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "required": {
      "type": "boolean"
    },
    "filterable": {
      "type": "boolean"
    },
    "pinned": {
      "type": "boolean"
    },
    "isActive": {
      "type": "boolean"
    },
    "position": {
      "type": "number"
    },
    "usageCount": {
      "type": "number"
    },
    "usageByKind": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "number"
      }
    },
    "fillRate": {
      "type": "number"
    },
    "filledCount": {
      "type": "number"
    },
    "totalRecords": {
      "type": "number"
    },
    "isTitle": {
      "type": "boolean"
    },
    "groupName": {
      "type": [
        "string",
        "null"
      ]
    },
    "unique": {
      "type": "boolean"
    },
    "lastEditedAt": {
      "type": [
        "string",
        "null"
      ]
    },
    "createdAt": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "objectId",
    "fieldName",
    "displayName",
    "fieldType",
    "options",
    "description",
    "required",
    "filterable",
    "pinned",
    "isActive",
    "position",
    "usageCount",
    "usageByKind",
    "fillRate",
    "filledCount",
    "totalRecords",
    "isTitle",
    "groupName",
    "unique",
    "lastEditedAt",
    "createdAt"
  ],
  "additionalProperties": false
}

Erros

{"error": {"code", "message", "requestId"}}. Códigos: invalid_input (400), unauthorized (401), forbidden / account_pending / scope_missing (403), not_found (404), limit_reached (409), internal (500).