Ver .md

custom_objects.fields_reorder

Reordenar os campos de um objeto. Define a ordem dos campos: ids são os id dos campos do objeto, uma vez cada (campos de fora, como os inativos, vão para o fim, na ordem de antes), ou items ({id, order, groupName}, o que o arrastar da tela envia: muda a posição e o grupo de cada campo citado). Devolve a lista de campos na nova ordem.

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

Entrada

CampoTipoObrigatórioNota
objectIdstring (uuid)sim
idsstring (uuid)[]não
itemsobject[]nã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)$"
    },
    "ids": {
      "minItems": 1,
      "maxItems": 200,
      "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)$"
      }
    },
    "items": {
      "minItems": 1,
      "maxItems": 200,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "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)$"
          },
          "order": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "groupName": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "order"
        ]
      }
    }
  },
  "required": [
    "objectId"
  ]
}

Exemplo

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

CLI:

node cli/atomiks.mjs custom_objects.fields_reorder --json '{"objectId":"00000000-0000-0000-0000-000000000000","ids":["00000000-0000-0000-0000-000000000000"]}'

MCP: ferramenta custom_objects_fields_reorder com a mesma entrada.

Saída

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

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "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
      }
    }
  },
  "required": [
    "items"
  ],
  "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).