# Sort rows in sheet Sorts the rows of a sheet, either in ascending or descending order. Endpoint: POST /sheets/{sheetId}/sort Version: 2.0.0 Security: APIToken, OAuth2 ## Path parameters: - `sheetId` (number, required) ID of the sheet being accessed. ## Header parameters: - `Authorization` (string) API Access Token used to authenticate requests to Smartsheet APIs. - `smartsheet-integration-source` (string) Uses the following metadata to distinguish between human-initiated API requests and third-party service-initiated calls by AI Connectors or ITSM: - Integration source type - Organization name - Integration source name Format: TYPE,OrgName,SourceName Examples: AI,SampleOrg,My-AI-Connector-v2 SCRIPT,SampleOrg2,Accounting-updater-script APPLICATION,SampleOrg3,SheetUpdater Example: "AI,SampleOrg,My-AI-Connector-v2" - `Content-Type` (string) Required for POST and PUT requests. Defines the structure for the request body. ## Query parameters: - `include&exclude` (string) (Optional) Any of the relevant parameters or query parameters listed for Get Sheet. ## Request fields (application/json): - `sortCriteria` (array) Specifies sort order. Array is in priority order. - `sortCriteria.columnId` (number) - `sortCriteria.direction` (string) Direction of the sort. Enum: "ASCENDING", "DESCENDING" ## Response 200 fields (application/json): - `id` (number) Sheet ID. - `fromId` (number) The ID of the template from which to create the sheet. This attribute can be specified in a request, but is never present in a response. - `ownerId` (number) User ID of the sheet owner. - `accessLevel` (string) Enum: "ADMIN", "COMMENTER", "EDITOR", "EDITOR_SHARE", "OWNER", "VIEWER" - `attachments` (array) Array of Attachment objects. Only returned if the [include](/api/smartsheet/openapi/sheets/getsheet) query string parameter contains attachments. - `attachments.id` (number) Attachment ID. - `attachments.parentId` (number) The ID of the parent. - `attachments.attachmentType` (string) Attachment type. Note--Dropbox, Egnyte, and Evernote are not supported for Smartsheet.gov accounts. Enum: "BOX_COM", "DROPBOX", "EGNYTE", "EVERNOTE", "FILE", "GOOGLE_DRIVE", "LINK", "ONEDRIVE", "TRELLO" - `attachments.attachmentSubType` (string) Attachment sub type. Note--Folder type is for EGNYTE values and the rest are GOOGLE_DRIVE values. Enum: "DOCUMENT", "DRAWING", "FOLDER", "PDF", "PRESENTATION", "SPREADSHEET" - `attachments.mimeType` (string) Attachment MIME type. Example: "PNG" - `attachments.parentType` (string) The type of object the attachment belongs to. Enum: "COMMENT", "PROOF", "ROW", "SHEET" - `attachments.createdAt` (any) - `attachments.createdBy` (object) User object containing name and email of the user who created this attachment. - `attachments.createdBy.email` (string) Example: "jane.doe@smartsheet.com" - `attachments.createdBy.name` (string) Example: "Jane Doe" - `attachments.name` (string) Attachment name. - `attachments.sizeInKb` (number) The size of the file, if the attachmentType is FILE. - `attachments.url` (string) Attachment temporary URL (files only). - `attachments.urlExpiresInMillis` (number) Attachment temporary URL time to live (files only). - `cellImageUploadEnabled` (boolean) The sheet is enabled for cell images to be uploaded. - `columns` (array) - `columns.autoNumberFormat` (object) Object that describes how the the System Column type of "AUTO_NUMBER" is auto-generated. - `columns.autoNumberFormat.fill` (string) Indicates zero-padding. Must be between 0 and 10 "0" (zero) characters. - `columns.autoNumberFormat.prefix` (string) The prefix. Can include the date tokens: * {DD} * {MM} * {YY} * {YYYY} - `columns.autoNumberFormat.startingNumber` (number) The starting number for the auto-id. - `columns.autoNumberFormat.suffix` (string) The suffix. Can include the date tokens: * {DD} * {MM} * {YY} * {YYYY} - `columns.contactOptions` (array) Array of ContactOption objects to specify a pre-defined list of values for the column. Column type must be CONTACT_LIST. - `columns.contactOptions.email` (string) A parsable email address. - `columns.contactOptions.name` (string) Can be a user's name, display name, or free text. - `columns.description` (string) Column description. - `columns.format` (string) The format descriptor (see [Cell formatting](/api/smartsheet/guides/advanced-topics/cell-formatting)). Only returned if the include query string parameter contains format and this column has a non-default format applied to it. - `columns.formula` (string) The formula for the column, if set. - `columns.hidden` (boolean) Indicates whether the column is hidden. - `columns.id` (number) Column ID. - `columns.index` (number) Column index or position. This number is zero-based. - `columns.locked` (boolean) Indicates whether the column is locked. In a response, a value of true indicates that the column has been locked by the sheet owner or the admin. - `columns.lockedForUser` (boolean) Indicates whether the column is locked for the requesting user. This attribute may be present in a response, but cannot be specified in a request. - `columns.options` (array) Array of the options available for the column. - `columns.primary` (boolean) Returned only if the column is the Primary Column (value = true). - `columns.symbol` (string) When applicable for CHECKBOX or PICKLIST column types. See [Symbol Columns](/api/smartsheet/openapi/columns). - `columns.systemColumnType` (string) See [System Columns](/api/smartsheet/openapi/columns). Enum: "AUTO_NUMBER", "CREATED_BY", "CREATED_DATE", "MODIFIED_BY", "MODIFIED_DATE" - `columns.tags` (array) Set of tags to indicate special columns. Each element in the array is set to one of the listed enum values. Enum: "CALENDAR_END_DATE", "CALENDAR_START_DATE", "CARD_DONE", "GANTT_ALLOCATION", "GANTT_ASSIGNED_RESOURCE", "GANTT_DISPLAY_LABEL", "GANTT_DURATION", "GANTT_END_DATE", "GANTT_PERCENT_COMPLETE", "GANTT_PREDECESSOR", "GANTT_START_DATE", "BASELINE_START_DATE", "BASELINE_END_DATE", "BASELINE_VARIANCE" - `columns.title` (string) Column title. - `columns.type` (string) See [Column Types](/api/smartsheet/openapi/columns) Enum: "ABSTRACT_DATETIME", "CHECKBOX", "CONTACT_LIST", "DATE", "DATETIME", "DURATION", "MULTI_CONTACT_LIST", "MULTI_PICKLIST", "PICKLIST", "PREDECESSOR", "TEXT_NUMBER" - `columns.validation` (boolean) Indicates whether validation has been enabled for the column (value = true). - `columns.version` (number) * 0: CONTACT_LIST, PICKLIST, or TEXT_NUMBER. * 1: MULTI_CONTACT_LIST. * 2: MULTI_PICKLIST. Enum: 0, 1, 2 - `columns.width` (number) Display width of the column in pixels. - `crossSheetReferences` (array) Array of CrossSheetReference objects. Only returned if the [include](/api/smartsheet/openapi/sheets/getsheet) query string parameter contains crossSheetReferences. - `crossSheetReferences.endColumnId` (number) Defines ending edge of range when specifying one or more columns. To specify an entire column, omit the startRowId and endRowId parameters. - `crossSheetReferences.endRowId` (number) Defines ending edge of range when specifying one or more rows. To specify an entire row, omit the startColumnId and endColumnId parameters. - `crossSheetReferences.id` (number) Cross-sheet reference ID, guaranteed unique within referencing sheet. - `crossSheetReferences.name` (string) Friendly name of reference. Auto-generated unless specified in Create Cross-sheet References. - `crossSheetReferences.startColumnId` (number) Defines beginning edge of range when specifying one or more columns. To specify an entire column, omit the startRowId and endRowId parameters. - `crossSheetReferences.startRowId` (number) Defines beginning edge of range when specifying one or more rows. To specify an entire row, omit the startColumnId and endColumnId parameters. - `crossSheetReferences.status` (string) Status of request: * 'BLOCKED' - A reference is downstream of a circular issue. * 'BROKEN' - The data source location (column, row or sheet) was deleted. * 'CIRCULAR' - The formula reference is self referencing and cannot be resolved. * 'DISABLED' - Updating the reference is temporarily disabled due to maintenance. * 'INVALID/UNKNOWN' - The reference is new and had not been validated. * 'NOT_SHARED' - No common shared users. * 'OK' - The reference is in a good state. Enum: "BLOCKED", "BROKEN", "CIRCULAR", "DISABLED", "INVALID/UNKNOWN", "NOT-SHARED", "OK" - `crossSheetReferences.sourceSheetId` (number) Sheet ID of source sheet. - `dependenciesEnabled` (boolean) Indicates whether dependencies are enabled. - `discussions` (array) Array of Discussion objects Only returned if the [include](/api/smartsheet/openapi/sheets/getsheet) query string parameter contains discussions. - `discussions.id` (number) Discussion ID. - `discussions.comments` (array) Array of comments in discussion. Only returned if the include query string parameter contains comments. - `discussions.comments.attachments` (array) Array of attachments on comments. - `discussions.comments.createdBy` (object) User object containing name and email of the creator of this comment. - `discussions.comments.discussionId` (number) Discussion ID of discussion that contains comment. - `discussions.comments.id` (number) Comment ID. - `discussions.comments.modifiedAt` (any) - `discussions.comments.text` (string) Comment body. - `discussions.commentAttachments` (array) Array of attachments on discussion comments. Only returned if the include query string parameter contains attachments. - `discussions.commentCount` (number) Number of comments in the discussion. - `discussions.createdBy` (object) User object containing name and email of the user who created the discussion. - `discussions.lastCommentedAt` (any) - `discussions.lastCommentedUser` (object) User object containing name and email of the user who last commented on the discussion. - `discussions.parentId` (number) The ID of the associated row or sheet. - `discussions.parentType` (string) Type of parent object. Enum: "ROW", "SHEET" - `discussions.readOnly` (boolean) Indicates whether the user can modify the discussion. - `discussions.title` (string) Title automatically created by duplicating the first 100 characters of top-level comment. - `effectiveAttachmentOptions` (array) Array of enum strings (see [Attachment.attachmentType](/api/smartsheet/openapi/attachments) indicating the allowable attachment options for the current user and sheet. - `ganttEnabled` (boolean) Indicates whether "Gantt View" is enabled. - `hasSummaryFields` (boolean) Indicates whether a sheet summary is present. - `isMultiPicklistEnabled` (boolean) Indicates whether multi-select is enabled. - `name` (string) Sheet name. - `owner` (string) Email address of the sheet owner. - `permalink` (string) URL that represents a direct link to the sheet in Smartsheet. - `projectSettings` (object) Represents the project settings dependencies for a specific sheet. Project settings may be updated on sheets that the user has editor access. - `projectSettings.lengthOfDay` (number) Length of a workday for a project sheet. - `projectSettings.nonWorkingDays` (array) Non-working days for a project sheet. - `projectSettings.workingDays` (array) Enum: "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY" - `readOnly` (boolean) Returned only if the sheet belongs to an expired trial (value = true). - `resourceManagementEnabled` (boolean) Indicates that resource management is enabled. - `resourceManagementType` (string) Resource Management type. Indicates the type of RM that is enabled. Enum: "NONE", "LEGACY_RESOURCE_MANAGEMENT", "RESOURCE_MANAGEMENT_BY_SMARTSHEET" - `rows` (array) - `rows.id` (number) Row ID. - `rows.sheetId` (number) Parent sheet ID. - `rows.siblingId` (number) Sibling ID. - `rows.attachments` (array) Attachments on row. Only returned if the include query string parameter contains attachments. - `rows.cells` (array) Cells belonging to the row. - `rows.cells.columnId` (number) The ID of the column that the cell is located in. - `rows.cells.rowId` (number) The ID of the row the cell is located in. - `rows.cells.columnType` (string) Only returned if the include query string parameter contains columnType. - `rows.cells.conditionalFormat` (string) The format descriptor describing this cell's conditional format. Only returned if the include query string parameter contains format and this cell has a conditional format applied. - `rows.cells.displayValue` (string) Visual representation of cell contents, as presented to the user in the UI. - `rows.cells.format` (string) The format descriptor. Only returned if the include query string parameter contains format and this cell has a non-default format applied. - `rows.cells.formula` (string) The formula for a cell, if set, for instance =COUNTM([Assigned To]3). Note that calculation errors or problems with a formula do not cause the API call to return an error code. Instead, the response contains the same value as in the UI, such as cell.value = "#CIRCULAR REFERENCE". - `rows.cells.hyperlink` (object) - `rows.cells.hyperlink.reportId` (number) If non-null, this hyperlink is a link to the report with this ID. - `rows.cells.hyperlink.sheetId` (number) If non-null, this hyperlink is a link to the sheet with this ID. - `rows.cells.hyperlink.sightId` (number) If non-null, this hyperlink is a link to the dashboard with this ID. - `rows.cells.hyperlink.url` (string) When the hyperlink is a URL link, this property contains the URL value. When the hyperlink is a dashboard/report/sheet link (that is, dashboardId, reportId, or sheetId is non-null), this property contains the permalink to the dashboard, report, or sheet. - `rows.cells.image` (object) - `rows.cells.image.altText` (string) Alternate text for the image. - `rows.cells.image.height` (number) Original height (in pixels) of the uploaded image. - `rows.cells.image.id` (string) Image ID. - `rows.cells.image.width` (number) Original width (in pixels) of the uploaded image. - `rows.cells.linkInFromCell` (object) - `rows.cells.linkInFromCell.columnId` (number) Column ID of the linked cell. - `rows.cells.linkInFromCell.rowId` (number) Row ID of the linked cell. - `rows.cells.linkInFromCell.sheetId` (number) Sheet ID of the sheet that the linked cell belongs to. - `rows.cells.linkInFromCell.sheetName` (string) Sheet name of the linked cell. - `rows.cells.linkInFromCell.status` (string) * BLOCKED One of several other values indicating unusual error conditions. * BROKEN The row or sheet linked to was deleted. * CIRCULAR One of several other values indicating unusual error conditions. * DISABLED One of several other values indicating unusual error conditions. * INACCESSIBLE The sheet linked to cannot be viewed by this user. * INVALID One of several other values indicating unusual error conditions. * NOT_SHARED One of several other values indicating unusual error conditions. * OK The link is in a good state. Enum: "BLOCKED", "BROKEN", "CIRCULAR", "DISABLED", "INACCESSIBLE", "INVALID", "NOT_SHARED", "OK" - `rows.cells.linksOutToCells` (array) - `rows.cells.objectValue` (any) - `rows.cells.overrideValidation` (boolean) (Admin only) Indicates whether the cell value can contain a value outside of the validation limits (value = true). When using this parameter, you must also set strict to false to bypass value type checking. This property is honored for POST or PUT actions that update rows. - `rows.cells.strict` (boolean) Set to false to enable lenient parsing. Defaults to true. You can specify this attribute in a request, but it is never present in a response. - `rows.cells.value` (any) A string, number, or a Boolean value -- depending on the cell type and the data in the cell. Cell values larger than 4000 characters are silently truncated. An empty cell returns no value. - `rows.columns` (array) Columns of row. Only returned if the include query string parameter contains columns. - `rows.conditionalFormat` (string) Describes this row's conditional format. Only returned if the include query string parameter contains format and this row has a conditional format applied. Example: ",,1,1,,,,,,,,,,,,," - `rows.createdBy` (object) User object containing name and email of the creator of this row. - `rows.discussions` (array) Discussions on the row. Only returned if the include query string parameter contains discussions. - `rows.proof` (object) Object containing zero or more media items, including images, videos, and documents, for review, editing, or approval. - `rows.proof.id` (number) Proof ID of the proof version. - `rows.proof.originalId` (number) Proof ID of the original proof version. - `rows.proof.name` (string) Proof name. This is the same as primary column value. If the primary column value is empty, name is empty. - `rows.proof.type` (string) File type for the proof version. Enum: "DOCUMENT", "IMAGE", "MIXED", "NONE", "VIDEO" - `rows.proof.documentType` (string) If type=DOCUMENT, then this indicates the type of file, such as PDF. - `rows.proof.proofRequestUrl` (string) URL to review a proofing request. - `rows.proof.version` (number) The version number of the proof. - `rows.proof.lastUpdatedAt` (any) - `rows.proof.lastUpdatedBy` (object) User object containing name and email of the user who last updated the proof. - `rows.proof.isCompleted` (boolean) Indicates whether the proof is completed. - `rows.proof.attachments` (array) Array of Attachment objects. Only returned if the include query string parameter contains attachments. - `rows.proof.discussions` (array) Array of Discussion objects. Only returned if the include query string parameter contains discussions. - `rows.expanded` (boolean) Indicates whether the row is expanded or collapsed. - `rows.filteredOut` (boolean) Indicates if the row is filtered out by a column filter. Only returned if the include query string parameter contains filters. - `rows.format` (string) Format descriptor. Only returned if the include query string parameter contains format and this row has a non-default format applied. Example: ",,1,1,,,,,,,,,,,,," - `rows.inCriticalPath` (boolean) Only returned, with a value of true, if the sheet is a project sheet with dependencies enabled and this row is in the critical path. - `rows.locked` (boolean) Indicates whether the row is locked. - `rows.lockedForUser` (boolean) Indicates whether the row is locked for the requesting user. - `rows.modifiedBy` (object) User object containing name and email of the last person to modify this row. - `rows.permaLink` (string) URL that represents a direct link to the row in Smartsheet. Only returned if the include query string parameter contains rowPermalink. - `rows.rowNumber` (number) Row number within the sheet. - `rows.version` (number) Sheet version number that is incremented every time a sheet is modified. - `showParentRowsForFilters` (boolean) Returned only if there are column filters on the sheet. Value = true if "show parent rows" is enabled for the filters. - `source` (object) - `source.id` (number) The ID of the dashboard, report, sheet, or template from which the enclosing dashboard, report, sheet, or template was created. - `source.type` (string) report, sheet, sight (aka dashboard), or template. - `summary` (object) Represents the entire summary, or a list of defined fields and values, for a specific sheet. - `summary.fields` (array) Array of summary (or metadata) fields defined on the sheet. - `summary.fields.id` (number) SummaryField ID. - `summary.fields.createdBy` (object) User object containing name and email of the creator of this summary field. - `summary.fields.format` (string) The format descriptor. Only returned if the include query string parameter contains format and this column has a non-default format applied to it. - `summary.fields.formula` (string) The formula for a cell, if set. - `summary.fields.index` (number) Field index or position. This number is zero-based. - `summary.fields.locked` (boolean) Indicates whether the field is locked. - `summary.fields.lockedForUser` (boolean) Indicates whether the field is locked for the requesting user. - `summary.fields.modifiedBy` (object) User object containing name and email of the user who most recently modified this summary field. - `summary.fields.options` (array) When applicable for PICKLIST column type. Array of the options available for the field. - `summary.fields.symbol` (string) When applicable for PICKLIST column type. - `summary.fields.title` (string) Arbitrary name, must be unique within summary. - `summary.fields.type` (string) Enum: "ABSTRACT_DATETIME", "CHECKBOX", "CONTACT_LIST", "DATE", "DATETIME", "DURATION", "MULTI_CONTACT_LIST", "MULTI_PICKLIST", "PICKLIST", "PREDECESSOR", "TEXT_NUMBER" - `summary.fields.validation` (boolean) Indicates whether summary field values are restricted to the type. - `totalRowCount` (number) The total number of rows in the sheet. - `userPermissions` (object) Describes the current user's editing permissions for a specific sheet. - `userPermissions.summaryPermissions` (string) One of: * ADMIN: full control over fields. * READ_DELETE: sheet is owned by an individual account that doesn't have summary capabilities. If a summary exists, the only possible operations are GET and DELETE fields. * READ_ONLY. * READ_WRITE: can edit values of existing fields, but not create or delete fields, nor modify field type. Enum: "ADMIN", "READ_DELETE", "READ_ONLY", "READ_WRITE" - `userSettings` (object) Represents individual user settings for a specific sheet. User settings may be updated even on sheets where the current user only has read access (for example, viewer permissions or a read-only sheet). - `userSettings.criticalPathEnabled` (boolean) Does this user have "Show Critical Path" turned on for this sheet? NOTE: This setting only has an effect on project sheets with dependencies enabled. - `userSettings.displaySummaryTasks` (boolean) Does this user have "Display Summary Tasks" turned on for this sheet? Applies only to sheets where "Calendar View" has been configured. - `version` (number) A number that is incremented every time a sheet is modified. - `workspace` (object) - `workspace.id` (number) Workspace ID. - `workspace.name` (string) Workspace name. - `workspace.permalink` (string) URL that represents a direct link to the workspace in Smartsheet. - `favorite` (boolean) Deprecated Returned only if the user has marked this sheet as a favorite in their Home tab (value = true).