Can't add members through Create Card via API when using idCardSource

I’m creating cards via API. When I add the idCardSource (using another card as a template) the field idMembers is ignored. If I just remove the idCardSource from the query parameters, the idMembers field is considered and the members are added to the card. Someone has faced the same situation?

I was not trying to add members to the card using a separate endpoint, I was using the parameter “idMembers” of the “Create Card” endpoint (https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-post-request).

When I input a list of members (idMembers) without inputting a template card (idCardSource), all works fine and the members are added to the card.

Example:

https://api.trello.com/1/cards?idList={ID_LIST}&key={KEY}&token={TOKEN}&due={DUE_DATE}&idMembers=ID_MEMBER1,ID_MEMBER2&name={NAME}

But, when I send both “idMembers” and “idCardSource”, the members are not added to the card.

Example:
https://api.trello.com/1/cards?idList={ID_LIST}&key={KEY}&token={TOKEN}&**idCardSource={ID_CARD_TEMPLATE}**&due={DUE_DATE}&idMembers=ID_MEMBER1,ID_MEMBER2&name={NAME}

If you put the idCardSource at the end of the request, like this:

https://api.trello.com/1/cards?idList={ID_LIST}&key={KEY}&token={TOKEN}&due={DUE_DATE}&idMembers=ID_MEMBER1,ID_MEMBER2&name={NAME}&idCardSource={ID_CARD_TEMPLATE}

are the idMembers parsed and added correctly to the new card?

No. The members are still not being added.

Yep. I just tested and got the same problem. If I add idCardSource to a request and provide the ID of a template card, then idMembers is ignored, irrespective of where in the request that parameter is.

I suggest you log this with Atlassian as a bug.

In the interim, as a work around, you can create the card based on a template, then after it’s been created, add the members.

All right! Thank you for the help @sunnyape !