> 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/en/topics/api/api-creating-lead-and-opportunity-at-the-same-time.md).

# API - Creating Lead and Opportunity at the same time

The video example is using a Google sheet sending data to the SprintHub API via HTTP method using the [https://Make.com](https://make.com/?ref=docs.sprinthub.com), however, the same procedure can be done using other similar platforms like Zapier or N8N. Just adapt to each platform.

Watch the video and then use the information below to configure yours.

<mark style="color:red;">**ATTENTION**</mark>: This is a procedure for advanced users who have minimum knowledge of HTTP methods, webservices, and API configurations.

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

Example URL to add to Make.com or Zapier or similar:

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

Change the data below according to your preference.

```json
{
    "endpoints": [
        {
          "url": "https://sprinthub-api-master.sprinthub.app/leads",
          "method": "POST",
          "body": {
            "firstname": "VARIABLE 1",
            "lastname": "VARIABLE 2",
            "email": "VARIABLE 3",
            "whatsapp": "VARIABLE 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": []
          }
        }
    ]
}
```

Remembering that inside the "endpoints" object you will have two calls, one for LEADS and another for OPPORTUNITY.

**IMPORTANT**: In some cases, you will have to minify the JSON, otherwise, when PASTING the text into Make, it may come with "dirt".

Use the site: <https://codebeautify.org/jsonminifier>

The JSON above, minified, would look like this:

```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":[]}}]}
```

Below, a **example** of how it looked using Make.com

<figure><img src="/files/9c000b3ed86a07c7d79a044eef4fd08a25af57dc" 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/en/topics/api/api-creating-lead-and-opportunity-at-the-same-time.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.
