---
title: "Service: /comments/find [GET]"
source: https://dev.pageseeder.com/api/services/find-comments-public-GET.html
description: "GET service that retrieves filtered public comments from specified groups, supporting pagination and customizable output of attachments, contents, and metadata. Returns XML list sorted by most recent first."
last_updated: 2026-09-02T11:36:19+10:00
document_type: api_endpoint
operation_id: comment-GET
resource_id: comment
path_template: /comments/find
http_method: GET
api_category: comment
implementation_version: 6.2008
api_since: 5.2102
deprecated_since: null
obsolete_since: null
api_support: supported
cache_control: null
generated_at: 2026-09-02
tokens: ~2203
---

# /comments/find \[GET\]

## Description

This service returns a list of public [comments](../../reference/glossary/comment.md) using parameters to filter the results. The list of groups specified must be public groups. The most recent comments are returned first.

> **Note:** This service performs a search directly on the database and returns the corresponding comment instances as XML. Alternatively, an index search could provide better performance with the caveat that there can be a slight delay between a comment creation or update and its availability in the index.

## Parameters

| Name | Description | Required | Type | Default value |
| --- | --- | --- | --- | --- |
| groups | Comma-separated list of group names the comments **MUST** belong to | yes | strings |  |
| archived | If `true`, include archived comments | no | boolean | `false` |
| attachments | The attachments to include, can be `none`, `context` or `all` | no | enum | `all` |
| author | The `ID` of the comments author | no | long |  |
| contents | The contents to include, can be `none` or `all` | no | enum | `all` |
| context | Only return comments in this context, can be `group`, `uri`, `all` | no | enum | `all` |
| createdafter | The date time after which the comments were created e.g. `2010-10-25T12:26:00+10:00` | no | datetime |  |
| createdbefore | The date time before which the comments were created e.g. `2011-08-25T10:20:00-04:00` | no | datetime |  |
| emails | The email addresses to include, can be `none` or `all`  (`all` for administrators only) | no | boolean | `none` |
| labels | Comma-separated list of label values – comment **MUST** have all (not recommended for filtering large data sets) | no | string |  |
| moderated | If `true`, include moderated (not accepted) comments | no | boolean | `false` |
| page | The page to load | no | long | `1` |
| pagesize | The number of results per page | no  | long | `1000` |
| paths | The context URI paths for the comments – **MUST** be URL encoded (comma-separated list with optional `*` suffix) | no | paths |  |
| position | If `first`, only the first (root) comment in a discussion is returned (might be faster when using paths) | no | string | `any` |
| returngroups | The groups to return in the output, can be `none`, `specified` | no | enum | `none` or if multiple groups `specified` |
| statuses | Comma-separated list of statuses | no | status |  |
| title | The title the comments **MUST** have (optional wildcard `*` suffix, use `**` to escape) | no | string |  |
| type | The type the comments **MUST** have (optional wildcard `*` suffix, use `**` to escape) | no | string |  |
| types | Comma-separated list of types the comment can have (empty string means no type) | no | strings |  |

Including all attachments, contents and returned groups can incur a performance penalty when loading large discussions. Some of the following parameters allow developers to control whether they are loaded and returned or not.

### `attachments`

This parameter determines whether attachments are included in the response. Possible options are:

- `none` – No attachment is to be included
- `context` – Only include the context document or URL
- `all` – Include all attachments

> **Note:** The context is usually the same for all comments within the same discussion.

### `contents`

This parameter determines whether the contents of the individual comments are included in the response.

Possible options are:

- `none` – The content is not to be loaded
- `all` – Load the content of all comments

> **Note:** There is usually only one content of type `text/plain` when comments are entered through the user interface. However, it is possible to have contents with different media type when the comment has been created through the API.

### `returngroups`

This parameter determines whether to return groups on to which the comments were posted.

> **Tip:** Returning the group might be unnecessary if the client knows the group and the comments aren't shared.

Possible options are:

- `none` – The groups are not to be loaded
- `specified` – Load the content of all comments

### `statuses`

A comma-separated list of [task status](../../reference/glossary/task_status.md) or [document status](../../reference/glossary/document_status.md) values.

## Permission

This service requires no permissions but will only work on groups configured for public access and requires `publicEnable=non-member` in the [Global properties](../../guide/configuration/properties/global_properties.md).

If the parameter `emails` is set to `all`, the permission is restricted to administrator only.

## Response

This service returns a list of [\<comment\>](../elements/element_comment.md) elements wrapped in a `<comments>` element as in the following example.

```xml

<comments>
  <comment id="234"
           contentrole="File Attachment"
           created="2012-03-08T12:34:00+10:00">
    <title>My thread</title>
    <content type="text/plain">Some text</content>
    <attachment>
      <uri id="189">...</uri>
    </attachment>
    <attachment fragment="5">
      <uri id="289">...</uri>
    </attachment>
    <context>
      <group id="3" name="acme-test" />
    </context>
  </comment>
  <comment id="567">...
    <context fragment="2">
      <uri id="789">...</uri>
    </context>
  </comment>
</comments>
```

By default, all attachments and contents are included.

### Effect of `attachments` parameter

If attachments is `none`:

```xml

<comments>
  <comment id="33"
           discussionid="33"
           contentrole="Comment"
           created="2017-02-15T10:17:37+11:00">
    <title>Welcome</title>
    <author> ... </author>
    <content type="text/plain"> ... </content>
  </comment>
</comments>
```

If attachments is `context`, only the [\<context\> element](../elements/element_context.md) is included:

```xml

<comments>
  <comment id="33"
           discussionid="33"
           contentrole="Comment"
           created="2017-02-15T10:17:37+11:00">
    <title>Welcome</title>
    <author> ... </author>
    <!-- Context is included -->
    <content  type="text/plain"> ... </content>
    <context>
      <uri> ... </uri>
    </context>
  </comment>
  ...
</comments>
```

If attachments is `all`, both the attachments to the comment using the [\<attachment\> element](../elements/element_attachment.md) and the context are included:

```xml

<comments> 
  <comment id="33"
           discussionid="33"
           contentrole="Comment"
           created="2017-02-15T10:17:37+11:00">
    <title>Welcome</title>
    <author> ... </author>
    <content  type="text/plain"> ... </content>
    <!-- File attachments -->
    <attachment> 
      <uri> ... </uri>
    </attachment>
    <attachment>
      <uri> ... </uri>
    </attachment>
    <!-- Context of the comment -->
    <context> 
      <uri> ... </uri>
    </context>
  </comment>
  ...
</comments>
```

### Effect of `contents` parameter

If contents is `none`, the comment content is not included:

```xml

<comments>
  <comment id="33"
           discussionid="33"
           contentrole="Comment"
           created="2017-02-15T10:17:37+11:00">
    <title>Welcome</title>
    <author> ... </author>
    <!-- Content is omitted--> 
    <attachment> 
      <uri> ... </uri> 
    </attachment> 
    <attachment> 
      <uri> ... </uri>
    </attachment>
    <context>
      <uri> ... </uri>
    </context>
  </comment>
  ...
</comments>
```

### Effect of `returngroups` parameter

If returngroups is `none`, the comment does not include the [\<group\> element](../elements/element_group.md). This is the default behavior when a comment is posted on a single group.

```xml

<comments>
  <comment id="33"
           discussionid="33"
           contentrole="Comment"
           created="2017-02-15T10:17:37+11:00">
    <title>Welcome</title>
    <author> ... </author>
    <content> ... </content>
    <context>
      <uri> ... </uri>
    </context>
    <!-- Group is omitted -->
  </comment>
  ...
</comments>
```

If returngroups is `specified`, the comment include the groups that the comment was posted on. This is the default behavior when a comment belongs to multiple groups:

```xml

<comments>
  <comment id="33"
           discussionid="33"
           contentrole="Comment"
           created="2017-02-15T10:17:37+11:00" >
    <title>Welcome</title>
    <author> ... </author>
    <content> ... </content>
    <context>
      <uri> ... </uri>
    </context>
    <!-- Group is included -->
    <group id="123" name="acme-tomato"/>
  </comment>
  ...
</comments>
```

## Error Handling

| Code | Cause / Description |
| --- | --- |
| 0x1306 | The Group is invalid or not accessible |
| 0x1312 | The createdafter or createdbefore date is invalid |
| 0x1313 | The author is invalid |

