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

# Get Notification

> Returns a single notification by ID.

`Unary` · [`Notifications`](https://ona.com/docs/api-reference/generated/notification/overview)

Returns a single notification by ID.

### Examples

* Get notification:

  ```yaml theme={null}
  notificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
  ```

## Endpoint

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

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

## Request example

```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/GetNotification" \
  --header "Authorization: Bearer $ONA_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "notificationId": "<notification-id>"
}'
```

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

ona = create_client_from_env()
request = notification_pb2.GetNotificationRequest(
    notification_id="<notification-id>",
)
response = ona.services.notification.get_notification(request)
print(response)
```

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

async function main() {
  const ona = createClientFromEnv();
  const request = create(GetNotificationRequestSchema, {
    notificationId: "<notification-id>",
  });
  const response = await ona.services.notification.getNotification(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.GetNotificationRequest{
		NotificationId: "<notification-id>",
	})
	response, err := ona.Services.Notification.GetNotification(context.Background(), request)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(response.Msg)
}
```

```json Request body theme={null}
{
  "notificationId": "<notification-id>"
}
```

## Request

`gitpod.v1.GetNotificationRequest`

| Field | Type | Required | Description |
| - | - | - | - |
| `notificationId` | string | Yes | Constraints: `required=true, string.uuid=true`. |

## Response

`gitpod.v1.GetNotificationResponse`

| Field | Type | Required | Description |
| - | - | - | - |
| `notification` | [Notification](#type-gitpod-v1-notification) | Yes | Constraints: `required=true`. |

## Related types

> [accordion] 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] 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] 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 | |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.