# How can I create an event with the API?

**URL:** <https://forum.youcanbook.me/t/how-can-i-create-an-event-with-the-api/1224>\
**Category:** API\
**Created:** [June 1, 2021, 9:54am UTC](https://forum.youcanbook.me/t/how-can-i-create-an-event-with-the-api/1224 "2021-06-01T09:54:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aladin](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@Aladin](https://forum.youcanbook.me/u/Aladin)\
**Post date:** [June 1, 2021, 9:54am UTC](https://forum.youcanbook.me/t/how-can-i-create-an-event-with-the-api/1224/1 "2021-06-01T09:54:28Z")

</div>

Hello !

I encounter some issue when I try to create an event by using the API.  
The console show this error : code: “caligraph\_http\_invalid\_payload”, message: “Invalid value”, object: “Event”, field: “start”

Here it’s how I put in my code : ` start:'2021-06-01T13:00:00Z',//string startTimeZone:'Europe/Paris', endTimeZone:'Europe/Paris', end:"2021-06-01T15:00:00Z", title:"test"`

Hope someone could help me.

Thanks,  
Aladin.

---

<div class="post-metadata">

**Author:** ![Ben](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.youcanbook.me/ben/32/772_2.png) [@Ben](https://forum.youcanbook.me/u/Ben)\
**Post date:** [June 1, 2021, 4:49pm UTC](https://forum.youcanbook.me/t/how-can-i-create-an-event-with-the-api/1224/2 "2021-06-01T16:49:15Z")

</div>

Hi @Aladin The minimum payload for a booking is:

```
    {
      "startsAt": "2021-01-21T08:00:00",
      "timeZone": "US/Central",
      "units": 1,
      "numberOfSlots": 1,
       "answers" : [
            {"code" : "EMAIL", "string" : "ben+apitest@testemail.com"},
            {"code" : "FNAME", "string" : "Ben"},
            {"code" : "LNAME", "string" : "Test"}
        ]
    }

```

You will need to pass in all required form fields as well. I hope this helps.
