---
title: Get a rule proposal
description: Get the status of a rule proposal started with the start-a-rule-proposal endpoint.
breadcrumbs: Docs > API > Get a rule proposal
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Get a rule proposal

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in Preview and is subject to change.
To request access, contact [Datadog support](https://docs.datadoghq.com/help.md) or your Customer Success Manager.
{% /alert %}

| Datadog site      | API endpoint                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------ |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/security_monitoring/rules/proposals/{proposal_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/security_monitoring/rules/proposals/{proposal_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/security_monitoring/rules/proposals/{proposal_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/security_monitoring/rules/proposals/{proposal_id}      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/security_monitoring/rules/proposals/{proposal_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/security_monitoring/rules/proposals/{proposal_id} |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/security_monitoring/rules/proposals/{proposal_id} |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/security_monitoring/rules/proposals/{proposal_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/security_monitoring/rules/proposals/{proposal_id}  |

### Overview

Get the status of a rule proposal started with the start-a-rule-proposal endpoint.
While the status is `pending` or `in_progress`, the proposed rule is still being
generated. Poll this endpoint again later. If the status is `completed`, the response's `rule` field contains
the proposed Cloud SIEM detection rule. If the status is `failed`, the response's `error` field contains
the reason a rule could not be generated.

This endpoint does not create or modify any detection rules in Cloud SIEM. To create the
proposed rule, use the create-a-detection-rule endpoint.

This endpoint requires the `security_monitoring_rules_read` permission.

OAuth apps require the `security_monitoring_rules_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#security-monitoring) to access this endpoint.

### Arguments

#### Path Parameters

| Field                    | Type   | Description                                                                  |
| ------------------------ | ------ | ---------------------------------------------------------------------------- |
| proposal_id [*required*] | string | The ID of the rule proposal, returned by the start a rule proposal endpoint. |

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Response containing a rule proposal.

| Parent field | Field                   | Type   | Description                                                                                                                                                                                                                                                                                                                                       |
| ------------ | ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object | Data of the rule proposal.                                                                                                                                                                                                                                                                                                                        |
| data         | attributes [*required*] | object | Attributes of the rule proposal.                                                                                                                                                                                                                                                                                                                  |
| attributes   | error                   | object | The reason no rule could be generated. Only present when the status is `failed`.                                                                                                                                                                                                                                                                  |
| error        | kind [*required*]       | string | The kind of failure. - `translation_error`: no rule could be generated from the input. Reword the input or add details, then start a new rule proposal. - `internal_error`: the proposal failed because of an internal error. Start a new rule proposal to try again.                                                                             |
| error        | message                 | string | A human-readable explanation of why no rule could be generated, when available.                                                                                                                                                                                                                                                                   |
| error        | type                    | string | The type of failure within its kind, such as `NoRuleProduced`.                                                                                                                                                                                                                                                                                    |
| attributes   | rule                    | object | The proposed Cloud SIEM detection rule in the same format as the create a detection rule endpoint. It is not saved in Cloud SIEM. Only present when the status is `completed`. Review the rule, then create it with the [create a detection rule](https://docs.datadoghq.com/api/latest/security-monitoring.md#create-a-detection-rule) endpoint. |
| attributes   | status [*required*]     | string | The status of the rule proposal. `pending` and `in_progress` mean the proposed rule is still being generated. Poll the endpoint again later. `completed` and `failed` are final: `completed` proposals contain the proposed rule in `rule`, and `failed` proposals contain the reason in `error`.                                                 |
| data         | id [*required*]         | uuid   | The ID of the rule proposal.                                                                                                                                                                                                                                                                                                                      |
| data         | type [*required*]       | enum   | The rule proposal resource type. The value is always `rule_proposals`. Allowed enum values: `rule_proposals`. Default: `rule_proposals`.                                                                                                                                                                                                          |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "error": {
        "kind": "translation_error",
        "message": "No log source matches the described activity.",
        "type": "NoRuleProduced"
      },
      "rule": {},
      "status": "completed"
    },
    "id": "c968cf83-56c2-4d54-a993-6c86dfb83527",
    "type": "rule_proposals"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="401" %}
Unauthorized

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export proposal_id="c968cf83-56c2-4d54-a993-6c86dfb83527"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/security_monitoring/rules/proposals/${proposal_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}
{% /tabs %}
