---
title: Create a batch migration
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Security Monitoring
---

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

# Create a batch migration{% #create-a-batch-migration %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview and is subject to change. To request access, contact [Datadog support](https://docs.datadoghq.com/help/) or your Customer Success Manager.
| Datadog site      | API endpoint                                                                   |
| ----------------- | ------------------------------------------------------------------------------ |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/security_monitoring/batch-migrations |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/security_monitoring/batch-migrations |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/security_monitoring/batch-migrations      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/security_monitoring/batch-migrations      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/security_monitoring/batch-migrations  |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/security_monitoring/batch-migrations |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/security_monitoring/batch-migrations     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/security_monitoring/batch-migrations |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/security_monitoring/batch-migrations |

### Overview

Create a batch migration in the `draft` status, together with 1 to 100 initial resources. Each resource holds one source rule to translate into a Cloud SIEM detection rule. To load more rules, add them with the add resources endpoint before starting the batch migration. A batch migration can hold up to 1000 resources. The response does not include the created resources: list the resources of the batch migration to retrieve them. This endpoint requires the `security_monitoring_rules_write` permission.

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



### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                        | Type     | Description                                                                                                                                                                                                                                                                                                              |
| ------------ | ---------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|              | data [*required*]       | object   | Data of the batch migration to create.                                                                                                                                                                                                                                                                                   |
| data         | attributes [*required*] | object   | Attributes of the batch migration to create.                                                                                                                                                                                                                                                                             |
| attributes   | description                  | string   | The description of the batch migration.                                                                                                                                                                                                                                                                                  |
| attributes   | name                         | string   | The name of the batch migration.                                                                                                                                                                                                                                                                                         |
| attributes   | resources [*required*]  | [object] | The initial resources of the batch migration. From 1 to 100 resources.                                                                                                                                                                                                                                                   |
| resources    | description                  | string   | The description of the resource.                                                                                                                                                                                                                                                                                         |
| resources    | input [*required*]      | string   | The source query or natural language description to translate. Must not be blank.                                                                                                                                                                                                                                        |
| resources    | inputType [*required*]  | enum     | The type of the source rule: `spl` for a Splunk SPL search or saved search definition, `natural_language` for a plain-English description of the behavior to detect, or `kql` for a Microsoft KQL query. SPL inputs must be self-contained, with search macros expanded. Allowed enum values: `natural_language,spl,kql` |
| resources    | name                         | string   | The name of the resource.                                                                                                                                                                                                                                                                                                |
| attributes   | tags                         | [string] | Tags of the batch migration. Up to 50 tags, each up to 256 characters.                                                                                                                                                                                                                                                   |
| data         | type [*required*]       | enum     | The type of resource for a batch migration. Allowed enum values: `batchMigration`                                                                                                                                                                                                                                        |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "type": "batchMigration",
    "attributes": {
      "name": "Example-Security-Monitoring",
      "description": "Rules imported from Splunk",
      "tags": [
        "source:splunk"
      ],
      "resources": [
        {
          "name": "Repeated Windows login failures",
          "description": "Detects repeated failed Windows authentication attempts.",
          "inputType": "spl",
          "input": "index=wineventlog EventCode=4625"
        }
      ]
    }
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response containing a batch migration.

| Parent field         | Field                                  | Type      | Description                                                                                                                                                                                                                                                                           |
| -------------------- | -------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                      | data [*required*]                 | object    | A batch migration.                                                                                                                                                                                                                                                                    |
| data                 | attributes [*required*]           | object    | Attributes of a batch migration.                                                                                                                                                                                                                                                      |
| attributes           | createdAt [*required*]            | date-time | The creation date of the batch migration, in RFC 3339 format.                                                                                                                                                                                                                         |
| attributes           | createdBy                              | string    | The UUID of the user or service account who created the batch migration.                                                                                                                                                                                                              |
| attributes           | description                            | string    | The description of the batch migration.                                                                                                                                                                                                                                               |
| attributes           | inputSource [*required*]          | enum      | The origin of a batch migration. Always `batch_migration` for batch migrations created through this API. Allowed enum values: `batch_migration,threat_hunting,user`                                                                                                                   |
| attributes           | lastUpdatedAt [*required*]        | date-time | The last update date of the batch migration, in RFC 3339 format.                                                                                                                                                                                                                      |
| attributes           | lastUpdatedBy                          | string    | The UUID of the user or service account who last updated the batch migration, or the name of a system actor.                                                                                                                                                                          |
| attributes           | name [*required*]                 | string    | The name of the batch migration.                                                                                                                                                                                                                                                      |
| attributes           | orgId [*required*]                | int64     | The ID of the organization that owns the batch migration.                                                                                                                                                                                                                             |
| attributes           | resourceStatusCounts [*required*] | object    | The number of resources of a batch migration in each status.                                                                                                                                                                                                                          |
| resourceStatusCounts | canceled [*required*]             | int64     | Number of resources whose translation was canceled.                                                                                                                                                                                                                                   |
| resourceStatusCounts | completed [*required*]            | int64     | Number of resources translated and ready to be published.                                                                                                                                                                                                                             |
| resourceStatusCounts | duplicate [*required*]            | int64     | Number of resources identified as duplicates of an existing rule. Reserved for future use.                                                                                                                                                                                            |
| resourceStatusCounts | failed [*required*]               | int64     | Number of resources whose translation failed.                                                                                                                                                                                                                                         |
| resourceStatusCounts | inProgress [*required*]           | int64     | Number of resources being translated.                                                                                                                                                                                                                                                 |
| resourceStatusCounts | pending [*required*]              | int64     | Number of resources waiting to be translated.                                                                                                                                                                                                                                         |
| resourceStatusCounts | published [*required*]            | int64     | Number of resources published as Cloud SIEM detection rules.                                                                                                                                                                                                                          |
| resourceStatusCounts | publishing [*required*]           | int64     | Number of resources being published.                                                                                                                                                                                                                                                  |
| attributes           | status [*required*]               | enum      | The status of a batch migration. A batch migration is created as `draft` and moves to `in_progress` when started. It moves to `completed` once no resource is `pending` or `in_progress`, or to `canceled` when canceled. Allowed enum values: `draft,in_progress,canceled,completed` |
| attributes           | tags [*required*]                 | [string]  | Tags of the batch migration. Up to 50 tags, each up to 256 characters.                                                                                                                                                                                                                |
| data                 | id [*required*]                   | uuid      | The UUID of the batch migration.                                                                                                                                                                                                                                                      |
| data                 | type [*required*]                 | enum      | The type of resource for a batch migration. Allowed enum values: `batchMigration`                                                                                                                                                                                                     |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "createdAt": "2026-09-21T12:00:00Z",
      "createdBy": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
      "description": "Rules imported from Splunk",
      "inputSource": "batch_migration",
      "lastUpdatedAt": "2026-09-21T12:00:00Z",
      "lastUpdatedBy": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
      "name": "Splunk migration",
      "orgId": 123456,
      "resourceStatusCounts": {
        "canceled": 0,
        "completed": 0,
        "duplicate": 0,
        "failed": 0,
        "inProgress": 0,
        "pending": 1,
        "published": 0,
        "publishing": 0
      },
      "status": "draft",
      "tags": [
        "source:splunk"
      ]
    },
    "id": "7cdb3a75-64fb-46ce-9445-41969e78fe8e",
    "type": "batchMigration"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| 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 title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="401" %}
Unauthorized
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| 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 title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| 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 title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                          \## default
# 
 \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/security_monitoring/batch-migrations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Rules imported from Splunk",
      "name": "Splunk migration",
      "resources": [
        {
          "description": "Detects repeated failed Windows authentication attempts.",
          "input": "index=wineventlog EventCode=4625",
          "inputType": "spl",
          "name": "Repeated Windows login failures"
        },
        {
          "input": "Alert when PowerShell is launched with a command line that downloads and executes a remote script, such as IEX with Net.WebClient or Invoke-WebRequest.",
          "inputType": "natural_language",
          "name": "Suspicious PowerShell download cradle"
        }
      ],
      "tags": [
        "source:splunk"
      ]
    },
    "type": "batchMigration"
  }
}
EOF 

                        
{% /tab %}
