> For the complete documentation index, see [llms.txt](https://docs.sprinthub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sprinthub.com/topicos/api/api-criando-lead-e-oportunidade-ao-mesmo-tempo.md). Agents can also search and read this documentation through its [MCP server](https://docs.sprinthub.com/~gitbook/mcp).

# API - Criando Lead e Oportunidade ao mesmo tempo

O exemplo do vídeo está utilizando uma planilha do Google enviando dados para a API da SprintHub via método HTTP utilizando a plataforma [https://Make.com](https://make.com/?ref=docs.sprinthub.com), no entanto, o mesmo procedimento pode ser feito usando outras plataformas similares como Zapier ou N8N. Basta adaptar a cada plataforma.

Assista ao vídeo e depois utilize as informações abaixo para configurar o seu.

<mark style="color:red;">**ATENÇÃO**</mark>: Este é um procedimento para usuários avançados que possuam conhecimentos mínimos em métodos HTTP, webservices, e configurações de API.

{% embed url="<https://www.youtube.com/watch?v=xh3MWSBZXYE>" %}

Exemplo de URL para adicionar ao Make.com ou Zapier ou similares:

<https://sprinthub-api-master.sprinthub.app/api/queue?i=SUAINSTANCIA>

Altere os dados abaixo conforme sua preferência.

```json
{
    "endpoints": [
        {
          "url": "https://sprinthub-api-master.sprinthub.app/leads",
          "method": "POST",
          "body": {
            "firstname": "VARIAVEL 1",
            "lastname": "VARIAVEL 2",
            "email": "VARIAVEL 3",
            "whatsapp": "VARIAVEL 4" 
          }
        },
        {
          "url": "https://sprinthub-api-master.sprinthub.app/crmopportunity?id=33",
          "method": "POST",
          "body": {
            "crm_column": 39,
            "lead_id": "{result0.id}",
            "status": "open",
            "sequence": 0,
            "title": "FormGoogle {result0.firstname} {result0.lastname}",
            "value": 1500,
            "user": 140,
            "sprint_permission": "all",
            "sprint_permission_user": "",
            "sprint_permission_users": [],
            "sprint_permission_departments": []
          }
        }
    ]
}
```

Lembrando que dentro do objeto "endpoints" você terá duas chamadas, uma para LEADS e outra para OPORTUNIDADE.

**IMPORTANTE**: Em alguns casos, você terá que minificar o JSON, caso contrário, ao COLAR o texto no Make, ele pode ir com "sujeiras".

Utilize o site: <https://codebeautify.org/jsonminifier>

O JSON acima, minificado, ficaria assim:

```json
{"endpoints":[{"url":"https://sprinthub-api-master.sprinthub.app/leads","method":"POST","body":{"firstname":"VARIAVEL 1","lastname":"VARIAVEL 2","email":"VARIAVEL 3","whatsapp":"VARIAVEL 4"}},{"url":"https://sprinthub-api-master.sprinthub.app/crmopportunity?id=33","method":"POST","body":{"crm_column":39,"lead_id":"{result0.id}","status":"open","sequence":0,"title":"FormGoogle {result0.firstname} {result0.lastname}","value":1500,"user":140,"sprint_permission":"all","sprint_permission_user":"","sprint_permission_users":[],"sprint_permission_departments":[]}}]}
```

Abaixo, um **exemplo** de como ficou usando o Make.com

<figure><img src="https://3534414179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2F4fVTfpD3xsstP49KQ2y9%2FCaptura%20de%20Tela%202023-10-27%20a%CC%80s%2013.53.07.png?alt=media&amp;token=b5971d9c-08d3-4025-b016-dfabb62c786f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://docs.sprinthub.com/content/images/2023/07/Captura-de-Tela-2023-07-11-a-s-18.44.44.png" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sprinthub.com/topicos/api/api-criando-lead-e-oportunidade-ao-mesmo-tempo.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
