Method: projects.locations.contentPolicies.create

Create a ContentPolicy.

HTTP request


POST https://dlp.googleapis.com/v2/{parent=projects/*/locations/*}/contentPolicies

The URLs use gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project):

  • Projects scope: projects/{projectId}/locations/{locationId}

Authorization requires the following IAM permission on the specified resource parent:

  • dlp.contentPolicies.create

Request body

The request body contains data with the following structure:

JSON representation
{
  "contentPolicy": {
    object (ContentPolicy)
  },
  "contentPolicyId": string
}
Fields
contentPolicy

object (ContentPolicy)

Required. The contentPolicy resource.

contentPolicyId

string

Optional. The content policy ID can contain uppercase and lowercase letters, numbers, and hyphens; that is, it must match the regular expression: [a-zA-Z\d-_]+. The maximum length is 100 characters. If empty, the system will generate a random id.

Response body

If successful, the response body contains a newly created instance of ContentPolicy.

Authorization scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.