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
Param | Type | Optional | Description |
---|---|---|---|
application | string | No | Id of the App where you want to create the View |
autosave | boolean | No | Autosave state for the new View |
description | string | Yes | Optional description for the View |
is_dirty | boolean | No | -Internal Use- |
is_locked | boolean | No | View locked status |
is_password_protected | boolean | No | View password protect status |
is_private | boolean | No | View private status |
map_state | map state object | Yes | Map View type configuration |
sharing_allow_all_fields | boolean | Yes | Allow all fields when sharing |
sharing_allow_copy | boolean | Yes | Allow copy when sharing |
sharing_allow_export | boolean | Yes | Allow export when sharing |
sharing_allow_open_records | boolean | Yes | Allow opening record details when sharing |
sharing_enabled | boolean | Yes | Sharing state enabled or disabled |
sharing_hash | string | No | Shared View hash value |
sharing_password | string | No | Shared View password value |
sharing_show_toolbar | boolean | No | Shared View toolbar toggle |
solution | string | No | Id of the App Solution containing the View |
state | view state object | Yes | View state configuration |
label | string | No | Display name of the View |
view_mode | string | No | View mode |
order | number | No | Display order of the View in the View list |
state object
state object properties
Property | Data Type | Description |
---|---|---|
filterWindow | Object | The filter window settings. |
filterWindow.opened | Boolean | Indicates if the filter window is opened or closed. |
filterWindow.filter | Object | The filter settings within the filter window. |
filterWindow.filter.operator | String | The operator used for filtering. |
filterWindow.filter.fields | Array | The array of fields used for filtering. |
fieldsWindow | Object | The fields window settings. |
fieldsWindow.visibleFields | Array | The array of fields that are visible in the fields window. |
fieldsWindow.fixedFieldsCount | Number | The number of fixed fields in the fields window. |
fieldsWindow.columnsWidth | Object | The object containing the widths of columns in the fields window. |
fieldsWindow.collapsed | Array | The array of collapsed fields in the fields window. |
aggregates | Object | Aggregate settings settings. |
coverWindow | null | Indicates that the cover window is null (not applicable). |
sortWindow | Object | The sort window settings. |
sortWindow.sort | Array | The array of sort settings. |
groupbyWindow | Object | The group by window settings. |
groupbyWindow.collapsed | Object | The object containing collapsed settings for group by fields. |
groupbyWindow.group | Array | The array of group by fields. |
spotlightWindow | Object | The spotlight window settings. |
spotlightWindow.spotlights | Array | The array of spotlights. |
cardSizeWindow | Object | The card size window settings. |
cardSizeWindow.size | String | The size of the card. |
rowSizeWindow | Object | The row size window settings. |
rowSizeWindow.size | String | The size of the row. |
rowSizeWindow.previousSize | null | The previous size of the row (not applicable). |
stackByWindow | Object | The stack by window settings. |
stackByWindow.columnFieldSlug | null | The slug of the column field in the stack by window (not applicable). |
stackByWindow.swimlaneFieldSlug | null | The slug of the swimlane field in the stack by window (not applicable). |
stackByWindow.collapsedColumns | Array | The array of collapsed columns in the stack by window. |
stackByWindow.collapsedSwimlanes | Array | The array of collapsed swimlanes in the stack by window. |
stackByWindow.columnsValues | Array | The array of column values in the stack by window. |
locationByWindow | Object | The location by window settings. |
locationByWindow.selectedFieldSlug | null | The selected field slug in the location by window (not applicable). |
calendarFieldsWindow | Object | The calendar fields window settings. |
calendarFieldsWindow.fields | Array | |
calendarFieldsWindow.showRecordsList | Boolean | Indicates whether the records list is shown in the calendar fields window. |
calendarFieldsWindow.viewType | String | The type of view displayed in the calendar fields window. |
calendarFieldsWindow.externalReportsInfo | Array | The array of external reports information in the calendar fields window. |
calendarFieldsWindow.displayWeekends | Boolean | Indicates whether weekends are displayed in the calendar fields window. |
timelineFieldsWindow | Object | The timeline fields window settings. |
timelineFieldsWindow.fields | Array | The array of fields in the timeline fields window. |
timelineFieldsWindow.viewMode | String | The mode of the timeline view in the timeline fields window. |
timelineFieldsWindow.showRecordsList | Boolean | Indicates whether the records list is shown in the timeline fields window. |
timelineFieldsWindow.periods | Array | The array of periods in the timeline fields window. |
chartSettings | Object | The chart settings. |
chartSettings.sidebarActive | Boolean | Indicates whether the sidebar is active in the chart settings. |
chartSettings.selectedFields | Array | The array of selected fields in the chart settings. |
chartSettings.selectedChart | String | The selected chart type in the chart settings. |
chartSettings.checkedLegends | Array | The array of checked legends in the chart settings. |
chartSettings.sortedLegends | Array | The array of sorted legends in the chart settings. |
chartSettings.customSortApplied | Boolean | Indicates whether a custom sort is applied in the chart settings. |
chartSettings.groupByField | Object | The group by field settings in the chart settings. |
chartSettings.groupByField.slug | null | The slug of the group by field (not applicable). |
chartSettings.groupByField.nestedOption | null | The nested option of the group by field (not applicable). |
chartSettings.groupByField.additionalOption | null | The additional option of the group by field (not applicable). |
chartSettings.dynamicFilterField | Object | The dynamic filter field settings in the chart settings. |
chartSettings.dynamicFilterField.slug | null | The slug of the dynamic filter field (not applicable). |
chartSettings.dynamicFilterField.nestedOption | null | The nested option of the dynamic filter field (not applicable). |
chartSettings.dynamicFilterField.fieldOptions | Array | The array of field options in the dynamic filter field. |
chartSettings.dynamicFilterField.selectedOption | null | The selected option of the dynamic filter field (not applicable). |
chartSettings.dynamicFilterSectionExpanded | Boolean | Indicates whether the dynamic filter section is expanded in the chart settings. |
chartSettings.advancedChartOptions | Object | The advanced chart options in the chart settings. |
chartSettings.advancedChartOptions.showDataLabels | Boolean | Indicates whether data labels are shown on the chart. |
chartSettings.advancedChartOptions.showValueAxisLabel | Boolean | Indicates whether the value axis label is shown on the chart. |
chartSettings.advancedChartOptions.showCategoryAxisLabel | Boolean | Indicates whether the category axis label is shown on the chart. |
chartSettings.advancedChartOptions.showXAxisLabel | Boolean | Indicates whether the X-axis label is shown on the chart. |
chartSettings.advancedChartOptions.showYAxisLabel | Boolean | Indicates whether the Y-axis label is shown on the chart. |
chartSettings.advancedChartOptions.showBubbleLegend | Boolean | Indicates whether the bubble legend is shown on the chart. |
chartSettings.categories | Array | The array of categories in the chart settings. |
chartSettings.drillIn | Object | The drill-in settings in the chart settings. |
chartSettings.drillIn.visibleFields | null | The visible fields in the drill-in settings (not applicable). |
chartSettings.benchmarkLines | Array | The array of benchmark lines in the chart settings. |
chartSettings.benchmarkLinesSectionExpanded | Boolean | Indicates whether the benchmark lines section is expanded in the chart settings. |
chartSettings.totals | Array | The array of totals in the chart settings. |
chartSettings.totalsSectionExpanded | Boolean | Indicates whether the totals section is expanded in the chart settings. |
isToolbarVisible | Boolean | Indicates 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
Property | Data Type | Description |
---|---|---|
settings | Object | |
settings.mapTypeId | String | The type of the map to be displayed. Options:
|
settings.locationRadius | Object | The radius around a location for search or display. |
settings.locationRadius.enabled | Boolean | Indicates if the location radius is enabled or disabled. |
settings.locationRadius.meters | Number | The radius distance in meters. |
settings.locationRadius.measureUnit | String | The unit of measurement for the radius. |
settings.locationMarker | Object | The marker settings for a specific location. |
settings.locationMarker.iconType | String | The type of icon for the location marker. |
settings.locationMarker.iconSizeType | String | The size type of the location marker icon. |
settings.locationMarker.iconColor | String | The color of the location marker icon. |
settings.displayElements | Object | The display elements settings for different map types. |
settings.displayElements.roadmap | Object | The display elements settings for the roadmap map type. |
settings.displayElements.roadmap.labels | Number | The level of label visibility on the roadmap. |
settings.displayElements.roadmap.terrain | Number | The level of terrain visibility on the roadmap. |
settings.displayElements.roadmap.highways | Number | The level of highway visibility on the roadmap. |
settings.displayElements.roadmap.roads | Number | The level of road visibility on the roadmap. |
settings.displayElements.roadmap.transit | Number | The level of transit visibility on the roadmap. |
settings.displayElements.roadmap.poi | Number | The level of point of interest (POI) visibility on the roadmap. |
settings.displayElements.roadmap.water | Number | The level of water visibility on the roadmap. |
settings.displayElements.satellite | Object | The display elements settings for the satellite map type. |
settings.displayElements.satellite.labels | Number | The level of label visibility on the satellite view. |
settings.displayElements.satellite.terrain | Number | The level of terrain visibility on the satellite view. |
settings.displayElements.satellite.highways | Number | The level of highway visibility on the satellite view. |
settings.displayElements.satellite.roads | Number | The level of road visibility on the satellite view. |
settings.displayElements.satellite.transit | Number | The level of transit visibility on the satellite view. |
settings.displayElements.satellite.poi | Number | The level of point of interest (POI) visibility on the satellite view. |
settings.displayElements.satellite.water | Number | The level of water visibility on the satellite view. |
settings.displayElements.hybrid | Object | The display elements settings for the hybrid map type. |
settings.displayElements.hybrid.labels | Number | The level of label visibility on the hybrid map. |
settings.displayElements.hybrid.terrain | Number | The level of terrain visibility on the hybrid map. |
settings.displayElements.hybrid.highways | Number | The level of highway visibility on the hybrid map. |
settings.displayElements.hybrid.roads | Number | The 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
}