Setting calendar on profile created from template does not work

Hi there

I’m trying to create a profile from a template using the API. This works fine, however when creating the template I’m required to specify the calendar to check for conflicting and which one to send events to. So I set, lets say email A for both settings. Then using the API, I would like to create a new profile based on that template, but specify another email… email B

I trield the following payload:

{
    "templateId": "{TemplateID}",
    "subdomain": "{Subdomain}",
    "title": "{Title}",
    "calendars": {
        "calendarIds": [
            "email B"
        ]
    },
    "targetCalendarId": "email B",
    "status": "ONLINE"
}

It correctly creates the profile and I can see it in the dashboard. However it still shows the original email of the template as the connected for both categories (conflict checking and inserted events).

I then tried to PATCH it instead afterwards.

So a call to /v1/profiles/{profileId} with:

{
“calendars”: {
“calendarIds”: [
“email B”
]
},
“targetCalendarId”: “email B”
}

I then check in the dashboard and I see that one of the categories (“We’ll check your availability on:”) is now correctly set as email B, but not the other. The other category (“And create new booking events on”) is still email A.

Any help would be highly appreciated.

@DavidTriba The initial POST to create the page from a template currently won’t allow to update calendar connections, so the second PATCH is recommended. Have you are updating things should be working:
“calendars”:{
“calendarIds”:[
https://api.youcanbook.me/v1/{accountId}/remoteaccounts/{integrationId}/calendars/{calendarId}
],
“targetCalendarId”: “https://api.youcanbook.me/v1/{accountId}/remoteaccounts/{integrationId}/calendars/{calendarId}
}