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

# Scheduler API

> Schedule WhatsApp messages programmatically using the EazyBe Scheduler API

The Scheduler API allows authenticated organizational users to schedule WhatsApp messages programmatically. The API validates user organization membership, verifies required message details, and handles permission issues.

<Warning>
  Do not use this API for spam or bulk messaging. Misuse may result in account bans.
</Warning>

## Endpoint

```
POST https://api.eazybe.com/v2/scheduler/public-scheduler
```

<Card title="Postman Collection" icon="file-code">
  Access the API collection via the EazyBe shared Postman workspace.
</Card>

## Authentication

You need to obtain the **Organization Auth Token** from your EazyBe Workspace.

<Steps>
  <Step title="Access EazyBe Workspace">
    Go to [workspace.eazybe.com](https://workspace.eazybe.com)
  </Step>

  <Step title="Navigate to Organization Page">
    An admin needs to access the Organization page.
  </Step>

  <Step title="Copy Auth Token">
    The Organization Auth Token will be displayed on this page. Copy it for API use.

    <img src="https://mintcdn.com/eazybe/7ajmdd-9F9yx9D--/images/1294609565.png?fit=max&auto=format&n=7ajmdd-9F9yx9D--&q=85&s=e352375854d30dc3af64eca72a2f2310" alt="Organization Auth Token" width="1777" height="483" data-path="images/1294609565.png" />
  </Step>
</Steps>

## Request Payload

The API requires the following fields:

| Field     | Type   | Description                                    |
| --------- | ------ | ---------------------------------------------- |
| `from`    | string | Sender's organizational email address          |
| `to`      | string | Receiver's phone number (international format) |
| `message` | string | Text content to send                           |
| `name`    | string | Receiver's name for notifications              |
| `time`    | string | Scheduled delivery timestamp (ISO 8601 format) |

### Example Payload

```json theme={null}
{
  "from": "hello@eazybe.com",
  "to": "919876543210",
  "message": "Hello World",
  "name": "Vats",
  "time": "2024-03-01T17:25:00.000Z"
}
```

## Code Example (Node.js)

```javascript theme={null}
const axios = require('axios');

const config = {
  method: 'post',
  url: 'https://api.eazybe.com/v2/scheduler/public-scheduler',
  headers: {
    'Authorization': 'Bearer YOUR_ORGANIZATION_AUTH_TOKEN',
    'Content-Type': 'application/json'
  },
  data: {
    from: 'hello@eazybe.com',
    to: '919876543210',
    message: 'Hello World',
    name: 'Vats',
    time: '2024-03-01T17:25:00.000Z'
  }
};

axios(config)
  .then(response => console.log(response.data))
  .catch(error => console.error(error));
```

## Response Status

| Status      | Description                                         |
| ----------- | --------------------------------------------------- |
| **Success** | Message scheduled successfully                      |
| **Failure** | Invalid email, missing fields, or permission issues |

## Best Practices

<CardGroup cols={2}>
  <Card title="Verify Sender" icon="check">
    Ensure the sender email belongs to your organization
  </Card>

  <Card title="Avoid Spam" icon="ban">
    Do not use for mass messaging or spam activities
  </Card>

  <Card title="Valid Token" icon="key">
    Maintain a valid Organization Auth Token
  </Card>

  <Card title="International Format" icon="phone">
    Use international phone number format (e.g., 919876543210)
  </Card>
</CardGroup>

***

<Note>
  If you have any questions or need further assistance, feel free to reach out to us at **[hey@eazybe.com](mailto:hey@eazybe.com)**. We're happy to help!
</Note>
