How can I use an App Template to create a new workspace with multiple boards through the API?

I have created an App Template that we use to create a set of 3 boards in our Workspaces.
I’m trying to automate it using GraphQL in Postman.
I have two questions:

  1. I don’t know what I have wrong with the variables definitions that they are not working
    {“v_client” : “{{env_vclient}}”,
    “wp_id” : {{env_vwpid}}
    }

GraphQL Code in Postman:
mutation new_board($v_client: String!,$wp_id: Int){
create_board (board_name: $v_client, board_kind: private, template_id: 2518XXXXXX, workspace_id: $wp_id) {
id
}
}
Does the API support App Templates? How can I use it with the API?

  1. I tried simplifying the request and use the ID of a single board of the template that I got from the URL, but it didn’t work. I get the error “The template ID given is not an account template”

GraphQL code in Postman
mutation new_board{
create_board (board_name: “Sprints”, board_kind: private, template_id: 2518XXXXXX, workspace_id: 265YYYY) {
id
}
}

Hi @Rolando, :slight_smile:

Could you please let me know how you’re getting your template ID?

Hello Alessandra…

I tried two ways:

  1. Enabled the Developer mode to see the App template ID in the preview page. I couldn’t find it this way. These are the steps that I followed:
    a. Enabled the developer mode from monday.labs
    b. I simulated that I was going to use the App template to create a new set of boards in a workspace that I already have.
    c. I look for the App Template and checked the preview page that there is no ID.

  2. Somewhere, I read that you could also open a workspace and board that you want and use the code in the URL (browser tab). That should be the ID of the board. These are the steps that I followed:
    a. I opened the workspace that the App template is based upon and one of its boards.
    b. From the URL, I copied the ID at the end of it.
    This code didn’t work either.

I am also wondering if the API supports an App template or it’s only boards templates.

Thanks in advance for your help on this,
Rolando

Hello there @Rolando ,

There is no API method to “duplicate an app” if that is what you are asking.

To create a board from a template you have to:

  1. Go to your monday account and find your board on the left pane.
  2. Click on the 3 dots next to the name of the board.
  3. Save as a template
  4. In Postman use a mutation like this one:

Query:

mutation new_board($v_client: String!,$wp_id: Int){
create_board (board_name: $v_client, board_kind: private, template_id: 1234567890, workspace_id: $wp_id) {
id
}
}

GraphQL variables:

{
    "v_client": "Some text",
    "wp_id": 12121212
}

The template ID will be the ID of the board that you saved as a template.

The workspace ID will be the ID of the workspace in which the new board will be created. If you go to your workspace, you should see it in your address bar. Example: monday.com: Where Teams Get Work Done

If you pass workspace_id: null, the board will be created in the main workspace.

Let me know if you have any questions :slightly_smiling_face:

Cheers,
Matias

I have the same need as Rolando. My use case is that, while the new workspace template feature is cool, it’s problematic in that it doesnt maintain relationships between boards like an app template does. So I created the stuff we need in a workspace app template.

In reading your response to his question, I’m a bit unclear as to whether monday supports this or not via API. When manually creating things from templates in the workspace the terminology is vague (it just says “create from template” not “create board from template”). Can you clarify?

Hello there @JoeH,

I am not sure I follow the question. What are you trying to do via API exactly?