# Method: projects.locations.dnsThreatDetectors.create

Creates a new DnsThreatDetector in a given project and location.

### HTTP request

`POST https://networksecurity.googleapis.com/v1/{parent=projects/*/locations/*}/dnsThreatDetectors`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The value for the parent of the DnsThreatDetector resource. |

### Query parameters

| Parameters ||
|---|---|
| `dnsThreatDetectorId` | `string` Optional. The ID of the requesting DnsThreatDetector object. If this field is not supplied, the service generates an identifier. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/dns/docs/reference/dns-armor/rest/v1/projects.locations.dnsThreatDetectors#DnsThreatDetector`.

### Response body

If successful, the response body contains a newly created instance of `https://docs.cloud.google.com/dns/docs/reference/dns-armor/rest/v1/projects.locations.dnsThreatDetectors#DnsThreatDetector`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:

- `networksecurity.dnsThreatDetectors.create`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).