Ver .md

pipelines.stage_move_check

Conferir se um card pode ir para uma etapa. Avalia as regras antes de mover: campos obrigatórios e limite de cards da etapa de destino, direção da etapa de origem. allowed é falso quando alguma violação bloqueia (blocking); aviso de limite (mode: warn) não bloqueia e pede confirmação na tela. Não move nada.

  • Endpoint: POST https://app.atomiks.com.br/api/v1/pipelines.stage_move_check (corpo JSON)
  • Quem pode chamar: membro da conta
  • Escopo da chave: crm:read
  • Grava dados: não
  • Pela chave de API: sim
  • Ferramenta MCP: pipelines_stage_move_check
  • Ficha em JSON: https://app.atomiks.com.br/api/v1/openapi.json (operationId pipelines.stage_move_check)

Entrada

CampoTipoObrigatórioNota
opportunityIdstring (uuid)sim
toStageIdstring (uuid)sim
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "opportunityId": {
      "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)$"
    },
    "toStageId": {
      "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)$"
    }
  },
  "required": [
    "opportunityId",
    "toStageId"
  ]
}

Exemplo

curl -X POST https://app.atomiks.com.br/api/v1/pipelines.stage_move_check \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"opportunityId":"00000000-0000-0000-0000-000000000000","toStageId":"00000000-0000-0000-0000-000000000000"}'

CLI:

node cli/atomiks.mjs pipelines.stage_move_check --json '{"opportunityId":"00000000-0000-0000-0000-000000000000","toStageId":"00000000-0000-0000-0000-000000000000"}'

MCP: ferramenta pipelines_stage_move_check com a mesma entrada.

Saída

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

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "allowed": {
      "type": "boolean"
    },
    "violations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "required",
              "wip",
              "direction"
            ]
          },
          "blocking": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "missingFields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "standard",
                    "custom"
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "required": [
                "kind",
                "id"
              ],
              "additionalProperties": false
            }
          },
          "limit": {
            "type": "number"
          },
          "current": {
            "type": "number"
          },
          "mode": {
            "type": "string",
            "enum": [
              "warn",
              "block"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "any",
              "forward",
              "one_step",
              "terminal"
            ]
          }
        },
        "required": [
          "type",
          "blocking",
          "message"
        ],
        "additionalProperties": false
      }
    },
    "toStageName": {
      "type": "string"
    },
    "fromStageName": {
      "type": "string"
    }
  },
  "required": [
    "allowed",
    "violations",
    "toStageName",
    "fromStageName"
  ],
  "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).