> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List Notifications

> Lists notifications for the authenticated user.

`Unary` · [`Notifications`](/docs/api-reference/generated/notification/overview)

Lists notifications for the authenticated user.
Response includes unread\_count and total\_count for the inbox badge.

### Examples

* List all notifications:

  ```yaml theme={null}
  pagination:
    pageSize: 20
  ```

* List unread notifications:

  ```yaml theme={null}
  pagination:
    pageSize: 20
  read: false
  ```

## Endpoint

```text theme={null}
POST /api/gitpod.v1.NotificationService/ListNotifications
```

Send a Bearer token as described in [Authentication](/docs/api-reference#authenticate-requests). If your organization uses a custom management-plane domain, replace `https://app.ona.com` with that domain.

## Request example

<CodeGroup>
  ```bash cURL theme={null}
  export ONA_HOST=https://app.ona.com
  export ONA_API_KEY=<your-token>

  curl --request POST \
    --url "$ONA_HOST/api/gitpod.v1.NotificationService/ListNotifications" \
    --header "Authorization: Bearer $ONA_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
    "pagination": {
      "pageSize": 1
    }
  }'
  ```

  ```python Python theme={null}
  import gitpod.v1.notification_pb2 as notification_pb2
  import gitpod.v1.pagination_pb2 as pagination_pb2
  from ona_sdk import create_client_from_env

  ona = create_client_from_env()
  request = notification_pb2.ListNotificationsRequest(
      pagination=pagination_pb2.PaginationRequest(
          page_size=1,
      ),
  )
  response = ona.services.notification.list_notifications(request)
  print(response)
  ```

  ```typescript TypeScript theme={null}
  import { create } from "@bufbuild/protobuf";
  import { createClientFromEnv } from "@gitpod/sdk";
  import { ListNotificationsRequestSchema } from "@gitpod/sdk/gitpod/v1/notification_pb";

  async function main() {
    const ona = createClientFromEnv();
    const request = create(ListNotificationsRequestSchema, {
      pagination: {
        pageSize: 1,
      },
    });
    const response = await ona.services.notification.listNotifications(request);
    console.log(response);
  }

  main().catch(console.error);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"log"

  	"connectrpc.com/connect"
  	"github.com/gitpod-io/gitpod-sdk-go/sdk"
  	gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
  )

  func main() {
  	ona, err := sdk.NewFromEnv()
  	if err != nil {
  		log.Fatal(err)
  	}

  	request := connect.NewRequest(&gitpodpb.ListNotificationsRequest{
  		Pagination: &gitpodpb.PaginationRequest{
  			PageSize: 1,
  		},
  	})
  	response, err := ona.Services.Notification.ListNotifications(context.Background(), request)
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(response.Msg)
  }
  ```

  ```json Request body theme={null}
  {
    "pagination": {
      "pageSize": 1
    }
  }
  ```
</CodeGroup>

## Request

`gitpod.v1.ListNotificationsRequest`

| Field        | Type                                                           | Required | Description                                                                                      |
| ------------ | -------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------ |
| `pagination` | [PaginationRequest](#type-gitpod-v1-pagination-request)        | No       |                                                                                                  |
| `read`       | boolean                                                        | No       | Filter by read status. If not set, returns all notifications.                                    |
| `types`      | array of [NotificationType](#enum-gitpod-v1-notification-type) | No       | Filter by notification types. If empty, returns all types. Constraints: `repeated.max_items=20`. |

## Response

`gitpod.v1.ListNotificationsResponse`

| Field           | Type                                                      | Required | Description                                                        |
| --------------- | --------------------------------------------------------- | -------- | ------------------------------------------------------------------ |
| `pagination`    | [PaginationResponse](#type-gitpod-v1-pagination-response) | No       |                                                                    |
| `notifications` | array of [Notification](#type-gitpod-v1-notification)     | No       |                                                                    |
| `unreadCount`   | integer                                                   | No       | Counts for the inbox badge. Always returned regardless of filters. |
| `totalCount`    | integer                                                   | No       |                                                                    |

## Related types

<a id="type-gitpod-v1-notification" />

<Accordion title="Notification">
  Notification represents an in-app notification for a user.

  `gitpod.v1.Notification`

  | Field       | Type                                                        | Required | Description                                     |
  | ----------- | ----------------------------------------------------------- | -------- | ----------------------------------------------- |
  | `id`        | string                                                      | No       | Constraints: `string.uuid=true`.                |
  | `userId`    | string                                                      | Yes      | Constraints: `required=true, string.uuid=true`. |
  | `type`      | [NotificationType](#enum-gitpod-v1-notification-type)       | No       |                                                 |
  | `title`     | string                                                      | No       |                                                 |
  | `body`      | string                                                      | No       |                                                 |
  | `context`   | [NotificationContext](#type-gitpod-v1-notification-context) | No       |                                                 |
  | `readAt`    | RFC 3339 timestamp                                          | No       |                                                 |
  | `createdAt` | RFC 3339 timestamp                                          | No       |                                                 |
  | `updatedAt` | RFC 3339 timestamp                                          | No       |                                                 |
</Accordion>

<a id="type-gitpod-v1-notification-context" />

<Accordion title="NotificationContext">
  NotificationContext carries structured metadata for click-through navigation.
  Context is snapshotted at emit time so deleted resources still have display names.

  `gitpod.v1.NotificationContext`

  | Field               | Type                     | Required | Description |
  | ------------------- | ------------------------ | -------- | ----------- |
  | `environment`       | EnvironmentContext       | No       |             |
  | `agentExecution`    | AgentExecutionContext    | No       |             |
  | `project`           | ProjectContext           | No       |             |
  | `workflowExecution` | WorkflowExecutionContext | No       |             |
  | `member`            | MemberContext            | No       |             |
  | `billing`           | BillingContext           | No       |             |
</Accordion>

<a id="type-gitpod-v1-pagination-request" />

<Accordion title="PaginationRequest">
  `gitpod.v1.PaginationRequest`

  | Field      | Type    | Required | Description                                                                                                                              |
  | ---------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
  | `pageSize` | integer | No       | Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. Constraints: `int32.gte=0, int32.lte=100`. |
  | `token`    | string  | No       | Token for the next set of results that was returned as next\_token of a PaginationResponse                                               |
</Accordion>

<a id="type-gitpod-v1-pagination-response" />

<Accordion title="PaginationResponse">
  `gitpod.v1.PaginationResponse`

  | Field       | Type   | Required | Description                                                                             |
  | ----------- | ------ | -------- | --------------------------------------------------------------------------------------- |
  | `nextToken` | string | No       | Token passed for retrieving the next set of results. Empty if there are no more results |
</Accordion>

<a id="enum-gitpod-v1-notification-type" />

<Accordion title="NotificationType">
  | Value                                                 | Number | Description |
  | ----------------------------------------------------- | -----: | ----------- |
  | `NOTIFICATION_TYPE_UNSPECIFIED`                       |      0 |             |
  | `NOTIFICATION_TYPE_AGENT_COMPLETED`                   |      1 |             |
  | `NOTIFICATION_TYPE_AGENT_WAITING_FOR_INPUT`           |      2 |             |
  | `NOTIFICATION_TYPE_ENVIRONMENT_ARCHIVED`              |      3 |             |
  | `NOTIFICATION_TYPE_ENVIRONMENT_LIFETIME_EXCEEDED`     |      4 |             |
  | `NOTIFICATION_TYPE_BILLING_CREDITS_LOW`               |      5 |             |
  | `NOTIFICATION_TYPE_BILLING_PAYMENT_FAILED`            |      6 |             |
  | `NOTIFICATION_TYPE_BILLING_ACCOUNT_SUSPENDED`         |      7 |             |
  | `NOTIFICATION_TYPE_AUTOMATION_COMPLETED`              |      8 |             |
  | `NOTIFICATION_TYPE_AUTOMATION_STOPPED`                |      9 |             |
  | `NOTIFICATION_TYPE_PREBUILD_FAILED`                   |     10 |             |
  | `NOTIFICATION_TYPE_USER_ADDED_TO_GROUP`               |     11 |             |
  | `NOTIFICATION_TYPE_USER_REMOVED_FROM_GROUP`           |     12 |             |
  | `NOTIFICATION_TYPE_PROJECT_SHARED_WITH_GROUP`         |     13 |             |
  | `NOTIFICATION_TYPE_PROJECT_REMOVED_FROM_GROUP`        |     14 |             |
  | `NOTIFICATION_TYPE_USER_ADDED_TO_TEAM`                |     15 |             |
  | `NOTIFICATION_TYPE_USER_REMOVED_FROM_TEAM`            |     16 |             |
  | `NOTIFICATION_TYPE_TEAM_CREDIT_BUDGET_EXHAUSTED`      |     17 |             |
  | `NOTIFICATION_TYPE_DYNAMIC_LLM_REQUEST_HEADER_FAILED` |     18 |             |
</Accordion>
