Skip to main content

Create View

POST

https://app.smartsuite.com/api/v1/reports/

Creates a new View.

Example Request (Simple Grid View)

curl -X POST https://app.smartsuite.com/api/v1/reports/ \
-H "Authorization: Token YOUR_API_KEY" \
-H "ACCOUNT-ID: WORKSPACE_ID" \
-H "Content-Type: application/json" \
--data '{
"application": "[app_id]",
"autosave": false,
"description": "",
"is_dirty": false,
"is_locked": false,
"is_password_protected": false,
"is_private": false,
"map_state": {},
"sharing_allow_all_fields": false,
"sharing_allow_copy": false,
"sharing_allow_export": false,
"sharing_allow_open_record": false,
"sharing_enabled": false,
"sharing_hash": "",
"sharing_password": "",
"sharing_show_toolbar": false,
"solution": "641b70cb0d94c969a49983aa",
"state": {
"filterWindow": {
"opened": false,
"filter": {
"operator": "and",
"fields": []
}
},
"fieldsWindow": {
"visibleFields": [ "title" ],
"fixedFieldsCount": 1,
"columnsWidth": {},
"collapsed": []
}
},
"label": "TEST",
"view_mode": "grid",
"order": 2
}'

Request Body

ParamTypeOptionalDescription
applicationstringNoId of the App where you want to create the View
autosavebooleanNoAutosave state for the new View
descriptionstringYesOptional description for the View
is_dirtybooleanNo-Internal Use-
is_lockedbooleanNoView locked status
is_password_protectedbooleanNoView password protect status
is_privatebooleanNoView private status
map_statemap state objectYesMap View type configuration
sharing_allow_all_fieldsbooleanYesAllow all fields when sharing
sharing_allow_copybooleanYesAllow copy when sharing
sharing_allow_exportbooleanYesAllow export when sharing
sharing_allow_open_recordsbooleanYesAllow opening record details when sharing
sharing_enabledbooleanYesSharing state enabled or disabled
sharing_hashstringNoShared View hash value
sharing_passwordstringNoShared View password value
sharing_show_toolbarbooleanNoShared View toolbar toggle
solutionstringNoId of the App Solution containing the View
stateview state objectYesView state configuration
labelstringNoDisplay name of the View
view_modestringNoView mode
ordernumberNoDisplay order of the View in the View list

state object

state object properties

PropertyData TypeDescription
filterWindowObjectThe filter window settings.
filterWindow.openedBooleanIndicates if the filter window is opened or closed.
filterWindow.filterObjectThe filter settings within the filter window.
filterWindow.filter.operatorStringThe operator used for filtering.
filterWindow.filter.fieldsArrayThe array of fields used for filtering.
fieldsWindowObjectThe fields window settings.
fieldsWindow.visibleFieldsArrayThe array of fields that are visible in the fields window.
fieldsWindow.fixedFieldsCountNumberThe number of fixed fields in the fields window.
fieldsWindow.columnsWidthObjectThe object containing the widths of columns in the fields window.
fieldsWindow.collapsedArrayThe array of collapsed fields in the fields window.
aggregatesObjectAggregate settings settings.
coverWindownullIndicates that the cover window is null (not applicable).
sortWindowObjectThe sort window settings.
sortWindow.sortArrayThe array of sort settings.
groupbyWindowObjectThe group by window settings.
groupbyWindow.collapsedObjectThe object containing collapsed settings for group by fields.
groupbyWindow.groupArrayThe array of group by fields.
spotlightWindowObjectThe spotlight window settings.
spotlightWindow.spotlightsArrayThe array of spotlights.
cardSizeWindowObjectThe card size window settings.
cardSizeWindow.sizeStringThe size of the card.
rowSizeWindowObjectThe row size window settings.
rowSizeWindow.sizeStringThe size of the row.
rowSizeWindow.previousSizenullThe previous size of the row (not applicable).
stackByWindowObjectThe stack by window settings.
stackByWindow.columnFieldSlugnullThe slug of the column field in the stack by window (not applicable).
stackByWindow.swimlaneFieldSlugnullThe slug of the swimlane field in the stack by window (not applicable).
stackByWindow.collapsedColumnsArrayThe array of collapsed columns in the stack by window.
stackByWindow.collapsedSwimlanesArrayThe array of collapsed swimlanes in the stack by window.
stackByWindow.columnsValuesArrayThe array of column values in the stack by window.
locationByWindowObjectThe location by window settings.
locationByWindow.selectedFieldSlugnullThe selected field slug in the location by window (not applicable).
calendarFieldsWindowObjectThe calendar fields window settings.
calendarFieldsWindow.fieldsArray
calendarFieldsWindow.showRecordsListBooleanIndicates whether the records list is shown in the calendar fields window.
calendarFieldsWindow.viewTypeStringThe type of view displayed in the calendar fields window.
calendarFieldsWindow.externalReportsInfoArrayThe array of external reports information in the calendar fields window.
calendarFieldsWindow.displayWeekendsBooleanIndicates whether weekends are displayed in the calendar fields window.
timelineFieldsWindowObjectThe timeline fields window settings.
timelineFieldsWindow.fieldsArrayThe array of fields in the timeline fields window.
timelineFieldsWindow.viewModeStringThe mode of the timeline view in the timeline fields window.
timelineFieldsWindow.showRecordsListBooleanIndicates whether the records list is shown in the timeline fields window.
timelineFieldsWindow.periodsArrayThe array of periods in the timeline fields window.
chartSettingsObjectThe chart settings.
chartSettings.sidebarActiveBooleanIndicates whether the sidebar is active in the chart settings.
chartSettings.selectedFieldsArrayThe array of selected fields in the chart settings.
chartSettings.selectedChartStringThe selected chart type in the chart settings.
chartSettings.checkedLegendsArrayThe array of checked legends in the chart settings.
chartSettings.sortedLegendsArrayThe array of sorted legends in the chart settings.
chartSettings.customSortAppliedBooleanIndicates whether a custom sort is applied in the chart settings.
chartSettings.groupByFieldObjectThe group by field settings in the chart settings.
chartSettings.groupByField.slugnullThe slug of the group by field (not applicable).
chartSettings.groupByField.nestedOptionnullThe nested option of the group by field (not applicable).
chartSettings.groupByField.additionalOptionnullThe additional option of the group by field (not applicable).
chartSettings.dynamicFilterFieldObjectThe dynamic filter field settings in the chart settings.
chartSettings.dynamicFilterField.slugnullThe slug of the dynamic filter field (not applicable).
chartSettings.dynamicFilterField.nestedOptionnullThe nested option of the dynamic filter field (not applicable).
chartSettings.dynamicFilterField.fieldOptionsArrayThe array of field options in the dynamic filter field.
chartSettings.dynamicFilterField.selectedOptionnullThe selected option of the dynamic filter field (not applicable).
chartSettings.dynamicFilterSectionExpandedBooleanIndicates whether the dynamic filter section is expanded in the chart settings.
chartSettings.advancedChartOptionsObjectThe advanced chart options in the chart settings.
chartSettings.advancedChartOptions.showDataLabelsBooleanIndicates whether data labels are shown on the chart.
chartSettings.advancedChartOptions.showValueAxisLabelBooleanIndicates whether the value axis label is shown on the chart.
chartSettings.advancedChartOptions.showCategoryAxisLabelBooleanIndicates whether the category axis label is shown on the chart.
chartSettings.advancedChartOptions.showXAxisLabelBooleanIndicates whether the X-axis label is shown on the chart.
chartSettings.advancedChartOptions.showYAxisLabelBooleanIndicates whether the Y-axis label is shown on the chart.
chartSettings.advancedChartOptions.showBubbleLegendBooleanIndicates whether the bubble legend is shown on the chart.
chartSettings.categoriesArrayThe array of categories in the chart settings.
chartSettings.drillInObjectThe drill-in settings in the chart settings.
chartSettings.drillIn.visibleFieldsnullThe visible fields in the drill-in settings (not applicable).
chartSettings.benchmarkLinesArrayThe array of benchmark lines in the chart settings.
chartSettings.benchmarkLinesSectionExpandedBooleanIndicates whether the benchmark lines section is expanded in the chart settings.
chartSettings.totalsArrayThe array of totals in the chart settings.
chartSettings.totalsSectionExpandedBooleanIndicates whether the totals section is expanded in the chart settings.
isToolbarVisibleBooleanIndicates whether the toolbar is visible.

state object example

Example
{
"filterWindow": {
"opened": false,
"filter": {
"operator": "and",
"fields": []
}
},
"fieldsWindow": {
"visibleFields": [ "title" ],
"fixedFieldsCount": 1,
"columnsWidth": {},
"collapsed": []
},
"aggregates": {},
"coverWindow": null,
"sortWindow": { "sort": [] },
"groupbyWindow": {
"collapsed": {},
"group": []
},
"spotlightWindow": { "spotlights": [] },
"cardSizeWindow": { "size": "s" },
"rowSizeWindow": {
"size": "compact",
"previousSize": null
},
"stackByWindow": {
"columnFieldSlug": null,
"swimlaneFieldSlug": null,
"collapsedColumns": [],
"collapsedSwimlanes": [],
"columnsValues": []
},
"locationByWindow": { "selectedFieldSlug": null },
"calendarFieldsWindow": {
"fields": [],
"showRecordsList": false,
"viewType": "dayGridMonth",
"externalReportsInfo": [],
"displayWeekends": true
},
"timelineFieldsWindow": {
"fields": [],
"viewMode": "day",
"showRecordsList": false,
"periods": []
},
"chartSettings": {
"sidebarActive": true,
"selectedFields": [],
"selectedChart": "bar",
"checkedLegends": [],
"sortedLegends": [],
"customSortApplied": false,
"groupByField": {
"slug": null,
"nestedOption": null,
"additionalOption": null
},
"dynamicFilterField": {
"slug": null,
"nestedOption": null,
"fieldOptions": [],
"selectedOption": null
},
"dynamicFilterSectionExpanded": false,
"advancedChartOptions": {
"showDataLabels": false,
"showValueAxisLabel": false,
"showCategoryAxisLabel": false,
"showXAxisLabel": false,
"showYAxisLabel": false,
"showBubbleLegend": false
},
"categories": [],
"drillIn": { "visibleFields": null },
"benchmarkLines": [],
"benchmarkLinesSectionExpanded": false,
"totals": [],
"totalsSectionExpanded": false
},
"isToolbarVisible": true
}

map_state object

map_state object properties

PropertyData TypeDescription
settingsObject
settings.mapTypeIdStringThe type of the map to be displayed.

Options:

  • roadmap
  • satellite
  • hybrid
  • silver
  • retro

settings.locationRadiusObjectThe radius around a location for search or display.
settings.locationRadius.enabledBooleanIndicates if the location radius is enabled or disabled.
settings.locationRadius.metersNumberThe radius distance in meters.
settings.locationRadius.measureUnitStringThe unit of measurement for the radius.
settings.locationMarkerObjectThe marker settings for a specific location.
settings.locationMarker.iconTypeStringThe type of icon for the location marker.
settings.locationMarker.iconSizeTypeStringThe size type of the location marker icon.
settings.locationMarker.iconColorStringThe color of the location marker icon.
settings.displayElementsObjectThe display elements settings for different map types.
settings.displayElements.roadmapObjectThe display elements settings for the roadmap map type.
settings.displayElements.roadmap.labelsNumberThe level of label visibility on the roadmap.
settings.displayElements.roadmap.terrainNumberThe level of terrain visibility on the roadmap.
settings.displayElements.roadmap.highwaysNumberThe level of highway visibility on the roadmap.
settings.displayElements.roadmap.roadsNumberThe level of road visibility on the roadmap.
settings.displayElements.roadmap.transitNumberThe level of transit visibility on the roadmap.
settings.displayElements.roadmap.poiNumberThe level of point of interest (POI) visibility on the roadmap.
settings.displayElements.roadmap.waterNumberThe level of water visibility on the roadmap.
settings.displayElements.satelliteObjectThe display elements settings for the satellite map type.
settings.displayElements.satellite.labelsNumberThe level of label visibility on the satellite view.
settings.displayElements.satellite.terrainNumberThe level of terrain visibility on the satellite view.
settings.displayElements.satellite.highwaysNumberThe level of highway visibility on the satellite view.
settings.displayElements.satellite.roadsNumberThe level of road visibility on the satellite view.
settings.displayElements.satellite.transitNumberThe level of transit visibility on the satellite view.
settings.displayElements.satellite.poiNumberThe level of point of interest (POI) visibility on the satellite view.
settings.displayElements.satellite.waterNumberThe level of water visibility on the satellite view.
settings.displayElements.hybridObjectThe display elements settings for the hybrid map type.
settings.displayElements.hybrid.labelsNumberThe level of label visibility on the hybrid map.
settings.displayElements.hybrid.terrainNumberThe level of terrain visibility on the hybrid map.
settings.displayElements.hybrid.highwaysNumberThe level of highway visibility on the hybrid map.
settings.displayElements.hybrid.roadsNumberThe level of road visibility on the hybrid map

map_state object example

Example Structure
{
"settings": {
"mapTypeId": "roadmap",
"locationRadius": {
"enabled": false,
"meters": 0,
"measureUnit": "miles"
},
"locationMarker": {
"iconType": "pin",
"iconSizeType": "m",
"iconColor": "#3A86FF"
},
"displayElements": {
"roadmap": {
"labels": 1,
"terrain": 1,
"highways": 2,
"roads": 2,
"transit": 0,
"poi": 1,
"water": 2
},
"satellite": {
"labels": 1,
"terrain": 1,
"highways": 2,
"roads": 0,
"transit": 0,
"poi": 0,
"water": 2
},
"hybrid": {
"labels": 1,
"terrain": 1,
"highways": 2,
"roads": 2,
"transit": 0,
"poi": 0,
"water": 2
},
"silver": {
"labels": 2,
"terrain": 1,
"highways": 2,
"roads": 2,
"transit": 1,
"poi": 1,
"water": 2
},
"retro": {
"labels": 2,
"terrain": 1,
"highways": 2,
"roads": 2,
"transit": 1,
"poi": 1,
"water": 2
}
}
},
"sidebarActive": false
}