Hey, @josie_hill I just tested this with my test portal, and I’m getting the expected response. Do you want to share a simple request and response where you are not getting the expected result? Either here or in a new post, and you can tag me there? I’ll add mine here:
- I have 12 tickets in my portal going back to 2022
- Their last modified date is essentially the same as the created date for most, but it still works for this example
Request and body (I kept it very simple for this example)
POST https://api.hubapi.com/crm/v3/objects/tickets/search
{
"sorts": [
{
"propertyName": "hs_lastmodifieddate",
"direction": "DESCENDING"
}
]
}
Response
{
"total": 12,
"results": [
{
"id": "15816444829",
"properties": {
"content": null,
"createdate": "2024-10-28T22:29:00.321Z",
"hs_lastmodifieddate": "2024-10-28T22:29:00.967Z",
"hs_object_id": "15816444829",
"hs_pipeline": "0",
"hs_pipeline_stage": "1",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "testerr 6"
},
"createdAt": "2024-10-28T22:29:00.321Z",
"updatedAt": "2024-10-28T22:29:00.967Z",
"archived": false
},
{
"id": "15812399104",
"properties": {
"content": null,
"createdate": "2024-10-28T22:28:50.756Z",
"hs_lastmodifieddate": "2024-10-28T22:28:51.565Z",
"hs_object_id": "15812399104",
"hs_pipeline": "0",
"hs_pipeline_stage": "1",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "testerrr 5"
},
"createdAt": "2024-10-28T22:28:50.756Z",
"updatedAt": "2024-10-28T22:28:51.565Z",
"archived": false
},
{
"id": "15812399029",
"properties": {
"content": null,
"createdate": "2024-10-28T22:28:44.477Z",
"hs_lastmodifieddate": "2024-10-28T22:28:45.157Z",
"hs_object_id": "15812399029",
"hs_pipeline": "0",
"hs_pipeline_stage": "1",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "testerrr 4"
},
"createdAt": "2024-10-28T22:28:44.477Z",
"updatedAt": "2024-10-28T22:28:45.157Z",
"archived": false
},
{
"id": "1555709794",
"properties": {
"content": null,
"createdate": "2023-04-13T22:25:41.685Z",
"hs_lastmodifieddate": "2024-07-31T15:57:50.072Z",
"hs_object_id": "1555709794",
"hs_pipeline": "19625033",
"hs_pipeline_stage": "47925265",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "Testerr 3"
},
"createdAt": "2023-04-13T22:25:41.685Z",
"updatedAt": "2024-07-31T15:57:50.072Z",
"archived": false
},
{
"id": "1503346867",
"properties": {
"content": null,
"createdate": "2023-03-17T22:27:14.029Z",
"hs_lastmodifieddate": "2023-03-17T22:27:14.967Z",
"hs_object_id": "1503346867",
"hs_pipeline": "19625033",
"hs_pipeline_stage": "47925262",
"hs_ticket_category": null,
"hs_ticket_priority": "HIGH",
"subject": "Cats and ninjas"
},
"createdAt": "2023-03-17T22:27:14.029Z",
"updatedAt": "2023-03-17T22:27:14.967Z",
"archived": false
},
{
"id": "1500746070",
"properties": {
"content": null,
"createdate": "2023-03-16T15:49:04.683Z",
"hs_lastmodifieddate": "2023-03-16T15:49:06.041Z",
"hs_object_id": "1500746070",
"hs_pipeline": "19625033",
"hs_pipeline_stage": "47925262",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "Testerr 2"
},
"createdAt": "2023-03-16T15:49:04.683Z",
"updatedAt": "2023-03-16T15:49:06.041Z",
"archived": false
},
{
"id": "1500746054",
"properties": {
"content": null,
"createdate": "2023-03-16T15:48:45.014Z",
"hs_lastmodifieddate": "2023-03-16T15:48:46.290Z",
"hs_object_id": "1500746054",
"hs_pipeline": "19625033",
"hs_pipeline_stage": "47925262",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "Testerr 1"
},
"createdAt": "2023-03-16T15:48:45.014Z",
"updatedAt": "2023-03-16T15:48:46.290Z",
"archived": false
},
{
"id": "1478326183",
"properties": {
"content": null,
"createdate": "2023-03-03T21:15:46.531Z",
"hs_lastmodifieddate": "2023-03-03T21:15:51.870Z",
"hs_object_id": "1478326183",
"hs_pipeline": "0",
"hs_pipeline_stage": "1",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "Cat Circus—Big top issue"
},
"createdAt": "2023-03-03T21:15:46.531Z",
"updatedAt": "2023-03-03T21:15:51.870Z",
"archived": false
},
{
"id": "1317382811",
"properties": {
"content": null,
"createdate": "2022-12-13T20:34:07.713Z",
"hs_lastmodifieddate": "2022-12-13T20:34:09.268Z",
"hs_object_id": "1317382811",
"hs_pipeline": "0",
"hs_pipeline_stage": "2",
"hs_ticket_category": null,
"hs_ticket_priority": "HIGH",
"subject": null
},
"createdAt": "2022-12-13T20:34:07.713Z",
"updatedAt": "2022-12-13T20:34:09.268Z",
"archived": false
},
{
"id": "1317387588",
"properties": {
"content": null,
"createdate": "2022-12-13T20:26:40.691Z",
"hs_lastmodifieddate": "2022-12-13T20:26:43.223Z",
"hs_object_id": "1317387588",
"hs_pipeline": "0",
"hs_pipeline_stage": "2",
"hs_ticket_category": null,
"hs_ticket_priority": "HIGH",
"subject": null
},
"createdAt": "2022-12-13T20:26:40.691Z",
"updatedAt": "2022-12-13T20:26:43.223Z",
"archived": false
}
],
"paging": {
"next": {
"after": "10"
}
}
}
And just for fun, if we flip it and use ASCENDING, here’s the response
{
"total": 12,
"results": [
{
"id": "1046754424",
"properties": {
"content": "This is a test form submission",
"createdate": "2022-08-11T23:23:54.489Z",
"hs_lastmodifieddate": "2022-09-14T12:25:22.358Z",
"hs_object_id": "1046754424",
"hs_pipeline": "0",
"hs_pipeline_stage": "1",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "New form channel connected"
},
"createdAt": "2022-08-11T23:23:54.489Z",
"updatedAt": "2022-09-14T12:25:22.358Z",
"archived": false
},
{
"id": "999396896",
"properties": {
"content": null,
"createdate": "2022-07-14T16:08:40.033Z",
"hs_lastmodifieddate": "2022-10-24T20:09:44.395Z",
"hs_object_id": "999396896",
"hs_pipeline": "0",
"hs_pipeline_stage": "1",
"hs_ticket_category": null,
"hs_ticket_priority": "HIGH",
"subject": "troubleshoot report"
},
"createdAt": "2022-07-14T16:08:40.033Z",
"updatedAt": "2022-10-24T20:09:44.395Z",
"archived": false
},
{
"id": "1317387588",
"properties": {
"content": null,
"createdate": "2022-12-13T20:26:40.691Z",
"hs_lastmodifieddate": "2022-12-13T20:26:43.223Z",
"hs_object_id": "1317387588",
"hs_pipeline": "0",
"hs_pipeline_stage": "2",
"hs_ticket_category": null,
"hs_ticket_priority": "HIGH",
"subject": null
},
"createdAt": "2022-12-13T20:26:40.691Z",
"updatedAt": "2022-12-13T20:26:43.223Z",
"archived": false
},
{
"id": "1317382811",
"properties": {
"content": null,
"createdate": "2022-12-13T20:34:07.713Z",
"hs_lastmodifieddate": "2022-12-13T20:34:09.268Z",
"hs_object_id": "1317382811",
"hs_pipeline": "0",
"hs_pipeline_stage": "2",
"hs_ticket_category": null,
"hs_ticket_priority": "HIGH",
"subject": null
},
"createdAt": "2022-12-13T20:34:07.713Z",
"updatedAt": "2022-12-13T20:34:09.268Z",
"archived": false
},
{
"id": "1478326183",
"properties": {
"content": null,
"createdate": "2023-03-03T21:15:46.531Z",
"hs_lastmodifieddate": "2023-03-03T21:15:51.870Z",
"hs_object_id": "1478326183",
"hs_pipeline": "0",
"hs_pipeline_stage": "1",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "Cat Circus—Big top issue"
},
"createdAt": "2023-03-03T21:15:46.531Z",
"updatedAt": "2023-03-03T21:15:51.870Z",
"archived": false
},
{
"id": "1500746054",
"properties": {
"content": null,
"createdate": "2023-03-16T15:48:45.014Z",
"hs_lastmodifieddate": "2023-03-16T15:48:46.290Z",
"hs_object_id": "1500746054",
"hs_pipeline": "19625033",
"hs_pipeline_stage": "47925262",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "Testerr 1"
},
"createdAt": "2023-03-16T15:48:45.014Z",
"updatedAt": "2023-03-16T15:48:46.290Z",
"archived": false
},
{
"id": "1500746070",
"properties": {
"content": null,
"createdate": "2023-03-16T15:49:04.683Z",
"hs_lastmodifieddate": "2023-03-16T15:49:06.041Z",
"hs_object_id": "1500746070",
"hs_pipeline": "19625033",
"hs_pipeline_stage": "47925262",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "Testerr 2"
},
"createdAt": "2023-03-16T15:49:04.683Z",
"updatedAt": "2023-03-16T15:49:06.041Z",
"archived": false
},
{
"id": "1503346867",
"properties": {
"content": null,
"createdate": "2023-03-17T22:27:14.029Z",
"hs_lastmodifieddate": "2023-03-17T22:27:14.967Z",
"hs_object_id": "1503346867",
"hs_pipeline": "19625033",
"hs_pipeline_stage": "47925262",
"hs_ticket_category": null,
"hs_ticket_priority": "HIGH",
"subject": "Cats and ninjas"
},
"createdAt": "2023-03-17T22:27:14.029Z",
"updatedAt": "2023-03-17T22:27:14.967Z",
"archived": false
},
{
"id": "1555709794",
"properties": {
"content": null,
"createdate": "2023-04-13T22:25:41.685Z",
"hs_lastmodifieddate": "2024-07-31T15:57:50.072Z",
"hs_object_id": "1555709794",
"hs_pipeline": "19625033",
"hs_pipeline_stage": "47925265",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "Testerr 3"
},
"createdAt": "2023-04-13T22:25:41.685Z",
"updatedAt": "2024-07-31T15:57:50.072Z",
"archived": false
},
{
"id": "15812399029",
"properties": {
"content": null,
"createdate": "2024-10-28T22:28:44.477Z",
"hs_lastmodifieddate": "2024-10-28T22:28:45.157Z",
"hs_object_id": "15812399029",
"hs_pipeline": "0",
"hs_pipeline_stage": "1",
"hs_ticket_category": null,
"hs_ticket_priority": null,
"subject": "testerrr 4"
},
"createdAt": "2024-10-28T22:28:44.477Z",
"updatedAt": "2024-10-28T22:28:45.157Z",
"archived": false
}
],
"paging": {
"next": {
"after": "10"
}
}
}
Talk soon! — Jaycee