---
title: "Gets kubernetes events for namespace"
method: GET
path: "/kubernetes/{id}/namespaces/{namespace}/events"
tags: ["kubernetes"]
---

# Gets kubernetes events for namespace

`GET /kubernetes/{id}/namespaces/{namespace}/events`

Get events by optional query param resourceId for a given namespace.
**Access policy**: Authenticated user.

## Path parameters

- `id` integer, required
- `namespace` string, required

## Query parameters

- `resourceId` string

## Response `200`

Success

- KubernetesK8sEvent[]
  - `count` integer
  - `eventTime` string
  - `firstTimestamp` string
  - `involvedObject` KubernetesK8sEventInvolvedObject
    - `kind` string
    - `name` string
    - `namespace` string
    - `uid` string
  - `kind` string
  - `lastTimestamp` string
  - `message` string
  - `name` string
  - `namespace` string
  - `reason` string
  - `type` string
  - `uid` string

## Other responses

- `400` — Invalid request payload, such as missing required fields or fields not meeting validation criteria.
- `401` — Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions.
- `403` — Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions.
- `500` — Server error occurred while attempting to retrieve the events within the specified namespace.

---

[API](https://skmtc.net/portainer/apis/portainerce-api.md) · [All operations](https://skmtc.net/portainer/apis/portainerce-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portainer/portainerce-api/versions/c0b0975cd11b/schema)
