Skip to content

Requests and responses

Sorting

Order a list by one field, ascending or descending.

The sort parameter

Endpoints that can be sorted take one sort key. Use the field name for ascending order and put a minus sign in front of it for descending order.

http
GET /api/profiles?sort=created
GET /api/profiles?sort=-created

Without a sort, each endpoint uses its default order, shown on its reference page. A key the endpoint does not sort by returns 400 invalid listing the keys it accepts. Endpoints that cannot be sorted refuse the parameter the same way.

Sortable endpoints

EndpointSort keysDefault
GET /api/campaign-messagescreatedidnamestatusupdated-created
GET /api/campaignscreated_atidnameupdated_at-created_at
GET /api/catalog-categoriescreatedcreated
GET /api/catalog-category-bulk-create-jobscreated-created
GET /api/catalog-category-bulk-delete-jobscreated-created
GET /api/catalog-category-bulk-update-jobscreated-created
GET /api/catalog-item-bulk-create-jobscreated-created
GET /api/catalog-item-bulk-delete-jobscreated-created
GET /api/catalog-item-bulk-update-jobscreated-created
GET /api/catalog-itemscreatedcreated
GET /api/catalog-variant-bulk-create-jobscreated-created
GET /api/catalog-variant-bulk-delete-jobscreated-created
GET /api/catalog-variant-bulk-update-jobscreated-created
GET /api/catalog-variantscreatedcreated
GET /api/catalog-categories/{id}/itemscreatedcreated
GET /api/catalog-items/{id}/categoriescreatedcreated
GET /api/catalog-items/{id}/variantscreatedcreated
GET /api/catalog-categories/{id}/relationships/itemscreatedcreated
GET /api/catalog-items/{id}/relationships/categoriescreatedcreated
GET /api/catalog-items/{id}/relationships/variantscreatedcreated
GET /client/reviewscreatedratingupdated-created
GET /api/coupon-code-bulk-create-jobscreated-created
GET /api/coupon-codescreatedcreated
GET /api/couponsidid
GET /api/coupons/{id}/coupon-codescreatedcreated
GET /api/coupons/{id}/relationships/coupon-codescreatedcreated
GET /api/data-sourcesidid
GET /api/object-types/{id}/object-ingestion-logsat-at
GET /api/object-types/{id}/object-recordsrecord_keyrecord_key
GET /api/object-types/{id}/relationships/object-ingestion-logsat-at
GET /api/object-types/{id}/relationships/object-recordsrecord_keyrecord_key
GET /api/eventsdatetimetimestamp-datetime
GET /api/flowscreatedidnamestatustrigger_typeupdatedid
GET /api/flow-actions/{id}/flow-messagescreatedidnameupdatedid
GET /api/flows/{id}/flow-actionsaction_typecreatedidstatusupdatedid
GET /api/flow-actions/{id}/relationships/flow-messagescreatedidnameupdatedid
GET /api/flows/{id}/relationships/flow-actionsaction_typecreatedidstatusupdatedid
GET /api/formscreated_atupdated_at-created_at
GET /api/forms/{id}/form-versionscreated_atupdated_atcreated_at
GET /api/forms/{id}/relationships/form-versionscreated_atupdated_atcreated_at
GET /api/imagesformatidnamesizeupdated_atid
GET /api/listscreatedidnameupdatedid
GET /api/lists/{id}/profilesjoined_group_atjoined_group_at
GET /api/lists/{id}/relationships/profilesjoined_group_atjoined_group_at
GET /api/metricsidid
GET /api/profile-bulk-import-jobscreated_at-created_at
GET /api/profile-suppression-bulk-create-jobscreated-created
GET /api/profile-suppression-bulk-delete-jobscreated-created
GET /api/profilescreatedupdatedemailidsubscriptions.email.marketing.suppression.timestampsubscriptions.email.marketing.list_suppressions.timestampid
GET /api/push-tokensidid
GET /api/profile-bulk-import-jobs/{id}/import-errorsidxidx
GET /api/profile-bulk-import-jobs/{id}/profilesidid
GET /api/profile-bulk-import-jobs/{id}/relationships/profilesidid
GET /api/reviewscreatedratingupdated-created
GET /api/segmentscreatedidnameupdatedid
GET /api/segments/{id}/profilesjoined_group_atjoined_group_at
GET /api/segments/{id}/relationships/profilesjoined_group_atjoined_group_at
GET /api/tag-groupsidnameid
GET /api/tagsidnameid
GET /api/template-universal-contentcreatedidnameupdatedid
GET /api/templatescreatedidnameupdatedid
GET /api/text-messaging-senderscreated_atcreated_at
GET /api/translationsidid
GET /api/web-feedscreatednameupdatedcreated