> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ryzeapi.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Event

> Creates an event (meeting/calendar) with date, location and reminder

**Auth:** `TokenAccount` or `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotent:** no

## Description

Sends an **event** message (meeting/calendar card) to a 1-to-1 contact or, more commonly, a group (`@g.us`). The `startAt` and `endAt` fields accept **ISO 8601 (RFC3339)** timestamps with timezone (e.g. `2026-04-28T14:00:00-03:00`) and are converted to Unix seconds internally. The event can optionally include `description`, `location`, `joinLink`, a reminder (`hasReminder` + `reminderOffsetSec`) and flags like `isScheduleCall` and `extraGuestsAllowed`. Supports `delay`, `replyTo` and `replyPrivate`.

## Examples

### Meeting with location and reminder

Creates an event in a group with start and end, a location and a reminder 15 minutes before (`reminderOffsetSec: 900`).

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/message/event/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "number":      "120363312345678901@g.us",
      "name":        "Team meeting",
      "description": "Quarterly planning",
      "startAt":     "2026-04-28T14:00:00-03:00",
      "endAt":       "2026-04-28T16:00:00-03:00",
      "location":    { "name": "Room 3, HQ", "address": "Av. Paulista, 1000" },
      "hasReminder":       true,
      "reminderOffsetSec": 900
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/message/event/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      number:      "120363312345678901@g.us",
      name:        "Team meeting",
      description: "Quarterly planning",
      startAt:     "2026-04-28T14:00:00-03:00",
      endAt:       "2026-04-28T16:00:00-03:00",
      location:    { name: "Room 3, HQ", address: "Av. Paulista, 1000" },
      hasReminder:       true,
      reminderOffsetSec: 900
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/message/event/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "number":      "120363312345678901@g.us",
          "name":        "Team meeting",
          "description": "Quarterly planning",
          "startAt":     "2026-04-28T14:00:00-03:00",
          "endAt":       "2026-04-28T16:00:00-03:00",
          "location":    {"name": "Room 3, HQ", "address": "Av. Paulista, 1000"},
          "hasReminder":       True,
          "reminderOffsetSec": 900
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "number":      "120363312345678901@g.us",
          "name":        "Team meeting",
          "description": "Quarterly planning",
          "startAt":     "2026-04-28T14:00:00-03:00",
          "endAt":       "2026-04-28T16:00:00-03:00",
          "location":    { "name": "Room 3, HQ", "address": "Av. Paulista, 1000" },
          "hasReminder":       true,
          "reminderOffsetSec": 900
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/message/event/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### Scheduled call with link

`isScheduleCall: true` marks the event as a call and `joinLink` provides the link to join.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/message/event/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "number":         "120363312345678901@g.us",
      "name":           "Team daily",
      "startAt":        "2026-05-04T09:00:00-03:00",
      "isScheduleCall": true,
      "joinLink":       "https://meet.example.com/daily"
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/message/event/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      number:         "120363312345678901@g.us",
      name:           "Team daily",
      startAt:        "2026-05-04T09:00:00-03:00",
      isScheduleCall: true,
      joinLink:       "https://meet.example.com/daily"
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/message/event/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "number":         "120363312345678901@g.us",
          "name":           "Team daily",
          "startAt":        "2026-05-04T09:00:00-03:00",
          "isScheduleCall": True,
          "joinLink":       "https://meet.example.com/daily"
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "number":         "120363312345678901@g.us",
          "name":           "Team daily",
          "startAt":        "2026-05-04T09:00:00-03:00",
          "isScheduleCall": true,
          "joinLink":       "https://meet.example.com/daily"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/message/event/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Success response

The returned `content` is the event name, used to index the message in the history. Keep the `messageId` to correlate responses (going/not-going) received via webhook.

```json 200 OK theme={null}
{
  "success": true,
  "message": "Event sent successfully",
  "status":  "sent",
  "data": {
    "messageId":   "3EB08FCF27E532F1D3D3",
    "direction":   "sent",
    "messageType": "event",
    "content":     "Team meeting",
    "source":      "api",
    "timestamp":   "2026-04-28T14:30:00Z",
    "chat": {
      "jid":     "120363312345678901@g.us",
      "isGroup": true
    },
    "sender": {
      "jid":      "5511777777777@s.whatsapp.net",
      "instance": "my-instance"
    }
  }
}
```

<Note>
  Participant RSVPs don't arrive synchronously in this response, they flow as events on the configured webhook/WebSocket, referencing the event's `messageId`.
</Note>

## Path parameters

<ParamField path="instance" type="string" required>
  Instance name (e.g., `$Instance_Name`).
</ParamField>

## Headers

<ParamField header="token" type="string" required>
  `TokenAccount` or `TokenInstance`.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Request body

<ParamField body="number" type="string" required>
  Destination: phone (`5511999999999`) or JID. Events work best in groups (`@g.us`).
</ParamField>

<ParamField body="name" type="string" required>
  Event title shown on the card.
</ParamField>

<ParamField body="startAt" type="string" required>
  Start date/time in **ISO 8601 (RFC3339)** with timezone, e.g. `2026-04-28T14:00:00-03:00`.
</ParamField>

<ParamField body="endAt" type="string">
  End date/time in **ISO 8601 (RFC3339)**. Optional.
</ParamField>

<ParamField body="description" type="string">
  Event description/details.
</ParamField>

<ParamField body="location" type="object">
  Event location. Fields: `name`, `address`, `latitude`, `longitude` (all optional).
</ParamField>

<ParamField body="joinLink" type="string">
  Link to join (used for scheduled calls).
</ParamField>

<ParamField body="isScheduleCall" type="boolean" default="false">
  Marks the event as a scheduled call.
</ParamField>

<ParamField body="hasReminder" type="boolean" default="false">
  Enables a reminder for the event.
</ParamField>

<ParamField body="reminderOffsetSec" type="int" default="0">
  Reminder lead time, in **seconds** before `startAt` (e.g. `900` = 15 min).
</ParamField>

<ParamField body="extraGuestsAllowed" type="boolean" default="false">
  Allows guests to bring additional people.
</ParamField>

<ParamField body="isCanceled" type="boolean" default="false">
  Marks the event as canceled.
</ParamField>

<ParamField body="delay" type="int" default="0">
  Time in **seconds** to wait before sending. During the interval, the server shows the "typing..." indicator to the recipient and triggers "paused" before the actual send.
</ParamField>

<ParamField body="replyTo" type="string">
  ID of the message to reply to. The original message must belong to the same instance and be saved in the database.
</ParamField>

<ParamField body="replyPrivate" type="boolean" default="false">
  When `true` **and** `replyTo` points to a message originating from a group, the event is redirected to the **private chat** of the original author (keeping the quote).
</ParamField>

<ParamField body="source" type="string" default="api">
  Origin identifier for traceability (e.g., `crm`, `support-bot`, `n8n`). Saved on the message record and propagated to webhooks.
</ParamField>

## Notes

<Note>
  * **`startAt`/`endAt` are ISO 8601 (RFC3339)** with timezone; the server converts them to Unix seconds.
  * **`delay` is in seconds** (not milliseconds); **`reminderOffsetSec` is also in seconds**.
  * Events render best in **groups** (`@g.us`).
  * RSVPs don't come back in this call, subscribe to webhook/WebSocket events to receive them referencing the `messageId`.
</Note>

## Errors

| HTTP | Internal status   | Message                                                  |
| ---- | ----------------- | -------------------------------------------------------- |
| 400  | ,                 | `Instance name is required`                              |
| 400  | ,                 | `Invalid request body: <detail>`                         |
| 400  | ,                 | `Number is required`                                     |
| 400  | ,                 | `Name is required`                                       |
| 400  | ,                 | `startAt is required`                                    |
| 400  | `invalid_request` | `Invalid startAt, expected ISO 8601 (RFC3339): <detail>` |
| 400  | `invalid_number`  | `Invalid phone number format: <detail>`                  |
| 404  | ,                 | `Instance not found`                                     |
| 500  | `send_failed`     | `Failed to send event: <reason>`                         |
| 503  | `disconnected`    | `Instance is not connected to WhatsApp`                  |

Error envelope:

```json theme={null}
{
  "success": false,
  "error": { "message": "startAt is required" }
}
```
