Is there anyway to create a workspace and invite members by using the command line(API)
Yep!
https://developer.atlassian.com/cloud/trello/rest/api-group-organizations/#api-organizations-post
@Chenchen Mao you can do this pretty easily with a BenkoBot action like this:
https://gist.github.com/iaindooley/99ff3d25f869e2b9d4311f692f888147
You can install that action (you'll need to enter your api key/token first then you can preview the code to edit your workspace name and usernames before running) using this link:
https://app.benkobot.com/addaction?actionCodeName=createWorkspaceAddMembers&code=MTYzMzQ3ODI0OTAwMg==
We also have a community board where you can see some examples and a "crash course"
https://trello.com/b/IoHmhz5c/benkobot-community-board
The bundled Trellinator library is open source so you can also use it as a reference for implementing your own, for example here is the team() method used above to find or create a workspace (which used to be called a team, which used to be called an organization
https://github.com/iaindooley/trellinator-libs/blob/fafa6c2ebf508483b52a33000238a7957d95f998/Member.js#L140
Stole my accepted answer.
It looks like you're new here. Sign in or register to get started.