Skip to content
atlassian-dc-mcp
Esc
↑↓navigate↵open⌘Jpreview

Search for entities in confluence

Search for entities in Confluence using the Confluence Query Language (CQL). For example:

Example request URI(s):

  • http://localhost:8080/confluence/rest/api/search?cql=creator=currentUser()&type%20in%20(space,page,user)&cqlcontext={"spaceKey":"TST", "contentId":"55"}

  • http://localhost:8080/confluence/rest/api/search?cql=siteSearch~'example'%20AND%20label=docs&expand=content.space,space.homepage&limit=10

GET/rest/api/search
Query parameters
cqlcontextstring

the execution context for CQL functions, provides current space key and content id. If this is not provided some CQL functions will not be available.

expandstring

the properties to expand on the search result, this may cause database requests for some properties

includeArchivedSpacesstring

whether to include content in archived spaces in the result, this defaults to false.

limitstring

the limit of the number of items to return, this may be restricted by fixed system limits.

startstring

he start point of the collection to return.

excerptstring

the excerpt strategy to apply to the result, one of : indexed, highlight, none. This defaults to highlight.

cqlstring

the CQL query see <a href='https://developer.atlassian.com/confdev/confluence-rest-api/advanced-searching-using-cql'>advanced searching in confluence using CQL</a>

Request body
application/json
string
Responses
200

returns a full JSON representation of a list of search results.

resultsSearchResult[]
Show properties
Array of SearchResult
titlestring
excerptstring
urlstring
resultParentContainerContainerSummary
Show properties
titlestring
displayUrlstring
resultGlobalContainerContainerSummary
Show properties
titlestring
displayUrlstring
iconCssClassstring
lastModifiedstring<date-time>
friendlyLastModifiedstring
entityobject
resultGlobalContainerRefReferenceContainerSummary
Show properties
expandedboolean
idPropertiesobject
resultParentRefReferenceContainerSummary
Show properties
expandedboolean
idPropertiesobject
entityRefReferenceObject
Show properties
expandedboolean
idPropertiesobject
resourceTypeResourceType
Show properties
namestring
typestring
urlstring
entityTypestring
startnumber
limitnumber
sizenumber
_linksobject
Show properties
basestring
selfstring
contextstring
nextstring
prevstring
400

returned if the query cannot be parsed

statusCodeinteger<int32>
dataValidationResult
Show properties
authorizedboolean
validboolean
errorsobject
successfulboolean
allowedInReadOnlyModeboolean
messagestring
reasonstring
Try it
Server
Parameters
Bodyapplication/json
Request
curl -X GET 'http://example.com:7990/confluence/rest/api/search' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '"string"'
Response
{
  "results": [
    {
      "title": "Page Title",
      "excerpt": "This is an excerpt of the page content",
      "url": "http://localhost:8080/confluence/display/SPACEKEY/Page+Title",
      "resultParentContainer": {
        "title": "Demo Title",
        "displayUrl": "http://localhost:8080/confluence/display/SPACEKEY/Page+Title"
      },
      "resultGlobalContainer": {
        "title": "Demo Title",
        "displayUrl": "http://localhost:8080/confluence/display/SPACEKEY/Page+Title"
      },
      "iconCssClass": "string",
      "lastModified": "2019-08-24T14:15:22Z",
      "friendlyLastModified": "string",
      "entity": {},
      "resultGlobalContainerRef": {
        "expanded": true,
        "idProperties": {}
      },
      "resultParentRef": {
        "expanded": true,
        "idProperties": {}
      },
      "entityRef": {
        "expanded": true,
        "idProperties": {}
      },
      "resourceType": {
        "name": "string",
        "type": "string",
        "url": "string"
      },
      "entityType": "string"
    }
  ],
  "start": 25,
  "limit": 25,
  "size": 25,
  "_links": {
    "base": "http://localhost:8085/rest/api",
    "self": "http://localhost:8085/rest/api",
    "context": "http://localhost:8085/rest/api",
    "next": "http://localhost:8085/rest/api/latest/../paginate?limit=25&start=50",
    "prev": "http://localhost:8085/rest/api/latest/../paginate?limit=25&start=0"
  }
}

Was this page helpful?