# Manage events with Node.js

Source: https://developer.nylas.com/docs/v3/sdks/node/manage-events/

```js
const now = Math.floor(Date.now() / 1000); // Time in Unix timestamp format (in seconds)

async function createAnEvent() {
  try {
    const event = await nylas.events.create({
      identifier: "<NYLAS_GRANT_ID>",
      requestBody: {
        title: "Build With Nylas",
        when: {
          startTime: now,
          endTime: now + 3600,
          participants: [{ email: "my.friend@example.com", name: "My Friend" }],
        },
      },
      queryParams: {
        calendarId: "<CALENDAR_ID>",
        notifyParticipants: true,
      },
    });

    console.log("Event:", event);
  } catch (error) {
    console.error("Error creating event:", error);
  }
}

createAnEvent();
```

## RSVP to an event

The following code sample replies "Yes" to an event.

```js
async function sendEventRSVP() {
  try {
    const event = await nylas.events.update({
      identifier: "<NYLAS_GRANT_ID>",
      eventId: "<EVENT_ID>",
      requestBody: {
        participants: [
          {
            name: "Nylas DevRel",
            email: "devrelram@example.com",
            status: "yes",
          },
        ],
      },
      queryParams: {
        calendarId: "<CALENDAR_ID>",
      },
    });

    console.log("Event RSVP:", event);
  } catch (error) {
    console.error("Error to RSVP participant for event:", error);
  }
}

sendEventRSVP();
```

For more information, see the [Send RSVP references](/docs/reference/api/events/send-rsvp/).