> 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-a-lead-and-opportunity-at-the-same-time.md).

# API - Creating a Lead and Opportunity at the same time

The video example is using a Google spreadsheet sending data to the SprintHub API via HTTP method using the platform [https://Make.com](https://make.com/?ref=docs.sprinthub.com), however, the same procedure can be done using other similar platforms such as Zapier or N8N. Just adapt it 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 of 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": []
          }
        }
    ]
}
```

Remember that within 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 "junk".

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** showing how it looked using Make.com

<figure><img src="https://684109703-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>
