CQL field
id in CQL (Confluence): syntax and examples
The id field matches content by its content id: the number in a page URL, such as /pages/32964613/. Use it when you already know exactly which pages you want, or to leave a few known pages out of a larger search. It accepts a single id or a list.
Syntax
id = 32964613
id in (32964613, 655541)
id != 32964613
Arguments
| Argument | What it does |
|---|---|
value | A content id. Pages, comments and blog posts use the plain number. Attachments use the number with an att prefix, for example att655572. |
Works with
- Operators: =, !=, IN, NOT IN
- Functions: none
- Not with: ~, !~, >, >=, <, <=, so there is no way to search an id range
- Alias: content (same field, same results)
Examples
id = 32964613Opens one known page, for example the handbook, from a script or a saved search.
Run on Confluence Cloud on .
id in (32964613, 655541) ORDER BY titleFetches a short list of pages in one request and sorts them by title.
Run on Confluence Cloud on .
id = att655572Finds one attachment by its id when you only have the id from an API response or a download link.
Run on Confluence Cloud on .
id != 32964613 AND space = SD AND type = pageLists every page in a space except one you already handled.
Run on Confluence Cloud on .
id not in (32964613, 655541) AND space = SD AND type = page AND ancestor = 655541Lists the pages under a space home, leaving out the handbook and the home page itself.
Run on Confluence Cloud on .
Pitfalls
- A bare number never matches an attachment.
id = 655572runs without an error and finds nothing, whileid = att655572finds the file. The REST API returns attachment ids with theattprefix, so copy them as they are (checked on Confluence Cloud, November 2026). - The value must be a content id.
id = abcfails with: Can't parse as a ContentId. A title is not accepted either, usetitlefor that. - Only the equality operators work.
id > 100fails with: Operator '>' is not supported for field 'id'.id ~ 32964613fails too, so a range of ids cannot be searched. - The id of a page is not the id of its attachments or comments. A search by
idreturns only the item with that exact id. To get what hangs under a page, combineancestororparentwithtype.
Questions and answers
Where do I find a page id?
It is the number in the page URL after /pages/. In the REST API it is the id property of the content.
Does id take a quoted value?
Yes. id = "32964613" gives the same result as the unquoted form (checked on Confluence Cloud, November 2026).