Ver .md

custom_objects.records_bulk_update

Alterar registros em massa. Aplica uma mudança a vários registros: mesma seleção da exclusão em massa (recordIds ou allMatching + filters/search) e target: responsible (responsibleAttendantId, null tira o responsável), field (customFieldId e value; value: null limpa o campo; vale a validação do tipo) ou note (note, uma nota nova em cada registro). Até 200 registros roda na hora (mode: "sync", com affected); acima disso vira uma tarefa em segundo plano (mode: "async", com jobId): acompanhe com custom_objects.record_job_get (até 100.000 registros).

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

Entrada

CampoTipoObrigatórioNota
objectIdstring (uuid)sim
recordIdsstring (uuid)[]não
allMatchingbooleannão
filtersobject[]não
relationsobject[]não
searchstringnão
target"responsible" | "field" | "note"sim
responsibleAttendantIdstring (uuid) | nullnão
customFieldIdstring (uuid)não
valueanynão
notestringnão
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "objectId": {
      "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)$"
    },
    "recordIds": {
      "maxItems": 5000,
      "type": "array",
      "items": {
        "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)$"
      }
    },
    "allMatching": {
      "type": "boolean"
    },
    "filters": {
      "maxItems": 30,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fieldId": {
            "anyOf": [
              {
                "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)$"
              },
              {
                "type": "string",
                "enum": [
                  "title",
                  "responsible",
                  "createdAt",
                  "updatedAt"
                ]
              }
            ]
          },
          "op": {
            "type": "string",
            "enum": [
              "eq",
              "neq",
              "contains",
              "not_contains",
              "gt",
              "gte",
              "lt",
              "lte",
              "empty",
              "not_empty",
              "in",
              "not_in",
              "starts_with",
              "ends_with"
            ]
          },
          "value": {}
        },
        "required": [
          "fieldId",
          "op"
        ]
      }
    },
    "relations": {
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "relationId": {
            "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)$"
          },
          "side": {
            "type": "string",
            "enum": [
              "source",
              "target"
            ]
          },
          "quantifier": {
            "type": "string",
            "enum": [
              "any",
              "all",
              "none"
            ]
          },
          "value": {
            "type": "string",
            "maxLength": 200
          },
          "conditions": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fieldId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "op": {
                  "type": "string",
                  "enum": [
                    "eq",
                    "neq",
                    "contains",
                    "not_contains",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "empty",
                    "not_empty",
                    "in",
                    "not_in",
                    "starts_with",
                    "ends_with"
                  ]
                },
                "value": {}
              },
              "required": [
                "fieldId",
                "op"
              ]
            }
          }
        },
        "required": [
          "relationId",
          "side",
          "quantifier"
        ]
      }
    },
    "search": {
      "type": "string",
      "maxLength": 200
    },
    "target": {
      "type": "string",
      "enum": [
        "responsible",
        "field",
        "note"
      ]
    },
    "responsibleAttendantId": {
      "anyOf": [
        {
          "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)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "customFieldId": {
      "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)$"
    },
    "value": {},
    "note": {
      "type": "string",
      "minLength": 1,
      "maxLength": 10000
    }
  },
  "required": [
    "objectId",
    "target"
  ]
}

Exemplo

curl -X POST https://app.atomiks.com.br/api/v1/custom_objects.records_bulk_update \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"objectId":"00000000-0000-0000-0000-000000000000","recordIds":["00000000-0000-0000-0000-000000000000"],"target":"responsible","responsibleAttendantId":null}'

CLI:

node cli/atomiks.mjs custom_objects.records_bulk_update --json '{"objectId":"00000000-0000-0000-0000-000000000000","recordIds":["00000000-0000-0000-0000-000000000000"],"target":"responsible","responsibleAttendantId":null}'

MCP: ferramenta custom_objects_records_bulk_update com a mesma entrada.

Saída

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

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "const": "sync"
        },
        "affected": {
          "type": "number"
        }
      },
      "required": [
        "mode",
        "affected"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "const": "async"
        },
        "jobId": {
          "type": "string"
        }
      },
      "required": [
        "mode",
        "jobId"
      ],
      "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).