---
title: "Create an inbox rule"
method: POST
path: "/api/v2/security/findings/automation/inbox_rules"
tags: ["Security Monitoring"]
---

# Create an inbox rule

`POST /api/v2/security/findings/automation/inbox_rules`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/security/findings/automation/inbox_rules`
- 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`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/security/findings/automation/inbox_rules/post.ts> (a function with typed inputs; its response is checked against the schema)

Create an inbox rule for the current organization.

## Request body

- InboxRuleCreateRequest: The body of an inbox rule create request.
  - `data` InboxRuleDataCreate, required: The data object for an inbox rule create request.
    - `attributes` InboxRuleAttributesCreate, required: Attributes for creating or updating an inbox rule.
      - `action` InboxRuleAction, required: The action to take when the inbox rule matches a finding.
        - `description` string: An optional description providing more context for the rule.
      - `enabled` boolean: Whether the inbox rule is enabled.
      - `name` string, required: The name of the inbox rule.
      - `rule` AutomationRuleScope, required: Defines the scope of findings to which the automation rule applies.
        - `finding_types` SecurityFindingType[], required: The list of security finding types that the automation rule applies to.
        - `query` string: A search query to further filter the findings matched by this rule. The `@workflow.*` namespace and `@status` fields are not permitted. For a reference of available fields, see the [Security Findings schema documentation](https://docs.datadoghq.com/security/guide/findings-schema/).
    - `type` 'inbox_rules', required: The JSON:API type for inbox rules.

## Response `201`

Successfully created the inbox rule

- InboxRuleResponse: A single inbox rule response.
  - `data` InboxRuleDataResponse, required: The data object for an inbox rule returned by the API.
    - `attributes` InboxRuleAttributesResponse, required: Attributes of an inbox rule returned by the API.
      - `action` InboxRuleAction, required: The action to take when the inbox rule matches a finding.
        - `description` string: An optional description providing more context for the rule.
      - `created_at` integer, required: The Unix timestamp in milliseconds when the rule was created.
      - `created_by` AutomationRuleCreatedBy, required: The user or Datadog system who created the rule.
        - `id` string, required: The actor's identifier (a user UUID or a system identifier).
        - `name` string, required: The name of the actor.
        - `type` 'user' | 'system', required: Whether the actor is a user or the Datadog system.
      - `enabled` boolean, required: Whether the inbox rule is enabled.
      - `modified_at` integer, required: The Unix timestamp in milliseconds when the rule was last modified.
      - `modified_by` AutomationRuleModifiedBy, required: The user or Datadog system who last modified the rule.
        - `id` string, required: The actor's identifier (a user UUID or a system identifier).
        - `name` string, required: The name of the actor.
        - `type` 'user' | 'system', required: Whether the actor is a user or the Datadog system.
      - `name` string, required: The name of the inbox rule.
      - `rule` AutomationRuleScope, required: Defines the scope of findings to which the automation rule applies.
        - `finding_types` SecurityFindingType[], required: The list of security finding types that the automation rule applies to.
        - `query` string: A search query to further filter the findings matched by this rule. The `@workflow.*` namespace and `@status` fields are not permitted. For a reference of available fields, see the [Security Findings schema documentation](https://docs.datadoghq.com/security/guide/findings-schema/).
    - `id` string, uuid, required: The ID of the inbox rule.
    - `type` 'inbox_rules', required: The JSON:API type for inbox rules.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `422`: Unprocessable Entity
- `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/3f70db624329?raw)
