# id in CQL (Confluence): syntax and examples

URL: https://goingstellar.ro/reference/cql/id-field/

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

- `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 = 32964613
```

Opens one known page, for example the handbook, from a script or a saved search. Run on Confluence Cloud on 2026-11-29.

```
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 2026-11-29.

```
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 2026-11-29.

```
id != 32964613 AND space = SD AND type = page
```

Lists every page in a space except one you already handled. Run on Confluence Cloud on 2026-11-29.

```
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 2026-11-29.

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

## Related

- [content](https://goingstellar.ro/reference/cql/content-field/)
- [ancestor](https://goingstellar.ro/reference/cql/ancestor-field/)
- [parent](https://goingstellar.ro/reference/cql/parent-field/)
- [IN](https://goingstellar.ro/reference/cql/in-operator/)
- [NOT IN](https://goingstellar.ro/reference/cql/not-in-operator/)
- [=](https://goingstellar.ro/reference/cql/equals-operator/)

## Sources

- [CQL fields (Atlassian Developer, Confluence Cloud)](https://developer.atlassian.com/cloud/confluence/cql-fields/)

