# ThreatMatch

- [JSON representation](https://developers.google.com/safe-browsing/reference/rest/v4/ThreatMatch#SCHEMA_REPRESENTATION)
- [ThreatEntryMetadata](https://developers.google.com/safe-browsing/reference/rest/v4/ThreatMatch#ThreatEntryMetadata)
  - [JSON representation](https://developers.google.com/safe-browsing/reference/rest/v4/ThreatMatch#ThreatEntryMetadata.SCHEMA_REPRESENTATION)
- [MetadataEntry](https://developers.google.com/safe-browsing/reference/rest/v4/ThreatMatch#MetadataEntry)
  - [JSON representation](https://developers.google.com/safe-browsing/reference/rest/v4/ThreatMatch#MetadataEntry.SCHEMA_REPRESENTATION)

A match when checking a threat entry in the Safe Browsing threat lists.

| JSON representation |
|---|
| ``` { "threatType": enum (`https://developers.google.com/safe-browsing/reference/rest/v4/ThreatType`), "platformType": enum (`https://developers.google.com/safe-browsing/reference/rest/v4/PlatformType`), "threatEntryType": enum (`https://developers.google.com/safe-browsing/reference/rest/v4/ThreatEntryType`), "threat": { object (`https://developers.google.com/safe-browsing/reference/rest/v4/ThreatEntry`) }, "threatEntryMetadata": { object (`https://developers.google.com/safe-browsing/reference/rest/v4/ThreatMatch#ThreatEntryMetadata`) }, "cacheDuration": string } ``` |

| Fields ||
|---|---|
| `threatType` | ``enum (`https://developers.google.com/safe-browsing/reference/rest/v4/ThreatType`)`` The threat type matching this threat. |
| `platformType` | ``enum (`https://developers.google.com/safe-browsing/reference/rest/v4/PlatformType`)`` The platform type matching this threat. |
| `threatEntryType` | ``enum (`https://developers.google.com/safe-browsing/reference/rest/v4/ThreatEntryType`)`` The threat entry type matching this threat. |
| `threat` | ``object (`https://developers.google.com/safe-browsing/reference/rest/v4/ThreatEntry`)`` The threat matching this threat. |
| `threatEntryMetadata` | ``object (`https://developers.google.com/safe-browsing/reference/rest/v4/ThreatMatch#ThreatEntryMetadata`)`` Optional metadata associated with this threat. |
| `cacheDuration` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` The cache lifetime for the returned match. Clients must not cache this response for more than this duration to avoid false positives. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |

## ThreatEntryMetadata

The metadata associated with a specific threat entry. The client is expected to know the metadata key/value pairs associated with each threat type.

| JSON representation |
|---|
| ``` { "entries": [ { object (`https://developers.google.com/safe-browsing/reference/rest/v4/ThreatMatch#MetadataEntry`) } ] } ``` |

| Fields ||
|---|---|
| `entries[]` | ``object (`https://developers.google.com/safe-browsing/reference/rest/v4/ThreatMatch#MetadataEntry`)`` The metadata entries. |

## MetadataEntry

A single metadata entry.

| JSON representation |
|---|
| ``` { "key": string, "value": string } ``` |

| Fields ||
|---|---|
| `key` | `string (https://developers.google.com/discovery/v1/type-format format)` The metadata entry key. For JSON requests, the key is base64-encoded. A base64-encoded string. |
| `value` | `string (https://developers.google.com/discovery/v1/type-format format)` The metadata entry value. For JSON requests, the value is base64-encoded. A base64-encoded string. |