Leads

**Para buscas de todos os leads para BI utilize filtro de data para busca apenas dos leads recentes.

get/api/v1/leads

Request

  • Base URL
    https://api.g1.datacrazy.io
  • URL
    https://api.g1.datacrazy.io/api/v1/leads
  • Auth
    HTTP bearer

Query parameters

searchType'phone' | 'email' | 'name' | 'taxId'
skipnumber

Máximo 10000. Acima disso a resposta vem vazia com details indicando o limite; use filtros de data para paginar registros mais antigos.

takenumber
searchstring
additionalFieldsboolean

Indica se os campos adicionais devem ser incluídos na resposta

rolestring

Cargo do lead

companystring

Empresa relacionada ao lead

typestring

Tipo do lead. Valores possíveis: PERSON, COMPANY

excludeIdsstring

Lista de IDs de leads a serem excluídos da busca, separados por vírgula.

tagsstring

Lista de IDs de tags.

Este campo aceita uma lista de IDs separados por vírgula, com uma operação opcional definida no início da string.

Formato: <operação> <id1>,<id2>,<id3>

Operação (opcional): define como os IDs serão interpretados. Se omitida, a operação padrão é some. Pode ser:

  • some – pelo menos uma das tags.
  • every – todas as tags.
  • none – nenhuma das tags.
stagesstring

ID ou lista de IDs de tags.

Este campo aceita um ID ou uma lista de IDs de tags separados por vírgula, com uma operação opcional definida no início da string.

Formato: <operação> <id1>,<operação> <id2>,<operação> <id3>

Operação (opcional): define como os IDs serão interpretados. Se omitida, a operação padrão é some. Pode ser:

  • some – pelo menos uma das tags.
  • every – todas as tags.
  • none – nenhuma das tags.
minLastPurchaseDatestring date-time

Filtrar clientes que fizeram alguma compra na data 'X' ou anterior

Formato (ISO 8601): YYYY-MM-DDTHH:mm:ss.sssZ

maxLastPurchaseDatestring date-time

Filtrar clientes que fizeram alguma compra na data 'X' ou posterior

Formato (ISO 8601): YYYY-MM-DDTHH:mm:ss.sssZ

productsInBusinessnumber

Quantidade de produtos que há nos negócios do lead

minBusinessesCountnumber

Quantidade mínima de negócios atrelados ao lead

maxBusinessesCountnumber

Quantidade máxima de negócios atrelados ao lead

listsstring

Lista de IDs de listas.

Este campo aceita uma lista de IDs separados por vírgula, com uma operação opcional definida no início da string.

Formato: <operação> <id1>,<id2>,<id3>

Operação (opcional): define como os IDs serão interpretados. Se omitida, a operação padrão é some. Pode ser:

  • some – pelo menos uma das listas.
  • every – todas as listas.
  • none – nenhuma das listas.
hasMessagesboolean

Leads que já possuem alguma mensagem no CRM

notHasMessagesboolean

Leads que não possuem nenhuma mensagem no CRM

sourcestring

Lead por sua origem

productsstring

Lista de IDs de SKUs.

Este campo aceita uma lista de IDs separados por vírgula, com uma operação opcional definida no início da string.

Formato: <operação> <id1>,<id2>,<id3>

Operação (opcional): define como os IDs serão interpretados. Se omitida, a operação padrão é some. Pode ser:

  • some – pelo menos um dos SKUs.
  • every – todos os SKUs.
  • none – nenhum dos SKUs.
attendantstring

ID de atendente.

Este campo aceita uma string referente ao ID do atendente.

fieldsstring

Expressões de filtro em campos adicionais.

Formato: <idDoCampo> <operação> <valorDoCampo>

idDoCampo: ID do campo adicional. operação: tipo de filtro aplicado. Operações disponíveis:

  • contains – campo contém o valor.
  • eq – campo igual ao valor.
  • not – campo não contém o valor. valorDoCampo: conteúdo do campo adicional.
createdAtGreaterOrEqualstring date-time

Data de criação do lead (maior ou igual). Exemplo: filtrar lead que foram criados na data 'X' ou em data posterior

Formato (ISO 8601): YYYY-MM-DDTHH:mm:ss.sssZ

createdAtLessOrEqualstring date-time

Data de criação do lead (menor ou igual). Exemplo: filtrar lead que foram criados na data 'X' ou em data anterior

Formato (ISO 8601): YYYY-MM-DDTHH:mm:ss.sssZ

addressstring

Filtros de endereço.

Formato: <campo> <valorDoCampo>,<campo> <valorDoCampo>,<campo> <valorDoCampo>

Campo: nome do campo a ser consultado. Podem ser utilizados em conjunto conforme o formato acima. Campos disponíveis:

  • block – bairro
  • city – cidade
  • state – estado
  • country – país ValorDoCampo: conteúdo do campo.
{
  "type": "COMPANY",
  "excludeIds": "849fefab-e697-4720-9303-e788c23790cc,9e008d34-86d2-49fd-90af-34a9f9b29896",
  "tags": "every 849fefab-e697-4720-9303-e788c23790cc,9e008d34-86d2-49fd-90af-34a9f9b29896",
  "stages": "none 849fefab-e697-4720-9303-e788c23790cc,9e008d34-86d2-49fd-90af-34a9f9b29896",
  "lists": "every 849fefab-e697-4720-9303-e788c23790cc,9e008d34-86d2-49fd-90af-34a9f9b29896",
  "source": "Google Ads",
  "products": "none 849fefab-e697-4720-9303-e788c23790cc,9e008d34-86d2-49fd-90af-34a9f9b29896",
  "attendant": "849fefab-e697-4720-9303-e788c23790cc",
  "fields": "6f236135-0c72-40d2-9ff5-18c983aeb02b contains texto do campo",
  "address": "city São Pauo"
}

Response

countnumber required

Example response

{
  "count": 100,
  "data": [
    {
      "id": "15b41959-b04d-4a99-b878-6e45fffa7633",
      "createdAt": "2025-06-11T18:31:25.203Z",
      "name": "Guilherme Gavazzoni",
      "image": "https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b",
      "phone": "+55 (47) 991331190",
      "rawPhone": "5547991331190",
      "email": "guilherme@datacrazy.com.br",
      "source": "Google ads",
      "company": "Apple",
      "birthDate": "2000-01-01T00:00:00.000Z",
      "taxId": "108.154.702-92",
      "site": "www.meulead.com.br",
      "instagram": "@guilhermegavazzoni",
      "address": {
        "type": "HEADQUARTERS"
      },
      "addresses": [
        {
          "zip": "88338-130",
          "address": "Avenida Brasil",
          "block": "Centro",
          "city": "Balneário Camboriú",
          "state": "SC",
          "country": "BR",
          "isPrimary": true
        }
      ],
      "tags": {
        "id": "cb3e8d24-ccad-43d1-acd5-08580d9bc674",
        "name": "marketing orgânico",
        "color": "#A78BFA",
        "description": "Leads que vieram de campanhas internas",
        "createdAt": "2025-03-25T14:12:47.738Z"
      },
      "lists": [
        {
          "id": "5343afav-e697-4720-9303-e788c23711dd",
          "name": "ativos",
          "color": "#EB2626",
          "description": "lista de compradores recorrentes",
          "createdAt": "2025-06-12T17:37:17.861Z"
        },
        {
          "id": "f2b3c92d-3843-406f-a3e3-672d2d7d2a27",
          "name": "inativos",
          "color": "#EB2626",
          "description": "lista de compradores de baixa frequência",
          "createdAt": "2025-12-03T17:28:09:5361Z"
        }
      ],
      "attendant": {
        "userId": "t9kn9mqPakdGG535GQK3hod8wzM2",
        "id": "6807e48c25ece34f9f1ba7dd",
        "name": "Joao Silva",
        "email": "joaosilva@gmail.com",
        "phone": "5547991331190",
        "imageURL": "https://dc-qqqq1111pb.s3.amazonaws.com/profiles/koQGLa8p68fNZiiSmE1tec2LHtc2_2025-05-24T00%3A27%3A23.486Z"
      },
      "sourceReferral": {
        "sourceId": "2bc3d979-93a4-4e64-8903-5d9379d3de91",
        "sourceUrl": "https://example.com/artigo-de-origem",
        "ctwaId": "849fefab-e697-4720-9303-e788c23790cc"
      },
      "type": "PERSON",
      "displayName": "DataCrazy Softwares",
      "sector": "Tecnologia",
      "role": "Diretor",
      "notes": "Observações gerais sobre o lead",
      "parentId": "15b41959-b04d-4a99-b878-6e45fffa7633",
      "primaryContactLeadId": "15b41959-b04d-4a99-b878-6e45fffa7633",
      "primaryContact": {
        "id": "15b41959-b04d-4a99-b878-6e45fffa7633",
        "name": "Maria Silva",
        "displayName": "Maria",
        "type": "PERSON",
        "email": "maria@empresa.com",
        "phone": "+5547999999999",
        "image": "https://example.com/avatar.jpg",
        "hasRelationships": true
      },
      "primaryContactFor": [
        {
          "id": "15b41959-b04d-4a99-b878-6e45fffa7633",
          "name": "Maria Silva",
          "displayName": "Maria",
          "type": "PERSON",
          "email": "maria@empresa.com",
          "phone": "+5547999999999",
          "image": "https://example.com/avatar.jpg",
          "hasRelationships": true
        }
      ],
      "relationships": [
        {
          "id": "15b41959-b04d-4a99-b878-6e45fffa7633",
          "leadId": "15b41959-b04d-4a99-b878-6e45fffa7633",
          "relatedLeadId": "9e008d34-86d2-49fd-90af-34a9f9b29896",
          "relationshipType": "EMPLOYEE",
          "type": "PERSON",
          "relatedLead": {
            "id": "15b41959-b04d-4a99-b878-6e45fffa7633",
            "name": "Maria Silva",
            "displayName": "Maria",
            "type": "PERSON",
            "email": "maria@empresa.com",
            "phone": "+5547999999999",
            "image": "https://example.com/avatar.jpg",
            "hasRelationships": true
          }
        }
      ]
    }
  ]
}

Changes

    • breaking

      the /// response's property type changed from object to no type for status

    • breaking

      removed the required property //// from the response with the status

    • breaking

      removed the required property //// from the response with the status

    • breaking

      removed the required property //// from the response with the status

    • breaking

      removed the required property //// from the response with the status

    • info

      added the new optional query request parameter searchType

    • info

      added the optional property //////// to the response with the status

    • info

      added the optional property //////// to the response with the status

    • info

      added the optional property //////// to the response with the status

    • info

      added the optional property //////// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added to the /// response property allOf list for the response status