> ## Documentation Index
> Fetch the complete documentation index at: https://forest-docs-prd-616-workflow-webhook-trigger.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Notes

> List notes and their messages for a project environment

## List notes

Returns notes and their messages for a specific project and environment, sorted by `id` in descending order (most recent first).

Use the `createdAt` filters for pagination.

```
GET /v1/project/{projectName}/environment/{environmentName}/notes
```

### Authentication

All requests require a Bearer token in the `Authorization` header. Generate one from [your account settings](https://app.forestadmin.com/user-settings).

```
Authorization: Bearer YOUR_APPLICATION_TOKEN
```

<Warning>
  The token must be generated by a user with an **Admin** role on the project. Tokens generated by non-admin users will not have access to this endpoint.
</Warning>

<Warning>
  If your project uses SSO, the application token must be generated while logged in with SSO.
</Warning>

### Path parameters

| Parameter         | Type   | Description                             |
| ----------------- | ------ | --------------------------------------- |
| `projectName`     | string | The **case sensitive** project name     |
| `environmentName` | string | The **case sensitive** environment name |

### Query parameters

| Parameter                                         | Type              | Description                                                                              |
| ------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------- |
| `limit`                                           | integer           | Maximum number of notes to return. Between 1 and 100. Default is 10.                     |
| `userEmail`                                       | string            | Filter by the email of the user who created the note.                                    |
| `userId`                                          | integer           | Filter by the id of the user who created the note.                                       |
| `teamName`                                        | string            | Filter by team name.                                                                     |
| `collectionName`                                  | string            | Filter by collection name (as defined in your schema).                                   |
| `recordId`                                        | string            | Filter by the id of the record the note is attached to.                                  |
| `createdAt.eq` / `.lt` / `.lte` / `.gt` / `.gte`  | string (ISO 8601) | Filter by creation date. Use `.lt`/`.lte`/`.gt`/`.gte` for range queries and pagination. |
| `updatedAt.eq` / `.lt` / `.lte` / `.gt` / `.gte`  | string (ISO 8601) | Filter by last update date.                                                              |
| `archivedAt.eq` / `.lt` / `.lte` / `.gt` / `.gte` | string (ISO 8601) | Filter by archive date.                                                                  |

### Response

```json theme={null}
{
  "hasMore": false,
  "parameters": {
    "projectName": "Forest",
    "environmentName": "Production",
    "limit": 10
  },
  "data": [
    {
      "object": "note",
      "id": 42,
      "title": "THE TITLE",
      "recordId": "10",
      "createdAt": "2024-02-20T10:35:54.685Z",
      "updatedAt": "2024-03-10T10:36:54.685Z",
      "archivedAt": "2024-05-22T14:01:23.015Z",
      "user": {
        "object": "user",
        "id": 1,
        "username": "alice1",
        "email": "alice@somewhere.com"
      },
      "environment": {
        "object": "environment",
        "name": "Production"
      },
      "team": {
        "object": "team",
        "name": "Operations"
      },
      "collection": {
        "object": "collection",
        "name": "client"
      },
      "messages": [
        {
          "object": "note-message",
          "content": "<p>Needs to be verified</p>",
          "createdAt": "2024-02-20T10:35:54.685Z",
          "user": {
            "object": "user",
            "email": "alice@somewhere.com",
            "id": 1,
            "username": "alice"
          }
        },
        {
          "object": "note-message",
          "content": "<p>Ok</p>",
          "createdAt": "2024-02-20T11:15:32.461Z",
          "user": {
            "object": "user",
            "email": "bob@somewhere.com",
            "id": 1,
            "username": "bob"
          }
        }
      ]
    }
  ]
}
```

### Response fields

| Field                | Type              | Description                                                                                                               |
| -------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `hasMore`            | boolean           | Whether more notes are available after this set.                                                                          |
| `data[].id`          | integer           | The note id.                                                                                                              |
| `data[].title`       | string            | The note title.                                                                                                           |
| `data[].recordId`    | string            | The id of the record the note is attached to.                                                                             |
| `data[].createdAt`   | string (ISO 8601) | When the note was created.                                                                                                |
| `data[].updatedAt`   | string (ISO 8601) | When the note (or one of its messages) was last updated.                                                                  |
| `data[].archivedAt`  | string (ISO 8601) | When the note was archived, if applicable.                                                                                |
| `data[].user`        | object            | The user who created the note (`id`, `username`, `email`).                                                                |
| `data[].environment` | object            | The environment the note is attached to.                                                                                  |
| `data[].team`        | object            | The team the note is attached to.                                                                                         |
| `data[].collection`  | object            | The collection the note is attached to. Notes created on collections deleted before 2024-06-11 may be missing this field. |
| `data[].messages`    | array             | Messages within the note thread. Each has `content` (HTML), `createdAt`, and `user`.                                      |

### Errors

| Status | Meaning                                                                                                   |
| ------ | --------------------------------------------------------------------------------------------------------- |
| `429`  | Too many requests. The response includes a `Retry-After` header indicating the number of seconds to wait. |
| `4XX`  | Client error. Response body contains `code` and `message`.                                                |
| `5XX`  | Server error. Response body contains `code` and `message`.                                                |
