Ver .md

pipelines.opportunity_assignments_set

Definir os atendentes da oportunidade por papel. Troca os atendentes do card (um por papel, attendantTypeId; sem papel vale "Sem categoria"). O principal (isPrimary, ou o primeiro) vira o responsável (ownerId). Lista vazia tira todos os atendentes e o responsável. Diferente de crm.opportunities_bulk_attendants, aceita lista vazia.

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

Entrada

CampoTipoObrigatórioNota
idstring (uuid)sim
assignmentsobject[]sim
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "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)$"
    },
    "assignments": {
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "attendantId": {
            "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)$"
          },
          "attendantTypeId": {
            "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"
              }
            ]
          },
          "isPrimary": {
            "type": "boolean"
          }
        },
        "required": [
          "attendantId"
        ]
      }
    }
  },
  "required": [
    "id",
    "assignments"
  ]
}

Exemplo

curl -X POST https://app.atomiks.com.br/api/v1/pipelines.opportunity_assignments_set \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id":"00000000-0000-0000-0000-000000000000","assignments":[{"attendantId":"00000000-0000-0000-0000-000000000000","attendantTypeId":"00000000-0000-0000-0000-000000000000","isPrimary":true}]}'

CLI:

node cli/atomiks.mjs pipelines.opportunity_assignments_set --json '{"id":"00000000-0000-0000-0000-000000000000","assignments":[{"attendantId":"00000000-0000-0000-0000-000000000000","attendantTypeId":"00000000-0000-0000-0000-000000000000","isPrimary":true}]}'

MCP: ferramenta pipelines_opportunity_assignments_set com a mesma entrada.

Saída

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

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "card": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "open",
            "won",
            "lost"
          ]
        },
        "valueCents": {
          "type": [
            "number",
            "null"
          ]
        },
        "pipelineId": {
          "type": "string"
        },
        "pipelineName": {
          "type": "string"
        },
        "stageId": {
          "type": "string"
        },
        "stageName": {
          "type": "string"
        },
        "contactId": {
          "type": "string"
        },
        "contactName": {
          "type": [
            "string",
            "null"
          ]
        },
        "contacts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "phone",
              "email"
            ],
            "additionalProperties": false
          }
        },
        "companies": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          }
        },
        "offers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "priceCents": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "priceCents"
            ],
            "additionalProperties": false
          }
        },
        "owner": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "attendants": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "attendantId": {
                "type": "string"
              },
              "attendantName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "typeId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "typeName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "isPrimary": {
                "type": "boolean"
              }
            },
            "required": [
              "attendantId",
              "attendantName",
              "typeId",
              "typeName",
              "isPrimary"
            ],
            "additionalProperties": false
          }
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "color": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "color"
            ],
            "additionalProperties": false
          }
        },
        "priority": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "low",
                "normal",
                "high",
                "urgent"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "expectedCloseDate": {
          "type": [
            "string",
            "null"
          ]
        },
        "probability": {
          "type": [
            "number",
            "null"
          ]
        },
        "origin": {
          "type": [
            "string",
            "null"
          ]
        },
        "referredBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "lostReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "lostAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "lossObservation": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "title",
        "status",
        "valueCents",
        "pipelineId",
        "pipelineName",
        "stageId",
        "stageName",
        "contactId",
        "contactName",
        "contacts",
        "companies",
        "offers",
        "owner",
        "attendants",
        "tags",
        "priority",
        "expectedCloseDate",
        "probability",
        "origin",
        "referredBy",
        "lostReason",
        "lostAt",
        "lossObservation",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": false
    },
    "stages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "open",
              "won",
              "lost"
            ]
          },
          "position": {
            "type": "number"
          },
          "capiEvent": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "position",
          "capiEvent"
        ],
        "additionalProperties": false
      }
    },
    "history": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fromStageId": {
            "type": [
              "string",
              "null"
            ]
          },
          "toStageId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "fromStageId",
          "toStageId",
          "createdAt"
        ],
        "additionalProperties": false
      }
    },
    "lostReasons": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "attachmentsCount": {
      "type": "number"
    }
  },
  "required": [
    "card",
    "stages",
    "history",
    "lostReasons",
    "attachmentsCount"
  ],
  "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).

pipelines.opportunity_assignments_set · Atomiks API