Going Stellar

Home/CQL reference

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

ArgumentWhat it does
valueA 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 = 32964613

Opens 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 title

Fetches a short list of pages in one request and sorts them by title.

Run on Confluence Cloud on .

id = att655572

Finds 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 = page

Lists 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 = 655541

Lists 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 = 655572 runs without an error and finds nothing, while id = att655572 finds the file. The REST API returns attachment ids with the att prefix, so copy them as they are (checked on Confluence Cloud, November 2026).
  • The value must be a content id. id = abc fails with: Can't parse as a ContentId. A title is not accepted either, use title for that.
  • Only the equality operators work. id > 100 fails with: Operator '>' is not supported for field 'id'. id ~ 32964613 fails 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 id returns only the item with that exact id. To get what hangs under a page, combine ancestor or parent with type.

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).

Sources

  1. CQL fields (Atlassian Developer, Confluence Cloud)

Markdown version · All CQL pages