---
title: "Create a case view"
method: POST
path: "/api/v2/cases/views"
tags: ["Case Management"]
---

# Create a case view

`POST /api/v2/cases/views`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/cases/views`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `cases_write`

Creates a new saved case view with a name, filter query, and associated project. Optionally, a notification rule can be linked to the view.

## Request body

- CaseViewCreateRequest: Request payload for creating a case view.
  - `data` CaseViewCreate, required: Data object for creating a case view.
    - `attributes` CaseViewCreateAttributes, required: Attributes required to create a case view.
      - `name` string, required: The name of the view.
      - `np_rule_id` string: The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases.
      - `project_id` string, required: The UUID of the project this view belongs to. Views are scoped to a single project.
      - `query` string, required: The query used to filter cases in this view.
    - `type` 'view', required: JSON:API resource type for case views.

## Response `201`

Created

- CaseViewResponse: Response containing a single case view.
  - `data` CaseView, required: A saved case view that provides a filtered, reusable list of cases matching a specific query. Views act as persistent dashboards for monitoring case subsets.
    - `attributes` CaseViewAttributes, required: Attributes of a case view, including the filter query and optional notification rule.
      - `created_at` string, date-time, required: Timestamp when the view was created.
      - `modified_at` string, date-time: Timestamp when the view was last modified.
      - `name` string, required: A human-readable name for the view, displayed in the Case Management UI.
      - `np_rule_id` string: The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases.
      - `query` string, required: The search query that determines which cases appear in this view. Uses the same syntax as the Case Management search bar (for example, `status:open priority:P1`).
    - `id` string, required: The view's identifier.
    - `relationships` CaseViewRelationships: Related resources for the case view, including the creator, last modifier, and associated project.
      - `created_by` NullableUserRelationship, nullable: Relationship to user.
        - `data` NullableUserRelationshipData, nullable, required: Relationship to user object.
          - `id` string, required: A unique identifier that represents the user.
          - `type` 'user', required: User resource type.
      - `modified_by` NullableUserRelationship, nullable: Relationship to user.
        - `data` NullableUserRelationshipData, nullable, required: Relationship to user object.
          - `id` string, required: A unique identifier that represents the user.
          - `type` 'user', required: User resource type.
      - `project` ProjectRelationship: Relationship to project.
        - `data` ProjectRelationshipData, required: Relationship to project object.
          - `id` string, required: A unique identifier that represents the project.
          - `type` 'project', required: Project resource type.
    - `type` 'view', required: JSON:API resource type for case views.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
