{"openapi":"3.1.0","info":{"title":"Model ML API","description":"<h3>Model ML makes powerful API endpoints available for your custom automations.</h3>\n<br/><h4>Authorization</h4><br/>To access the API you need to supply <tt>{\"X-API-KEY\": \"Bearer <api-key>\"}</tt> header. Use the same <tt>Bearer <api-key></tt> string to authorize requests from this interactive documentation. <br/><br/>\nDidn't find what you were looking for? Talk to us through the help center on the Model ML platform and we will add your request to the roadmap!\n","version":"v1.0.0"},"paths":{"/v2/grids/run":{"post":{"tags":["Grid"],"summary":"Run Grid","description":"You can run your template to produce  of a grid and receive the results  via webhook you provide.\n\nThe schema of the request your webhook will receive is <tt>GridResponseV2</tt>, please find its definition at the bottom of the page.\n\n#### Details about the request:\n\n- All sheets from your template will be copied to your new grid, but only those which you specify in the request will be run\n- 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.\n- Optional arguments:\n  - <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\n  - <tt>global_instructions</tt>: if you supply global instaructions, they will be appended **before** the global instructions already defined in the sheet (if any)\n  - <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:\n    - inputs to two columns in one row like <tt>\"inputs\": [{\"0\": \"input 0\", \"1\": \"input 1\"}]</tt>\n    - two inputs to the same column to create two rows like <tt>\"inputs\": [{\"0\": \"input 0\"}, {\"0\": \"input 1\"}]</tt>\n    - for asset columns, you can provide a list of ical_uids like <tt>\"inputs\": [{\"0\": {\"ical_uids\": [\"your-ical-uid\"]}}]</tt>\n    - and all combinations of the above","operationId":"run_grid_v2_grids_run_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunGridRequestV2","examples":[{"template_id":"123e4567-e89b-12d3-a456-426614174000","webhook_url":"https://your-webhook.url/endpoint","sheets":[{"sheet_index":0,"meeting_ical_uid":["your-ical-uid","your-ical-uid-2"],"global_instructions":"Custom instructions for your grid","inputs":[{"0":"Input for first column","1":{"ical_uids":["your-ical-uid"]}}]}]}]}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunGridResponseV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v2/grids/grid/{grid_id}":{"get":{"tags":["Grid"],"summary":"Get Grid","description":"Get results of a previously run grid. You can use both grid ids from your previous API calls and from Model ML platform URL (....modelml.com/grid/<grid_id>)","operationId":"get_grid_v2_grids_grid__grid_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"grid_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Grid Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GridResponseV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AICellV2":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"column_id":{"type":"string","format":"uuid","title":"Column Id"},"row_id":{"type":"string","format":"uuid","title":"Row Id"},"column_index":{"type":"integer","title":"Column Index"},"row_index":{"type":"integer","title":"Row Index"},"content":{"type":"string","title":"Content"},"status":{"$ref":"#/components/schemas/GridCellStatus"},"is_locked":{"type":"boolean","title":"Is Locked"},"sources":{"additionalProperties":{"type":"string"},"type":"object","title":"Sources"}},"type":"object","required":["id","column_id","row_id","column_index","row_index","content","status","is_locked","sources"],"title":"AICellV2"},"AIGridColumnV2":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"index":{"type":"integer","title":"Index"},"is_pinned":{"type":"boolean","title":"Is Pinned"},"auto_reference":{"type":"boolean","title":"Auto Reference"},"datatype":{"oneOf":[{"$ref":"#/components/schemas/LongTextOptions"},{"$ref":"#/components/schemas/ShortTextOptions"},{"$ref":"#/components/schemas/DateOptions"},{"$ref":"#/components/schemas/NumberOptions"},{"$ref":"#/components/schemas/PercentageOptions"},{"$ref":"#/components/schemas/CurrencyOptions"},{"$ref":"#/components/schemas/SingleSelectOptions"},{"$ref":"#/components/schemas/MultiSelectOptions"},{"$ref":"#/components/schemas/UrlOptions"},{"$ref":"#/components/schemas/ImageOptions"},{"$ref":"#/components/schemas/AssetOptions"},{"$ref":"#/components/schemas/CustomStructuredOptions"}],"title":"Datatype","discriminator":{"propertyName":"datatype","mapping":{"asset":"#/components/schemas/AssetOptions","currency":"#/components/schemas/CurrencyOptions","custom_structured":"#/components/schemas/CustomStructuredOptions","date":"#/components/schemas/DateOptions","image":"#/components/schemas/ImageOptions","long-text":"#/components/schemas/LongTextOptions","multi_select":"#/components/schemas/MultiSelectOptions","number":"#/components/schemas/NumberOptions","percentage":"#/components/schemas/PercentageOptions","short-text":"#/components/schemas/ShortTextOptions","single_select":"#/components/schemas/SingleSelectOptions","url":"#/components/schemas/UrlOptions"}}},"name":{"type":"string","title":"Name"},"type":{"type":"string","const":"AI","title":"Type"},"prompt":{"type":"string","title":"Prompt"},"tool_selection":{"$ref":"#/components/schemas/ToolSelection"}},"type":"object","required":["id","index","is_pinned","auto_reference","datatype","name","type","prompt","tool_selection"],"title":"AIGridColumnV2"},"AssetCellV2":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"column_id":{"type":"string","format":"uuid","title":"Column Id"},"row_id":{"type":"string","format":"uuid","title":"Row Id"},"column_index":{"type":"integer","title":"Column Index"},"row_index":{"type":"integer","title":"Row Index"},"asset_names":{"items":{"type":"string"},"type":"array","title":"Asset Names"}},"type":"object","required":["id","column_id","row_id","column_index","row_index","asset_names"],"title":"AssetCellV2"},"AssetGridColumnV2":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"index":{"type":"integer","title":"Index"},"is_pinned":{"type":"boolean","title":"Is Pinned"},"auto_reference":{"type":"boolean","title":"Auto Reference"},"datatype":{"oneOf":[{"$ref":"#/components/schemas/LongTextOptions"},{"$ref":"#/components/schemas/ShortTextOptions"},{"$ref":"#/components/schemas/DateOptions"},{"$ref":"#/components/schemas/NumberOptions"},{"$ref":"#/components/schemas/PercentageOptions"},{"$ref":"#/components/schemas/CurrencyOptions"},{"$ref":"#/components/schemas/SingleSelectOptions"},{"$ref":"#/components/schemas/MultiSelectOptions"},{"$ref":"#/components/schemas/UrlOptions"},{"$ref":"#/components/schemas/ImageOptions"},{"$ref":"#/components/schemas/AssetOptions"},{"$ref":"#/components/schemas/CustomStructuredOptions"}],"title":"Datatype","discriminator":{"propertyName":"datatype","mapping":{"asset":"#/components/schemas/AssetOptions","currency":"#/components/schemas/CurrencyOptions","custom_structured":"#/components/schemas/CustomStructuredOptions","date":"#/components/schemas/DateOptions","image":"#/components/schemas/ImageOptions","long-text":"#/components/schemas/LongTextOptions","multi_select":"#/components/schemas/MultiSelectOptions","number":"#/components/schemas/NumberOptions","percentage":"#/components/schemas/PercentageOptions","short-text":"#/components/schemas/ShortTextOptions","single_select":"#/components/schemas/SingleSelectOptions","url":"#/components/schemas/UrlOptions"}}},"name":{"type":"string","title":"Name"},"type":{"type":"string","const":"MANUAL","title":"Type"}},"type":"object","required":["id","index","is_pinned","auto_reference","name","type"],"title":"AssetGridColumnV2"},"AssetOptions":{"properties":{"datatype":{"type":"string","const":"asset","title":"Datatype","default":"asset"}},"type":"object","title":"AssetOptions"},"CurrencyCode":{"type":"string","enum":["GBP","USD","EUR","JPY","INR","AUD"],"title":"CurrencyCode"},"CurrencyOptions":{"properties":{"decimal_places":{"type":"integer","title":"Decimal Places","default":2},"format":{"$ref":"#/components/schemas/NumberFormat","default":"PLAIN"},"datatype":{"type":"string","const":"currency","title":"Datatype","default":"currency"},"currency_symbol":{"anyOf":[{"$ref":"#/components/schemas/CurrencyCode"},{"type":"string"}],"title":"Currency Symbol","default":"USD"}},"type":"object","title":"CurrencyOptions","description":"Datatype used when the LLM must return a currency value."},"CustomStructuredOptions":{"properties":{"datatype":{"type":"string","const":"custom_structured","title":"Datatype","default":"custom_structured"}},"type":"object","title":"CustomStructuredOptions"},"DateFormat":{"type":"string","enum":["MM-DD-YYYY","DD-MM-YYYY","MONTH-YEAR","YYYY"],"title":"DateFormat"},"DateOptions":{"properties":{"datatype":{"type":"string","const":"date","title":"Datatype","default":"date"},"format":{"$ref":"#/components/schemas/DateFormat","default":"MM-DD-YYYY"}},"type":"object","title":"DateOptions","description":"Datatype used when the LLM must return a date."},"EnumFormat":{"properties":{"values":{"items":{"$ref":"#/components/schemas/EnumFormatValue"},"type":"array","minItems":1,"title":"Values","description":"The list of allowed values and associated colors for the enum field. *This must have at least one value*. If the user requests that this be empty, refuse."}},"type":"object","required":["values"],"title":"EnumFormat"},"EnumFormatValue":{"properties":{"value":{"type":"string","title":"Value","description":"The name of the enum option. E.g. 'Yes' or 'No'"},"color":{"title":"Color"}},"type":"object","required":["value"],"title":"EnumFormatValue"},"GridCellStatus":{"type":"string","enum":["in-progress","preparing","done","cancelled","failed","timed_out","queued"],"title":"GridCellStatus"},"GridResponseV2":{"properties":{"grid_id":{"type":"string","format":"uuid","title":"Grid Id"},"grid_name":{"type":"string","title":"Grid Name"},"data":{"items":{"$ref":"#/components/schemas/GridSheetResultV2"},"type":"array","title":"Data"}},"type":"object","required":["grid_id","grid_name","data"],"title":"GridResponseV2"},"GridRowV2":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"index":{"type":"integer","title":"Index"},"is_pinned":{"type":"boolean","title":"Is Pinned","default":false}},"type":"object","required":["id","index"],"title":"GridRowV2"},"GridSheetResultV2":{"properties":{"sheet_id":{"type":"string","format":"uuid","title":"Sheet Id"},"sheet_index":{"type":"integer","title":"Sheet Index"},"sheet_name":{"type":"string","title":"Sheet Name"},"columns":{"items":{"anyOf":[{"$ref":"#/components/schemas/AIGridColumnV2"},{"$ref":"#/components/schemas/TextGridColumnV2"},{"$ref":"#/components/schemas/AssetGridColumnV2"}]},"type":"array","title":"Columns"},"rows":{"items":{"$ref":"#/components/schemas/GridRowV2"},"type":"array","title":"Rows"},"cells":{"items":{"anyOf":[{"$ref":"#/components/schemas/AICellV2"},{"$ref":"#/components/schemas/TextCellV2"},{"$ref":"#/components/schemas/AssetCellV2"}]},"type":"array","title":"Cells"}},"type":"object","required":["sheet_id","sheet_index","sheet_name","columns","rows","cells"],"title":"GridSheetResultV2"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImageOptions":{"properties":{"datatype":{"type":"string","const":"image","title":"Datatype","default":"image"}},"type":"object","title":"ImageOptions"},"IncludeOrExclude":{"type":"string","enum":["include","exclude"],"title":"IncludeOrExclude"},"LongTextOptions":{"properties":{"datatype":{"type":"string","const":"long-text","title":"Datatype","default":"long-text"},"format":{"type":"string","title":"Format","description":"Instruction the LLM must follow when generating the long text.","default":""}},"type":"object","title":"LongTextOptions","description":"Datatype used when the LLM must return a long text."},"MCPToolConfig":{"properties":{"connection_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Connection Ids","description":"Enabled org MCP connection IDs for the generic MCP tool option."}},"type":"object","title":"MCPToolConfig"},"MultiSelectOptions":{"properties":{"datatype":{"type":"string","const":"multi_select","title":"Datatype","default":"multi_select"},"enum_format":{"$ref":"#/components/schemas/EnumFormat","description":"The allowed values for the multi-select field."}},"type":"object","required":["enum_format"],"title":"MultiSelectOptions","description":"Datatype used when the LLM must select multiple options from a list of options.\nUse this tool when the response options are bounded and not mutually exclusive.\nTypycal examples: company sectors, product categories, etc."},"NumberFormat":{"type":"string","enum":["PLAIN","THOUSANDS","MILLIONS","BILLIONS","TRILLIONS","MULTIPLIER"],"title":"NumberFormat"},"NumberOptions":{"properties":{"decimal_places":{"type":"integer","title":"Decimal Places","default":2},"format":{"$ref":"#/components/schemas/NumberFormat","default":"PLAIN"},"datatype":{"type":"string","const":"number","title":"Datatype","default":"number"}},"type":"object","title":"NumberOptions","description":"Datatype used when the LLM must return a number."},"PercentageOptions":{"properties":{"decimal_places":{"type":"integer","title":"Decimal Places","default":2},"datatype":{"type":"string","const":"percentage","title":"Datatype","default":"percentage"}},"type":"object","title":"PercentageOptions","description":"Datatype used when the LLM must return a percentage value."},"ReasoningLevel":{"type":"string","enum":["no_reasoning","none","low","medium","high","xhigh","max","auto"],"title":"ReasoningLevel"},"RunGridRequestV2":{"properties":{"template_id":{"type":"string","format":"uuid","title":"Template Id","description":"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":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Webhook Url","description":"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":{"items":{"$ref":"#/components/schemas/SheetRequestV2"},"type":"array","title":"Sheets"}},"type":"object","required":["template_id","webhook_url","sheets"],"title":"RunGridRequestV2"},"RunGridResponseV2":{"properties":{"grid_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Grid Url"}},"type":"object","required":["grid_url"],"title":"RunGridResponseV2"},"SelectedTool":{"properties":{"name":{"$ref":"#/components/schemas/ToolOption"},"config":{"anyOf":[{"$ref":"#/components/schemas/WebSearchConfig"},{"$ref":"#/components/schemas/MCPToolConfig"},{"type":"null"}],"title":"Config"}},"type":"object","required":["name","config"],"title":"SelectedTool"},"SheetRequestV2":{"properties":{"sheet_index":{"type":"integer","title":"Sheet Index","description":"Index of the sheet for which the inputs are being specified. Must be provided if grid has more than one sheet","default":0},"meeting_ical_uid":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Meeting Ical Uid","description":"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"},"meeting_asset_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Meeting Asset Ids","description":"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","default":[]},"global_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Global Instructions","description":"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":{"anyOf":[{"items":{"additionalProperties":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/TranscriptInputV2"}]},"type":"object"},"type":"array"},{"type":"null"}],"title":"Inputs","description":"Create grid rows by providing inputs","default":[],"examples":[[{"0":"input column 0","1":"input column 1"}]]}},"type":"object","title":"SheetRequestV2"},"ShortTextOptions":{"properties":{"datatype":{"type":"string","const":"short-text","title":"Datatype","default":"short-text"},"format":{"type":"string","title":"Format","description":"Instruction the LLM must follow when generating the short text. Don't say 'be concise' or similar, that's already implied.","default":""}},"type":"object","title":"ShortTextOptions","description":"Datatype used when the LLM must return a short text."},"SingleSelectOptions":{"properties":{"datatype":{"type":"string","const":"single_select","title":"Datatype","default":"single_select"},"enum_format":{"$ref":"#/components/schemas/EnumFormat","description":"The allowed values for the single-select field."}},"type":"object","required":["enum_format"],"title":"SingleSelectOptions","description":"Datatype used when the LLM must select one option from a list of options.\nUse this tool when the response options are bounded and mutually exclusive.\nTypycal examples: Yes/No, True/False, etc."},"TextCellV2":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"column_id":{"type":"string","format":"uuid","title":"Column Id"},"row_id":{"type":"string","format":"uuid","title":"Row Id"},"column_index":{"type":"integer","title":"Column Index"},"row_index":{"type":"integer","title":"Row Index"},"content":{"type":"string","title":"Content"}},"type":"object","required":["id","column_id","row_id","column_index","row_index","content"],"title":"TextCellV2"},"TextGridColumnV2":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"index":{"type":"integer","title":"Index"},"is_pinned":{"type":"boolean","title":"Is Pinned"},"auto_reference":{"type":"boolean","title":"Auto Reference"},"datatype":{"oneOf":[{"$ref":"#/components/schemas/LongTextOptions"},{"$ref":"#/components/schemas/ShortTextOptions"},{"$ref":"#/components/schemas/DateOptions"},{"$ref":"#/components/schemas/NumberOptions"},{"$ref":"#/components/schemas/PercentageOptions"},{"$ref":"#/components/schemas/CurrencyOptions"},{"$ref":"#/components/schemas/SingleSelectOptions"},{"$ref":"#/components/schemas/MultiSelectOptions"},{"$ref":"#/components/schemas/UrlOptions"},{"$ref":"#/components/schemas/ImageOptions"},{"$ref":"#/components/schemas/AssetOptions"},{"$ref":"#/components/schemas/CustomStructuredOptions"}],"title":"Datatype","discriminator":{"propertyName":"datatype","mapping":{"asset":"#/components/schemas/AssetOptions","currency":"#/components/schemas/CurrencyOptions","custom_structured":"#/components/schemas/CustomStructuredOptions","date":"#/components/schemas/DateOptions","image":"#/components/schemas/ImageOptions","long-text":"#/components/schemas/LongTextOptions","multi_select":"#/components/schemas/MultiSelectOptions","number":"#/components/schemas/NumberOptions","percentage":"#/components/schemas/PercentageOptions","short-text":"#/components/schemas/ShortTextOptions","single_select":"#/components/schemas/SingleSelectOptions","url":"#/components/schemas/UrlOptions"}}},"name":{"type":"string","title":"Name"},"type":{"type":"string","const":"MANUAL","title":"Type"}},"type":"object","required":["id","index","is_pinned","auto_reference","name","type"],"title":"TextGridColumnV2"},"ToolOption":{"type":"string","enum":["files_and_calls","emails","web_search","news","crunchbase","factset","contact_details","linkedin","cap_iq","logos","filings","url_scraper","custom_dataset","hubspot","headshots","dealcloud","egnyte","pitchbook","autoselect","evr_funds","calendar","translate_document","mcp_connections","indices","image_gen","task_manager"],"title":"ToolOption"},"ToolSelection":{"additionalProperties":true,"type":"object"},"TranscriptInputV2":{"properties":{"ical_uids":{"items":{"type":"string"},"type":"array","title":"Ical Uids","default":[]},"asset_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Asset Ids","default":[]}},"type":"object","title":"TranscriptInputV2"},"UrlOptions":{"properties":{"datatype":{"type":"string","const":"url","title":"Datatype","default":"url"}},"type":"object","title":"UrlOptions","description":"Datatype used when the LLM must return a URL."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebSearchConfig":{"properties":{"use_default_domains":{"type":"boolean","title":"Use Default Domains","description":"If true, the web search tool will use the default domains set by the user.If false, the user must provide a list of allowed domains if they wish to restrict the search.","default":true},"allowed_domains":{"items":{"type":"string"},"type":"array","title":"Allowed Domains","description":"The list of domains that the web search tool is allowed to search. This is useful for restricting the search to specific domains.*Maximum: 10 domains between allowed and exluded.*"},"include_or_exclude":{"$ref":"#/components/schemas/IncludeOrExclude","description":"Whether the domains in the allowed_domains list are included or excluded from the search.","default":"include"}},"type":"object","required":["allowed_domains"],"title":"WebSearchConfig"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"}}}}