- [HTTP request](https://docs.cloud.google.com/model-armor/reference/rest/v1/projects.locations.templates/sanitizeUserPrompt#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/model-armor/reference/rest/v1/projects.locations.templates/sanitizeUserPrompt#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/model-armor/reference/rest/v1/projects.locations.templates/sanitizeUserPrompt#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/model-armor/reference/rest/v1/projects.locations.templates/sanitizeUserPrompt#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/model-armor/reference/rest/v1/projects.locations.templates/sanitizeUserPrompt#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/model-armor/reference/rest/v1/projects.locations.templates/sanitizeUserPrompt#body.SanitizeUserPromptResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/model-armor/reference/rest/v1/projects.locations.templates/sanitizeUserPrompt#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/model-armor/reference/rest/v1/projects.locations.templates/sanitizeUserPrompt#body.aspect_1)

Sanitizes User Prompt.

### HTTP request

`POST https://modelarmor.googleapis.com/v1/{name=projects/*/locations/*/templates/*}:sanitizeUserPrompt`

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. Represents resource name of template e.g. name=projects/sample-project/locations/us-central1/templates/templ01 |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "userPromptData": { object (`https://docs.cloud.google.com/model-armor/reference/rest/v1/DataItem`) }, "multiLanguageDetectionMetadata": { object (`https://docs.cloud.google.com/model-armor/reference/rest/v1/MultiLanguageDetectionMetadata`) }, "streamingMode": enum (`https://docs.cloud.google.com/model-armor/reference/rest/v1/StreamingMode`) } ``` |

| Fields ||
|---|---|
| `userPromptData` | ``object (`https://docs.cloud.google.com/model-armor/reference/rest/v1/DataItem`)`` Required. User prompt data to sanitize. |
| `multiLanguageDetectionMetadata` | ``object (`https://docs.cloud.google.com/model-armor/reference/rest/v1/MultiLanguageDetectionMetadata`)`` Optional. Metadata related to Multi Language Detection. |
| `streamingMode` | ``enum (`https://docs.cloud.google.com/model-armor/reference/rest/v1/StreamingMode`)`` Optional. Streaming Mode for StreamSanitize\* API. |

### Response body

Sanitized User Prompt Response.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "sanitizationResult": { object (`https://docs.cloud.google.com/model-armor/reference/rest/v1/SanitizationResult`) } } ``` |

| Fields ||
|---|---|
| `sanitizationResult` | ``object (`https://docs.cloud.google.com/model-armor/reference/rest/v1/SanitizationResult`)`` Output only. Sanitization Result. |

### 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 `name` resource:

- `modelarmor.templates.useToSanitizeUserPrompt`

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