> 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/how-to-schedule-a-meeting-via-api.md).

# How to Schedule a Meeting via API

This article explains how to use the public endpoint `/calendarmeeting` of the SprintHub API to automatically schedule meetings based on a calendar created on the platform.

***

#### ✅ Overview

The endpoint `/calendarmeeting` allows you to schedule meetings directly on a calendar link, using data from an existing lead or automatically creating a new lead with the submitted data.

> 📌 **This endpoint is public.** It does not require authentication (`apitoken` or `Authorization`) — but it requires the call to be made within the correct instance context.

```
POST https://sprinthub-api-master.sprinthub.app/calendarmeeting?i=instance_name

```

#### 🔑 Required parameters

| Parameter | Type   | Where it goes | Description                                           |
| --------- | ------ | ------------- | ----------------------------------------------------- |
| `i`       | string | query         | Instance name (e.g.: `support`)                       |
| `keyName` | string | body          | Calendar ID, obtained from the public URL of the link |
| `date`    | string | body          | Meeting date and time in ISO 8601 format (UTC)        |

#### 🧾 Body structure

**🔹 Option 1 – Schedule by creating a new lead**

```json
{
  "keyName": "TGcbitBqLjqmmp5tRzlX3",
  "leadId": null,
  "opportunityId": null,
  "date": "2025-06-27T15:30:00.000Z",
  "formData": {
    "firstname": "Wanderson Fernandes",
    "email": "emailteste@sprinthub.com"
  },
  "properties": {}
}

```

🔹 Option 2 – Schedule for an existing lead

```json
{
  "keyName": "TGcbitBqLjqmmp5tRzlX3",
  "leadId": 2222,
  "opportunityId": null,
  "date": "2025-06-27T15:30:00.000Z",
  "formData": {},
  "properties": {}
}

```

❗ When `leadId` is provided, **do not send the `formData`** to avoid conflicts.

#### 🧠 Important notes

* **`leadId`** must be a valid lead from the same instance.
* **`formData`** is required **only when `leadId` it is `null`** (it will be used to create the lead).
* **`properties`** can remain as `{}`. It is used only for rescheduling or additional data in more advanced calls.
* The date and time must be in **UTC** (e.g.: `2025-06-27T15:30:00.000Z`).
* The calendar link needs to be **active and have available times**.

#### 📌 Where to find the `keyName`

Access your public scheduling link. Example:

```
https://instancia.sprinthub.app/calendar/TGcbitBqLjqmmp5tRzlX3

```

The final part of the URL is the `keyName`:

```json
TGcbitBqLjqmmp5tRzlX3
```

#### 💥 Common errors

| Code    | Meaning                                                                   |
| ------- | ------------------------------------------------------------------------- |
| `CL006` | The `keyName` does not belong to the specified instance or is not active. |
| `CL008` | The `leadId` does not exist or does not belong to the correct instance.   |
| `400`   | Missing or malformed data (e.g.: `null` as a string: `"null"`).           |

request example:

```
curl -X POST "https://sprinthub-api-master.sprinthub.app/calendarmeeting?i=instance" \
  -H "Content-Type: application/json" \
  -d '{
    "keyName": "TGcbitBqLjqmmp5tRzlX3",
    "leadId": null,
    "opportunityId": null,
    "date": "2025-06-27T15:30:00.000Z",
    "formData": {
      "firstname": "Wanderson Fernandes",
      "email": "emailteste@sprinthub.com"
    },
    "properties": {}
  }'

```
