Skip to main content

I am encountering a 500 Internal Server Error when attempting to create a one-off event type using the Calendly API. The response I receive is:

{
"title": "Internal Server Error",
"message": "The server encountered an unexpected condition that prevented it from fulfilling the request."
}

Here is the request payload and configuration I am using:

const data = {
name: "My Meeting",
host: uri,
co_hosts: [],
duration: 30,
date_setting: {
type: "date_range",
start_date: "2025-2-6",
end_date: "2025-3-6",
},
location: {
kind: "physical",
location: "Main Office",
additional_info: "string",
},
};

const options = {
method: "POST",
url: "https://api.calendly.com/one_off_event_types",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${accessToken}`,
},
data,
};

Any guidance or clarification would be greatly appreciated. Thank you!

I believe the issue is due to you passing an empty array as the value for the “co_hosts” field. Can you try removing that field instead of sending an empty array?

It also seems to me that your JSON may be invalid because of the additional commas after the values of “end_date” and “additional_info”. Please remove them.

It also doesn’t seem that you want to specify a real value for “additional_info”, so I’d remove that too.

Here is what I think your json payload should look like after the changes I recommended:

const data = {
name: "My Meeting",
host: uri,
duration: 30,
date_setting: {
type: "date_range",
start_date: "2025-2-6",
end_date: "2025-3-6"
},
location: {
kind: "physical",
location: "Main Office"
},
};

I’m also assuming that “uri” was previously defined, so it has a valid value here.


Thank You for all the support!


Reply