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

# Schedule Call

> Schedules a call, creating a link and sending an event card with the link, the title, and the start time

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

## Description

Schedules a **WhatsApp call** for a future time. Creates a call link and sends, in the chat of the given number, a scheduled-call event card carrying that link, the title (`name`), and the start time (`startTime`). The recipient sees the event card and can open the link to join once it starts. Use the `video` field to choose between an audio link (default) or a video link.

<Note>
  `startTime` (and `endTime`, when provided) use a **Unix timestamp in seconds**, not milliseconds, and `startTime` must be in the future.
</Note>

## Examples

### Simple scheduling

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/call/schedule/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "number": "5511999999999",
      "name": "Team meeting",
      "startTime": 1751500000
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/call/schedule/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      number: "5511999999999",
      name: "Team meeting",
      startTime: 1751500000
    })
  });
  ```

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

  requests.post(
      f"https://ryzeapi.cloud/api/call/schedule/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "number": "5511999999999",
          "name": "Team meeting",
          "startTime": 1751500000
      }
  )
  ```

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

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

  func main() {
      body := strings.NewReader(`{
          "number": "5511999999999",
          "name": "Team meeting",
          "startTime": 1751500000
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/call/schedule/"+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>

### With description, end time, and reminder

`description` adds an agenda to the event, `endTime` sets the end time, and `reminderOffsetSec` sets how many seconds before the start a reminder is shown to the recipient.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/call/schedule/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "number": "5511999999999",
      "name": "Team meeting",
      "description": "Weekly team sync",
      "startTime": 1751500000,
      "endTime": 1751503600,
      "video": true,
      "reminderOffsetSec": 900
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/call/schedule/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      number: "5511999999999",
      name: "Team meeting",
      description: "Weekly team sync",
      startTime: 1751500000,
      endTime: 1751503600,
      video: true,
      reminderOffsetSec: 900
    })
  });
  ```

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

  requests.post(
      f"https://ryzeapi.cloud/api/call/schedule/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "number": "5511999999999",
          "name": "Team meeting",
          "description": "Weekly team sync",
          "startTime": 1751500000,
          "endTime": 1751503600,
          "video": True,
          "reminderOffsetSec": 900
      }
  )
  ```

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

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

  func main() {
      body := strings.NewReader(`{
          "number": "5511999999999",
          "name": "Team meeting",
          "description": "Weekly team sync",
          "startTime": 1751500000,
          "endTime": 1751503600,
          "video": true,
          "reminderOffsetSec": 900
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/call/schedule/"+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

```json 200 OK theme={null}
{
  "success":   true,
  "messageId": "3EB08FCF27E532F1D3D3",
  "token":     "AbCdEfGhIjKlMnOp",
  "url":       "https://call.whatsapp.com/audio/AbCdEfGhIjKlMnOp",
  "startTime": 1751500000
}
```

<Note>
  `messageId` identifies the event message sent to the recipient. `token` and `url` belong to the call link that was already created, useful if it needs to be shared manually. `startTime` confirms the recorded start time.
</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 number (`5511999999999`) or JID (`5511999999999@s.whatsapp.net`).
</ParamField>

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

<ParamField body="startTime" type="integer" required>
  Call start date and time, as a **Unix timestamp (seconds)**. Must be in the future.
</ParamField>

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

<ParamField body="endTime" type="integer" default="0">
  End date and time, as a **Unix timestamp (seconds)**. Omitted or `0` means no end time is set. When provided, it must be greater than `startTime`.
</ParamField>

<ParamField body="video" type="boolean" default="false">
  When `true`, generates a **video** call link instead of audio.
</ParamField>

<ParamField body="reminderOffsetSec" type="integer">
  How many seconds before the start a reminder should be shown to the recipient.
</ParamField>

## Errors

| HTTP | Message                                          |
| ---- | ------------------------------------------------ |
| 400  | `Instance name is required`                      |
| 400  | `Invalid request body: <detail>`                 |
| 400  | `Number is required`                             |
| 400  | `startTime must be in the future (Unix seconds)` |
| 400  | `endTime must be after startTime`                |
| 404  | `instance not found`                             |
| 500  | `<failure reason>`                               |

Error envelope:

```json theme={null}
{
  "success": false,
  "error": { "message": "startTime must be in the future (Unix seconds)" }
}
```
