I uploaded three attachments via the UI. When retrieving them using the /search
endpoint and ordering by created
date in ascending order, the results were not sorted correctly because milliseconds were not considered.
Ordering by created
date in descending order works as expected.
This issue also occurs with other entities, such as spaces. When creating three spaces with created
dates differing only by milliseconds, ordering them by ascending created
date produced incorrect results.
Attachments:
GET /ex/confluence/{cloudId}/wiki/rest/api/search?limit=200&expand=content.history&cql=type%3Dattachment+order+by+created+asc&start=0 HTTP/1.1
Host: api.atlassian.com
Authorization: ******
Accept: application/json
Accept-Encoding: gzip, deflate
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
"results": [
{
"content": {
"id": "att163948",
"type": "attachment",
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:attachment/163948",
"base64EncodedAri": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6MWJkNzc4N2ItYTc0YS00NGEwLTkwYWEtNmU5ZGIxNjlmY2RjOmF0dGFjaG1lbnQvMTYzOTQ4",
"status": "current",
"title": "SD-default",
"history": {
"latest": true,
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-05-19T14:34:17.422Z",
"_expandable": {
"lastUpdated": "",
"previousVersion": "",
"lastOwnedBy": "",
"contributors": "",
"nextVersion": "",
"ownedBy": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att163948/history"
}
},
"macroRenderedOutput": {
},
"metadata": {
"comment": "Default space logo with path /images/logo/default10-256.png",
"mediaType": "image/jpeg"
},
"extensions": {
"mediaType": "image/jpeg",
"fileSize": 15585,
"comment": "Default space logo with path /images/logo/default10-256.png",
"mediaTypeDescription": "JPEG Image",
"fileId": "8a084af1-4074-4bc5-9df0-3e95b963860b",
"collectionName": "SD-spacedesc"
},
"_expandable": {
"container": "/rest/api/space/SD",
"restrictions": "/rest/api/content/att163948/restriction/byOperation",
"body": "",
"version": "",
"descendants": "/rest/api/content/att163948/descendant",
"space": "/rest/api/space/SD",
"childTypes": "",
"schedulePublishInfo": "",
"operations": "",
"schedulePublishDate": "",
"children": "/rest/api/content/att163948/child",
"ancestors": "",
"draftVersion": ""
},
"_links": {
"webui": "/spaces/SD",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att163948",
"download": "/download/attachments/163845/SD-default?version=1&modificationDate=1747665257422&cacheVersion=1&api=v2"
}
},
"title": "SD-default",
"excerpt": "",
"url": "/spaces/SD",
"resultGlobalContainer": {
"title": "Software Development",
"displayUrl": "/spaces/SD"
},
"breadcrumbs": [
],
"entityType": "content",
"iconCssClass": "content-type-attachment-image",
"lastModified": "2025-05-19T14:34:17.000Z",
"friendlyLastModified": "May 19, 2025",
"score": 0.0
},
{
"content": {
"id": "att163990",
"type": "attachment",
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:attachment/163990",
"base64EncodedAri": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6MWJkNzc4N2ItYTc0YS00NGEwLTkwYWEtNmU5ZGIxNjlmY2RjOmF0dGFjaG1lbnQvMTYzOTkw",
"status": "current",
"title": "recently_updated.svg",
"history": {
"latest": true,
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-05-19T14:34:18.846Z",
"_expandable": {
"lastUpdated": "",
"previousVersion": "",
"lastOwnedBy": "",
"contributors": "",
"nextVersion": "",
"ownedBy": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att163990/history"
}
},
"macroRenderedOutput": {
},
"metadata": {
"mediaType": "image/svg+xml"
},
"extensions": {
"mediaType": "image/svg+xml",
"fileSize": 5846,
"comment": "",
"fileId": "cb4e57c3-e267-4c8e-92c7-51e33c1e3a58",
"collectionName": "contentId-163966"
},
"_expandable": {
"container": "/rest/api/content/163966",
"restrictions": "/rest/api/content/att163990/restriction/byOperation",
"body": "",
"version": "",
"descendants": "/rest/api/content/att163990/descendant",
"space": "/rest/api/space/SD",
"childTypes": "",
"schedulePublishInfo": "",
"operations": "",
"schedulePublishDate": "",
"children": "/rest/api/content/att163990/child",
"ancestors": "",
"draftVersion": ""
},
"_links": {
"webui": "/pages/viewpageattachments.action?pageId=163966&preview=%2F163966%2F163990%2Frecently_updated.svg",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att163990",
"download": "/download/attachments/163966/recently_updated.svg?version=1&modificationDate=1747665258846&cacheVersion=1&api=v2"
}
},
"title": "recently_updated.svg",
"excerpt": "",
"url": "/pages/viewpageattachments.action?pageId=163966&preview=%2F163966%2F163990%2Frecently_updated.svg",
"resultGlobalContainer": {
"title": "Software Development",
"displayUrl": "/spaces/SD"
},
"breadcrumbs": [
],
"entityType": "content",
"iconCssClass": "content-type-attachment-unknown",
"lastModified": "2025-05-19T14:34:18.000Z",
"friendlyLastModified": "May 19, 2025",
"score": 0.0
},
{
"content": {
"id": "att163978",
"type": "attachment",
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:attachment/163978",
"base64EncodedAri": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6MWJkNzc4N2ItYTc0YS00NGEwLTkwYWEtNmU5ZGIxNjlmY2RjOmF0dGFjaG1lbnQvMTYzOTc4",
"status": "current",
"title": "header_software_project_space.svg",
"history": {
"latest": true,
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-05-19T14:34:18.250Z",
"_expandable": {
"lastUpdated": "",
"previousVersion": "",
"lastOwnedBy": "",
"contributors": "",
"nextVersion": "",
"ownedBy": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att163978/history"
}
},
"macroRenderedOutput": {
},
"metadata": {
"mediaType": "image/svg+xml"
},
"extensions": {
"mediaType": "image/svg+xml",
"fileSize": 3258,
"comment": "",
"fileId": "e60216c5-a060-44e8-aefa-42161783ec64",
"collectionName": "contentId-163966"
},
"_expandable": {
"container": "/rest/api/content/163966",
"restrictions": "/rest/api/content/att163978/restriction/byOperation",
"body": "",
"version": "",
"descendants": "/rest/api/content/att163978/descendant",
"space": "/rest/api/space/SD",
"childTypes": "",
"schedulePublishInfo": "",
"operations": "",
"schedulePublishDate": "",
"children": "/rest/api/content/att163978/child",
"ancestors": "",
"draftVersion": ""
},
"_links": {
"webui": "/pages/viewpageattachments.action?pageId=163966&preview=%2F163966%2F163978%2Fheader_software_project_space.svg",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att163978",
"download": "/download/attachments/163966/header_software_project_space.svg?version=1&modificationDate=1747665258250&cacheVersion=1&api=v2"
}
},
"title": "header_software_project_space.svg",
"excerpt": "",
"url": "/pages/viewpageattachments.action?pageId=163966&preview=%2F163966%2F163978%2Fheader_software_project_space.svg",
"resultGlobalContainer": {
"title": "Software Development",
"displayUrl": "/spaces/SD"
},
"breadcrumbs": [
],
"entityType": "content",
"iconCssClass": "content-type-attachment-unknown",
"lastModified": "2025-05-19T14:34:18.000Z",
"friendlyLastModified": "May 19, 2025",
"score": 0.0
},
{
"content": {
"id": "att164000",
"type": "attachment",
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:attachment/164000",
"base64EncodedAri": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6MWJkNzc4N2ItYTc0YS00NGEwLTkwYWEtNmU5ZGIxNjlmY2RjOmF0dGFjaG1lbnQvMTY0MDAw",
"status": "current",
"title": "roadmap.svg",
"history": {
"latest": true,
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-05-19T14:34:19.939Z",
"_expandable": {
"lastUpdated": "",
"previousVersion": "",
"lastOwnedBy": "",
"contributors": "",
"nextVersion": "",
"ownedBy": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att164000/history"
}
},
"macroRenderedOutput": {
},
"metadata": {
"mediaType": "image/svg+xml"
},
"extensions": {
"mediaType": "image/svg+xml",
"fileSize": 2072,
"comment": "",
"fileId": "b2606571-32a3-497b-9d2f-57c33b1cc02f",
"collectionName": "contentId-163966"
},
"_expandable": {
"container": "/rest/api/content/163966",
"restrictions": "/rest/api/content/att164000/restriction/byOperation",
"body": "",
"version": "",
"descendants": "/rest/api/content/att164000/descendant",
"space": "/rest/api/space/SD",
"childTypes": "",
"schedulePublishInfo": "",
"operations": "",
"schedulePublishDate": "",
"children": "/rest/api/content/att164000/child",
"ancestors": "",
"draftVersion": ""
},
"_links": {
"webui": "/pages/viewpageattachments.action?pageId=163966&preview=%2F163966%2F164000%2Froadmap.svg",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att164000",
"download": "/download/attachments/163966/roadmap.svg?version=1&modificationDate=1747665259939&cacheVersion=1&api=v2"
}
},
"title": "roadmap.svg",
"excerpt": "",
"url": "/pages/viewpageattachments.action?pageId=163966&preview=%2F163966%2F164000%2Froadmap.svg",
"resultGlobalContainer": {
"title": "Software Development",
"displayUrl": "/spaces/SD"
},
"breadcrumbs": [
],
"entityType": "content",
"iconCssClass": "content-type-attachment-unknown",
"lastModified": "2025-05-19T14:34:19.000Z",
"friendlyLastModified": "May 19, 2025",
"score": 0.0
},
{
"content": {
"id": "att163995",
"type": "attachment",
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:attachment/163995",
"base64EncodedAri": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6MWJkNzc4N2ItYTc0YS00NGEwLTkwYWEtNmU5ZGIxNjlmY2RjOmF0dGFjaG1lbnQvMTYzOTk1",
"status": "current",
"title": "jira_issues.svg",
"history": {
"latest": true,
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-05-19T14:34:19.385Z",
"_expandable": {
"lastUpdated": "",
"previousVersion": "",
"lastOwnedBy": "",
"contributors": "",
"nextVersion": "",
"ownedBy": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att163995/history"
}
},
"macroRenderedOutput": {
},
"metadata": {
"mediaType": "image/svg+xml"
},
"extensions": {
"mediaType": "image/svg+xml",
"fileSize": 6950,
"comment": "",
"fileId": "6d5884bb-d073-4634-92cf-81b6199ea714",
"collectionName": "contentId-163966"
},
"_expandable": {
"container": "/rest/api/content/163966",
"restrictions": "/rest/api/content/att163995/restriction/byOperation",
"body": "",
"version": "",
"descendants": "/rest/api/content/att163995/descendant",
"space": "/rest/api/space/SD",
"childTypes": "",
"schedulePublishInfo": "",
"operations": "",
"schedulePublishDate": "",
"children": "/rest/api/content/att163995/child",
"ancestors": "",
"draftVersion": ""
},
"_links": {
"webui": "/pages/viewpageattachments.action?pageId=163966&preview=%2F163966%2F163995%2Fjira_issues.svg",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att163995",
"download": "/download/attachments/163966/jira_issues.svg?version=1&modificationDate=1747665259385&cacheVersion=1&api=v2"
}
},
"title": "jira_issues.svg",
"excerpt": "",
"url": "/pages/viewpageattachments.action?pageId=163966&preview=%2F163966%2F163995%2Fjira_issues.svg",
"resultGlobalContainer": {
"title": "Software Development",
"displayUrl": "/spaces/SD"
},
"breadcrumbs": [
],
"entityType": "content",
"iconCssClass": "content-type-attachment-unknown",
"lastModified": "2025-05-19T14:34:19.000Z",
"friendlyLastModified": "May 19, 2025",
"score": 0.0
},
{
"content": {
"id": "att31490052",
"type": "attachment",
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:attachment/31490052",
"base64EncodedAri": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6MWJkNzc4N2ItYTc0YS00NGEwLTkwYWEtNmU5ZGIxNjlmY2RjOmF0dGFjaG1lbnQvMzE0OTAwNTI=",
"status": "current",
"title": "attachment1.txt",
"history": {
"latest": true,
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-09-03T13:37:23.206Z",
"_expandable": {
"lastUpdated": "",
"previousVersion": "",
"lastOwnedBy": "",
"contributors": "",
"nextVersion": "",
"ownedBy": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att31490052/history"
}
},
"macroRenderedOutput": {
},
"metadata": {
"mediaType": "text/plain"
},
"extensions": {
"mediaType": "text/plain",
"fileSize": 15,
"comment": "",
"mediaTypeDescription": "Text File",
"fileId": "666e7e7d-f171-4a59-a547-e6285cc78b6e",
"collectionName": "contentId-31162390"
},
"_expandable": {
"container": "/rest/api/content/31162390",
"restrictions": "/rest/api/content/att31490052/restriction/byOperation",
"body": "",
"version": "",
"descendants": "/rest/api/content/att31490052/descendant",
"space": "/rest/api/space/~712020b840840acfed4521a241bf7685cddb83",
"childTypes": "",
"schedulePublishInfo": "",
"operations": "",
"schedulePublishDate": "",
"children": "/rest/api/content/att31490052/child",
"ancestors": "",
"draftVersion": ""
},
"_links": {
"webui": "/pages/viewpageattachments.action?pageId=31162390&preview=%2F31162390%2F31490052%2Fattachment1.txt",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att31490052",
"download": "/download/attachments/31162390/attachment1.txt?version=2&modificationDate=1756906643206&cacheVersion=1&api=v2"
}
},
"title": "attachment1.txt",
"excerpt": "Hello, world! 1",
"url": "/pages/viewpageattachments.action?pageId=31162390&preview=%2F31162390%2F31490052%2Fattachment1.txt",
"resultGlobalContainer": {
"title": "test2 testacc",
"displayUrl": "/spaces/~712020b840840acfed4521a241bf7685cddb83"
},
"breadcrumbs": [
],
"entityType": "content",
"iconCssClass": "content-type-attachment-text",
"lastModified": "2025-09-03T13:37:23.000Z",
"friendlyLastModified": "3 minutes ago",
"score": 0.0
},
{
"content": {
"id": "att31260694",
"type": "attachment",
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:attachment/31260694",
"base64EncodedAri": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6MWJkNzc4N2ItYTc0YS00NGEwLTkwYWEtNmU5ZGIxNjlmY2RjOmF0dGFjaG1lbnQvMzEyNjA2OTQ=",
"status": "current",
"title": "attachment3.txt",
"history": {
"latest": true,
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-09-03T13:37:23.653Z",
"_expandable": {
"lastUpdated": "",
"previousVersion": "",
"lastOwnedBy": "",
"contributors": "",
"nextVersion": "",
"ownedBy": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att31260694/history"
}
},
"macroRenderedOutput": {
},
"metadata": {
"mediaType": "text/plain"
},
"extensions": {
"mediaType": "text/plain",
"fileSize": 15,
"comment": "",
"mediaTypeDescription": "Text File",
"fileId": "8ec54dcb-2928-457b-9564-fa11f37087b5",
"collectionName": "contentId-31162390"
},
"_expandable": {
"container": "/rest/api/content/31162390",
"restrictions": "/rest/api/content/att31260694/restriction/byOperation",
"body": "",
"version": "",
"descendants": "/rest/api/content/att31260694/descendant",
"space": "/rest/api/space/~712020b840840acfed4521a241bf7685cddb83",
"childTypes": "",
"schedulePublishInfo": "",
"operations": "",
"schedulePublishDate": "",
"children": "/rest/api/content/att31260694/child",
"ancestors": "",
"draftVersion": ""
},
"_links": {
"webui": "/pages/viewpageattachments.action?pageId=31162390&preview=%2F31162390%2F31260694%2Fattachment3.txt",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att31260694",
"download": "/download/attachments/31162390/attachment3.txt?version=1&modificationDate=1756906643653&cacheVersion=1&api=v2"
}
},
"title": "attachment3.txt",
"excerpt": "Hello, world! 3",
"url": "/pages/viewpageattachments.action?pageId=31162390&preview=%2F31162390%2F31260694%2Fattachment3.txt",
"resultGlobalContainer": {
"title": "test2 testacc",
"displayUrl": "/spaces/~712020b840840acfed4521a241bf7685cddb83"
},
"breadcrumbs": [
],
"entityType": "content",
"iconCssClass": "content-type-attachment-text",
"lastModified": "2025-09-03T13:37:23.000Z",
"friendlyLastModified": "3 minutes ago",
"score": 0.0
},
{
"content": {
"id": "att31260688",
"type": "attachment",
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:attachment/31260688",
"base64EncodedAri": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6MWJkNzc4N2ItYTc0YS00NGEwLTkwYWEtNmU5ZGIxNjlmY2RjOmF0dGFjaG1lbnQvMzEyNjA2ODg=",
"status": "current",
"title": "attachment2.txt",
"history": {
"latest": true,
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-09-03T13:37:23.372Z",
"_expandable": {
"lastUpdated": "",
"previousVersion": "",
"lastOwnedBy": "",
"contributors": "",
"nextVersion": "",
"ownedBy": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att31260688/history"
}
},
"macroRenderedOutput": {
},
"metadata": {
"mediaType": "text/plain"
},
"extensions": {
"mediaType": "text/plain",
"fileSize": 15,
"comment": "",
"mediaTypeDescription": "Text File",
"fileId": "12935fc6-f1f2-4852-99f8-1a3aae9df7f5",
"collectionName": "contentId-31162390"
},
"_expandable": {
"container": "/rest/api/content/31162390",
"restrictions": "/rest/api/content/att31260688/restriction/byOperation",
"body": "",
"version": "",
"descendants": "/rest/api/content/att31260688/descendant",
"space": "/rest/api/space/~712020b840840acfed4521a241bf7685cddb83",
"childTypes": "",
"schedulePublishInfo": "",
"operations": "",
"schedulePublishDate": "",
"children": "/rest/api/content/att31260688/child",
"ancestors": "",
"draftVersion": ""
},
"_links": {
"webui": "/pages/viewpageattachments.action?pageId=31162390&preview=%2F31162390%2F31260688%2Fattachment2.txt",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/content/att31260688",
"download": "/download/attachments/31162390/attachment2.txt?version=1&modificationDate=1756906643372&cacheVersion=1&api=v2"
}
},
"title": "attachment2.txt",
"excerpt": "Hello, world! 2",
"url": "/pages/viewpageattachments.action?pageId=31162390&preview=%2F31162390%2F31260688%2Fattachment2.txt",
"resultGlobalContainer": {
"title": "test2 testacc",
"displayUrl": "/spaces/~712020b840840acfed4521a241bf7685cddb83"
},
"breadcrumbs": [
],
"entityType": "content",
"iconCssClass": "content-type-attachment-text",
"lastModified": "2025-09-03T13:37:23.000Z",
"friendlyLastModified": "3 minutes ago",
"score": 0.0
}
],
"start": 0,
"limit": 200,
"size": 8,
"totalSize": 8,
"cqlQuery": "type = attachment order by created asc",
"searchDuration": 132,
"_links": {
"base": "https://zhvilluesat.atlassian.net/wiki",
"context": "/wiki",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/search?expand=content.history&cql=type%3Dattachment+order+by+created+asc"
}
}
Attachment att31260694 "createdDate": "2025-09-03T13:37:23.653Z" is returned before attachment att31260688 "createdDate": "2025-09-03T13:37:23.372Z"
Spaces:
GET /ex/confluence/1bd7787b-a74a-44a0-90aa-6e9db169fcdc/wiki/rest/api/search?limit=200&expand=space.id%2Cspace.history&cql=type%3Dspace+order+by+created+asc&start=0 HTTP/1.1
Host: api.atlassian.com
Authorization: ******
Accept: application/json
Accept-Encoding: gzip, deflate
HTTP/1.1 200 OK
Content-Type: application/json
{
"results": [
{
"space": {
"id": 196610,
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:space/196610",
"key": "~712020b840840acfed4521a241bf7685cddb83",
"alias": "~712020b840840acfed4521a241bf7685cddb83",
"name": "test2 testacc",
"type": "personal",
"status": "current",
"history": {
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-05-19T14:34:17.768Z"
},
"_expandable": {
"settings": "/rest/api/space/~712020b840840acfed4521a241bf7685cddb83/settings",
"metadata": "",
"operations": "",
"lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=~712020b840840acfed4521a241bf7685cddb83",
"identifiers": "",
"permissions": "",
"roles": "",
"icon": "",
"typeSettings": "",
"description": "",
"theme": "/rest/api/space/~712020b840840acfed4521a241bf7685cddb83/theme",
"homepage": "/rest/api/content/196710"
},
"_links": {
"webui": "/spaces/~712020b840840acfed4521a241bf7685cddb83",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/space/~712020b840840acfed4521a241bf7685cddb83"
}
},
"title": "test2 testacc",
"excerpt": "",
"url": "/spaces/~712020b840840acfed4521a241bf7685cddb83",
"resultGlobalContainer": {
"title": "test2 testacc",
"displayUrl": "/spaces/~712020b840840acfed4521a241bf7685cddb83"
},
"breadcrumbs": [
],
"entityType": "space",
"iconCssClass": "aui-icon content-type-personal-space",
"lastModified": "2025-05-19T14:34:17.000Z",
"friendlyLastModified": "May 19, 2025",
"score": 0.0
},
{
"space": {
"id": 163846,
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:space/163846",
"key": "SD",
"alias": "SD",
"name": "Software Development",
"type": "global",
"status": "current",
"history": {
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-05-19T14:34:17.206Z"
},
"_expandable": {
"settings": "/rest/api/space/SD/settings",
"metadata": "",
"operations": "",
"lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=SD",
"identifiers": "",
"permissions": "",
"roles": "",
"icon": "",
"typeSettings": "",
"description": "",
"theme": "/rest/api/space/SD/theme",
"homepage": "/rest/api/content/163966"
},
"_links": {
"webui": "/spaces/SD",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/space/SD"
}
},
"title": "Software Development",
"excerpt": "",
"url": "/spaces/SD",
"resultGlobalContainer": {
"title": "Software Development",
"displayUrl": "/spaces/SD"
},
"breadcrumbs": [
],
"entityType": "space",
"iconCssClass": "aui-icon content-type-space",
"lastModified": "2025-05-19T14:34:18.000Z",
"friendlyLastModified": "May 19, 2025",
"score": 0.0
},
{
"space": {
"id": 31588359,
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:space/31588359",
"key": "testSpaceCreatedDateOrderByParallel3",
"alias": "testSpaceCreatedDateOrderByParallel3",
"name": "testSpaceCreatedDateOrderByParallel3",
"type": "global",
"status": "current",
"history": {
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-09-03T13:52:22.633Z"
},
"_expandable": {
"settings": "/rest/api/space/testSpaceCreatedDateOrderByParallel3/settings",
"metadata": "",
"operations": "",
"lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=testSpaceCreatedDateOrderByParallel3",
"identifiers": "",
"permissions": "",
"roles": "",
"icon": "",
"typeSettings": "",
"description": "",
"theme": "/rest/api/space/testSpaceCreatedDateOrderByParallel3/theme",
"homepage": "/rest/api/content/31588597"
},
"_links": {
"webui": "/spaces/testSpaceCreatedDateOrderByParallel3",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/space/testSpaceCreatedDateOrderByParallel3"
}
},
"title": "testSpaceCreatedDateOrderByParallel3",
"excerpt": "",
"url": "/spaces/testSpaceCreatedDateOrderByParallel3",
"resultGlobalContainer": {
"title": "testSpaceCreatedDateOrderByParallel3",
"displayUrl": "/spaces/testSpaceCreatedDateOrderByParallel3"
},
"breadcrumbs": [
],
"entityType": "space",
"iconCssClass": "aui-icon content-type-space",
"lastModified": "2025-09-03T13:52:23.000Z",
"friendlyLastModified": "2 minutes ago",
"score": 0.0
},
{
"space": {
"id": 31391763,
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:space/31391763",
"key": "testSpaceCreatedDateOrderByParallel1",
"alias": "testSpaceCreatedDateOrderByParallel1",
"name": "testSpaceCreatedDateOrderByParallel1",
"type": "global",
"status": "current",
"history": {
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-09-03T13:52:22.587Z"
},
"_expandable": {
"settings": "/rest/api/space/testSpaceCreatedDateOrderByParallel1/settings",
"metadata": "",
"operations": "",
"lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=testSpaceCreatedDateOrderByParallel1",
"identifiers": "",
"permissions": "",
"roles": "",
"icon": "",
"typeSettings": "",
"description": "",
"theme": "/rest/api/space/testSpaceCreatedDateOrderByParallel1/theme",
"homepage": "/rest/api/content/31392008"
},
"_links": {
"webui": "/spaces/testSpaceCreatedDateOrderByParallel1",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/space/testSpaceCreatedDateOrderByParallel1"
}
},
"title": "testSpaceCreatedDateOrderByParallel1",
"excerpt": "",
"url": "/spaces/testSpaceCreatedDateOrderByParallel1",
"resultGlobalContainer": {
"title": "testSpaceCreatedDateOrderByParallel1",
"displayUrl": "/spaces/testSpaceCreatedDateOrderByParallel1"
},
"breadcrumbs": [
],
"entityType": "space",
"iconCssClass": "aui-icon content-type-space",
"lastModified": "2025-09-03T13:52:23.000Z",
"friendlyLastModified": "2 minutes ago",
"score": 0.0
},
{
"space": {
"id": 31162680,
"ari": "ari:cloud:confluence:1bd7787b-a74a-44a0-90aa-6e9db169fcdc:space/31162680",
"key": "testSpaceCreatedDateOrderByParallel2",
"alias": "testSpaceCreatedDateOrderByParallel2",
"name": "testSpaceCreatedDateOrderByParallel2",
"type": "global",
"status": "current",
"history": {
"createdBy": {
"type": "known",
"accountId": "712020:b840840a-cfed-4521-a241-bf7685cddb83",
"accountType": "atlassian",
"email": "test2testacc@gmail.com",
"publicName": "test2 testacc",
"profilePicture": {
"path": "/wiki/aa-avatar/712020:b840840a-cfed-4521-a241-bf7685cddb83",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "test2 testacc",
"isExternalCollaborator": false,
"isGuest": false,
"locale": "en_GB",
"accountStatus": "active",
"_expandable": {
"operations": "",
"personalSpace": ""
},
"_links": {
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/user?accountId=712020:b840840a-cfed-4521-a241-bf7685cddb83"
}
},
"createdDate": "2025-09-03T13:52:22.595Z"
},
"_expandable": {
"settings": "/rest/api/space/testSpaceCreatedDateOrderByParallel2/settings",
"metadata": "",
"operations": "",
"lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=testSpaceCreatedDateOrderByParallel2",
"identifiers": "",
"permissions": "",
"roles": "",
"icon": "",
"typeSettings": "",
"description": "",
"theme": "/rest/api/space/testSpaceCreatedDateOrderByParallel2/theme",
"homepage": "/rest/api/content/31162924"
},
"_links": {
"webui": "/spaces/testSpaceCreatedDateOrderByParallel2",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/space/testSpaceCreatedDateOrderByParallel2"
}
},
"title": "testSpaceCreatedDateOrderByParallel2",
"excerpt": "",
"url": "/spaces/testSpaceCreatedDateOrderByParallel2",
"resultGlobalContainer": {
"title": "testSpaceCreatedDateOrderByParallel2",
"displayUrl": "/spaces/testSpaceCreatedDateOrderByParallel2"
},
"breadcrumbs": [
],
"entityType": "space",
"iconCssClass": "aui-icon content-type-space",
"lastModified": "2025-09-03T13:52:23.000Z",
"friendlyLastModified": "2 minutes ago",
"score": 0.0
}
],
"start": 0,
"limit": 200,
"size": 5,
"totalSize": 5,
"cqlQuery": "type = space order by created asc",
"searchDuration": 177,
"_links": {
"base": "https://zhvilluesat.atlassian.net/wiki",
"context": "/wiki",
"self": "https://zhvilluesat.atlassian.net/wiki/rest/api/search?expand=space.id%2Cspace.history&cql=type%3Dspace+order+by+created+asc"
}
}
Space 31588359
"createdDate": "2025-09-03T13:52:22.633Z"
is returned before space 31391763
"createdDate": "2025-09-03T13:52:22.587Z"
.
Items should be ordered strictly by created
date, including milliseconds, for both ascending and descending order.
Ordering by created
descending → works as expected.
Ordering by created
ascending → incorrect; milliseconds are ignored.
Probably you'd need to contact Atlassian support directly, as this might be an error in Confluence.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.