> 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).

# 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="/files/4oAynd9isTpEBxnCsGWy" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
