Ver .md

contacts.get

Ver um contato e sua origem. Contato com a origem completa (primeira indicação de anúncio e o anúncio resolvido: nomes, criativo, permalinkUrl, previewLink, lookupStatus) e todas as indicações do contato, da mais antiga à mais nova. Com lookupStatus diferente de ok só os dados que vieram na mensagem são confiáveis (título, texto, imagem, sourceUrl).

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

Entrada

CampoTipoObrigatórioNota
idstring (uuid)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)$"
    }
  },
  "required": [
    "id"
  ]
}

Exemplo

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

CLI:

node cli/atomiks.mjs contacts.get --json '{"id":"00000000-0000-0000-0000-000000000000"}'

MCP: ferramenta contacts_get 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"
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "phone": {
      "type": [
        "string",
        "null"
      ]
    },
    "waId": {
      "type": "string"
    },
    "firstSeenAt": {
      "type": "string"
    },
    "origin": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "ad",
            "organic"
          ]
        },
        "referral": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "sourceId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "sourceType": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "sourceUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "headline": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "body": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "mediaType": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "imageUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "videoUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "thumbnailUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "ctwaClid": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "welcomeMessage": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channelId": {
                  "type": "string"
                },
                "receivedAt": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "sourceId",
                "sourceType",
                "sourceUrl",
                "headline",
                "body",
                "mediaType",
                "imageUrl",
                "videoUrl",
                "thumbnailUrl",
                "ctwaClid",
                "welcomeMessage",
                "channelId",
                "receivedAt"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "ad": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "adId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "adsetName": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "campaignName": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "creative": {
                  "anyOf": [
                    {},
                    {
                      "type": "null"
                    }
                  ]
                },
                "permalinkUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "previewLink": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "lookupStatus": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "ok",
                    "not_matched",
                    "error"
                  ]
                },
                "lookupError": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "adId",
                "name",
                "adsetName",
                "campaignName",
                "status",
                "creative",
                "permalinkUrl",
                "previewLink",
                "lookupStatus",
                "lookupError"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "kind",
        "referral",
        "ad"
      ],
      "additionalProperties": false
    },
    "referrals": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sourceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceType": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "headline": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": [
              "string",
              "null"
            ]
          },
          "mediaType": {
            "type": [
              "string",
              "null"
            ]
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "videoUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "thumbnailUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "ctwaClid": {
            "type": [
              "string",
              "null"
            ]
          },
          "welcomeMessage": {
            "type": [
              "string",
              "null"
            ]
          },
          "channelId": {
            "type": "string"
          },
          "receivedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "sourceId",
          "sourceType",
          "sourceUrl",
          "headline",
          "body",
          "mediaType",
          "imageUrl",
          "videoUrl",
          "thumbnailUrl",
          "ctwaClid",
          "welcomeMessage",
          "channelId",
          "receivedAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "id",
    "name",
    "phone",
    "waId",
    "firstSeenAt",
    "origin",
    "referrals"
  ],
  "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).