---
title: "Run Grid"
method: POST
path: "/v2/grids/run"
tags: ["Grid"]
---

# Run Grid

`POST /v2/grids/run`

You can run your template to produce  of a grid and receive the results  via webhook you provide.

The schema of the request your webhook will receive is <tt>GridResponseV2</tt>, please find its definition at the bottom of the page.

#### Details about the request:

- All sheets from your template will be copied to your new grid, but only those which you specify in the request will be run
- Every sheet request must have <tt>sheet_index</tt>, the rest of the fields are optional. If you supply just <tt>sheet_index</tt>, the sheet will be run exactly as it is in the template.
- Optional arguments:
  - <tt>meeting_ical_uid</tt>: if you supply ical_uid from your calendar, Model ML will look for transcript of this meeting in your account. If it can't be found, the request will fail
  - <tt>global_instructions</tt>: if you supply global instaructions, they will be appended **before** the global instructions already defined in the sheet (if any)
  - <tt>inputs</tt>: you can create rows dynamically by providing inputs. Inputs is a list of objects of the form <tt>{"<colum index>": "<cell value>"}</tt>. It supports multiple columns too, so you can supply:
    - inputs to two columns in one row like <tt>"inputs": [{"0": "input 0", "1": "input 1"}]</tt>
    - two inputs to the same column to create two rows like <tt>"inputs": [{"0": "input 0"}, {"0": "input 1"}]</tt>
    - for asset columns, you can provide a list of ical_uids like <tt>"inputs": [{"0": {"ical_uids": ["your-ical-uid"]}}]</tt>
    - and all combinations of the above

## Request body

- RunGridRequestV2
  - `template_id` string, uuid, required — You can get this from your Model ML frontend, when you have a template open it's the string that goes after `https://app.modelml.com/grid/<template_id>'. Note that it MUST be a template, if you send id of a grid, the request will return a 404.
  - `webhook_url` string, uri, required — This url will be used to send the results to via a POST request. The schema of the results is `GridResponseV1`. We currently don't support any custom headers for authentication, security options will be added soon.
  - `sheets` SheetRequestV2[], required
    - `sheet_index` integer — Index of the sheet for which the inputs are being specified. Must be provided if grid has more than one sheet
    - `meeting_ical_uid` union — You can attach transcripts by providing ical_uids of the event. Accepts both a signle string and a list of stings to attach multiple transcripts. NOTE: API key owner must have access to the transcrip on Model ML to be able to attach it to a grid
      - string
      - string[]
    - `meeting_asset_ids` string[] — You can attach assets by providing asset ids. Accepts both a signle string and a list of stings to attach multiple assets. NOTE: API key owner must have access to the assets on Model ML to be able to attach it to a grid
    - `global_instructions` string, nullable — You cann add custom instructions on top of other instructions you have specified in your template on the UI. If there are some instructions already, instructions from the request will be added BEFORE them.
    - `inputs` object[], nullable — Create grid rows by providing inputs

## Response `200`

Successful Response

- RunGridResponseV2
  - `grid_url` string, uri, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/modelml/apis/model-ml-api.md) · [All operations](https://skmtc.dev/modelml/apis/model-ml-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/modelml/model-ml-api/revisions/5ae43729fe2f/schema)
