# Create Scheduling Configuration Error

**URL:** <https://forums.nylas.com/t/create-scheduling-configuration-error/194>\
**Category:** Question and Answers\
**Tags:** calendar-api\
**Created:** [May 15, 2024, 1:48am UTC](https://forums.nylas.com/t/create-scheduling-configuration-error/194 "2024-05-15T01:48:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@julian](https://forums.nylas.com/u/julian)\
**Post date:** [May 15, 2024, 1:48am UTC](https://forums.nylas.com/t/create-scheduling-configuration-error/194/1 "2024-05-15T01:48:54Z")

</div>

I ran into the following error when trying to create a scheduling configuration for a calendar associated with a virtual account:

Endpoint: POST /v3/grants/{grant\_id}/scheduling/configurations  
Error: Calendar X does not belong to Y

In this case, I had created two virtual accounts with the same email. When I tried to create a scheduling configuration on the calendar associated with the virtual account that was created first I got the error. Creating a scheduling configuration on the second account created with the duplicate email did not cause any error. Is this the expected behavior?

---

<div class="post-metadata">

**Author:** ![julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@julian](https://forums.nylas.com/u/julian)\
**Post date:** [May 15, 2024, 2:55am UTC](https://forums.nylas.com/t/create-scheduling-configuration-error/194/2 "2024-05-15T02:55:19Z")

</div>

I’ve also noticed that if I set up a virtual grant without a valid email, for example I’ve tried using a uuid, then when I go to create a scheduling configuration it gives me the following error: Failed to find a valid Grant for “f38d2bd9-8b01-4973-bbcb-825a2cdece74”

---

<div class="post-metadata">

**Author:** ![ram](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.nylas.com/ram/32/3_2.png) [@ram](https://forums.nylas.com/u/ram)\
**Post date:** [May 15, 2024, 1:29pm UTC](https://forums.nylas.com/t/create-scheduling-configuration-error/194/3 "2024-05-15T13:29:29Z")

</div>

Hi @julian in our docs we caution against [using emails for virtual accounts](https://developer.nylas.com/docs/v3/calendar/virtual-calendars/#how-virtual-calendars-work). This section also mentions that the email field must be unique. So having two virtual accounts for the same email will cause issues.

Let me investigate and circle back for the second inquiry:

> creating virtual account with email field as UUID causes error when creating a scheduler

---

<div class="post-metadata">

**Author:** ![julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@julian](https://forums.nylas.com/u/julian)\
**Post date:** [May 15, 2024, 11:05pm UTC](https://forums.nylas.com/t/create-scheduling-configuration-error/194/4 "2024-05-15T23:05:24Z")

</div>

Got it, I must have missed that. But using a non-email account does give me problems with Scheduler API.

---

<div class="post-metadata">

**Author:** ![ram](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.nylas.com/ram/32/3_2.png) [@ram](https://forums.nylas.com/u/ram)\
**Post date:** [May 17, 2024, 7:48pm UTC](https://forums.nylas.com/t/create-scheduling-configuration-error/194/5 "2024-05-17T19:48:51Z")

</div>

Hi @julian - I was able to complete the following steps:

1. Create Virtual Account
2. Create Virtual Calendar
3. Create Scheduler Configuration

So to confirm, step 3 is where we are seeing the issue?

I can share the cURL command that I used:

```auto
curl --request POST \
  --url "https://api.us.nylas.com/v3/grants/<GRANT_ID>/scheduling/configurations" \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "version": "1.0.0",
    "requires_session_auth": false,
    "participants": [
      {
        "name": "Test",
        "email": "devrel-virtual-calendar",
        "is_organizer": true,
        "availability": {
          "calendar_ids": [
            "primary"
          ]
        },
        "booking": {
          "calendar_id": "primary"
        }
      }
    ],
    "availability": {
      "duration_minutes": 30
    },
    "event_booking": {
      "title": "My test event"
    }
  }'

```

---

<div class="post-metadata">

**Author:** ![julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@julian](https://forums.nylas.com/u/julian)\
**Post date:** [May 17, 2024, 9:53pm UTC](https://forums.nylas.com/t/create-scheduling-configuration-error/194/6 "2024-05-17T21:53:31Z")

</div>

Yes, step 3 is where I’m having the issue. I just tried your cURL command on a grant/calendar I created and got the same error. Could you provide the cURLs you’re using for the first 2 steps just so I can double check on my end? Also is there a chance that the region is causing an issue? I’m on an EU sandbox. That’s the only other thing I noticed that looked different.

---

<div class="post-metadata">

**Author:** ![ram](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.nylas.com/ram/32/3_2.png) [@ram](https://forums.nylas.com/u/ram)\
**Post date:** [May 21, 2024, 6:51pm UTC](https://forums.nylas.com/t/create-scheduling-configuration-error/194/7 "2024-05-21T18:51:52Z")

</div>

Sure, here are the steps I used taken from our developer docs:

1. [Create Virtual Calendar Connector and Virtual Account](https://developer.nylas.com/docs/v3/calendar/virtual-calendars/#authenticate-a-virtual-account)
2. [Create a Virtual Calendar](https://developer.nylas.com/docs/v3/calendar/virtual-calendars/#create-a-virtual-calendar)

---

<div class="post-metadata">

**Author:** ![julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@julian](https://forums.nylas.com/u/julian)\
**Post date:** [May 21, 2024, 10:46pm UTC](https://forums.nylas.com/t/create-scheduling-configuration-error/194/8 "2024-05-21T22:46:53Z")

</div>

If I use a string like you provided “devrel-virtual-calendar” or “julian-email” for email when creating a virtual calendar then step 3 works. However if I use a uuid for email then I get the error.

---

<div class="post-metadata">

**Author:** ![julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@julian](https://forums.nylas.com/u/julian)\
**Post date:** [May 21, 2024, 10:53pm UTC](https://forums.nylas.com/t/create-scheduling-configuration-error/194/9 "2024-05-21T22:53:03Z")

</div>

Yes, there must be something about the implementation that interferes with the logic when email is a UUID. For example, if I set the email to `e5dc434b-bcaa-47cb-bb63-d8f4da96b235` then I get the error, but if I do `julian@e5dc434b-bcaa-47cb-bb63-d8f4da96b235` then everything works fine.

Not a big deal, I’ll just add a prefix, but odd nonetheless
