> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/safebrowsing/doc/en/llms.txt

# Update. Update local Safe Browsing database

The request returns a partial or full update for the local [Safe Browsing](https://yandex.com/dev/safebrowsing/doc/en/concepts/safebrowsing-lists.md#sb-lists) database. You can get updates for one or more lists depending on the [parameters](#listUpdateRequests) you set.


## Request format {#request-format}

```
POST https://sba.yandex.net/v4/threatListUpdates:fetch
  ? [key](*key)=<API key>
```

#|
||
##key##[*](*requiredParam)
|

[API key](https://yandex.com/dev/safebrowsing/doc/en/concepts/restricts.md) value.

||
|#

\* Required


### Request body {#request-body}

```json
{ 
  "[client](*client)": {
  "[clientId](*clientId)": "{string}",
  "[clientVersion](*clientVersion)": "{string}"
  },
  "[listUpdateRequests](*listUpdateRequests)": [
    {
      "[threatType](*threatType)": "{еnum}",
      "[platformType](*platformType)": "{еnum}",
      "[threatEntryType](*threatEntryType)": "{еnum}",
      "[state](*state)": "{string}",
      "[constraints](*constraints)": {
        "[supportedCompressions](*supportedCompressions)": ["{enum}"]
      }
    }
  ]
}        
```

{% include notitle [client](../_includes/params.md#client) %}

##### {#listUpdateRequests}

{% include notitle [listUpdateRequests](../_includes/params.md#listUpdateRequests) %}

 
:   {% include notitle [threatType](../_includes/params.md#threatType) %}

    {% include notitle [platformType](../_includes/params.md#platformType) %}
    
    {% include notitle [threatEntryType](../_includes/params.md#threatEntryType) %}

    ##### {#state}
    
    {% include notitle [state](../_includes/params.md#state) %}
    
    {% include notitle [constraints](../_includes/params.md#constraints) %}
    

     
    :   {% include notitle [supportedCompressions](../_includes/params.md#supportedCompressions) %}

\* Required

{% include [request-format-response-format](../_includes/concepts/safebrowsing-lists/id-request-format/response-format.md) %}


## Response format {#response-body}

```json
{
  "[listUpdateResponses](*listUpdateResponses)": [
    {
      "[threatType](*threatType)": "{еnum}",
      "[threatEntryType](*threatEntryType)": "{еnum}",
      "[platformType](*platformType)": "{еnum}",
      "[responseType](*responseType)" : "{еnum}",
      "[additions](*additions)": [
        {
          "[compressionType](*compressionType)": "{еnum}",
          "[rawHashes](*rawHashes)": {
            "[prefixSize](*prefixSize)": "{number}",
            "[rawHashes](*rawHashes)": "{string}"
          },
          "[riceHashes](*riceHashes)": {
            "[firstValue](*firstValue)": "{string}",
            "[riceParameter](*riceParameter)": "{number}",
            "[numEntries](*numEntries)": "{number}",
            "[encodedData](*encodedData)": "{string}"
          } 
        }
      ],
      "[removals](*removals)": [
        { 
          "[compressionType](*compressionType)": "{еnum}",
          "[rawIndices](*rawIndices)": {
            "[indices](*indices)": [
              "{number}"
            ] 
          },
          "[riceIndices](*riceIndices)": {
            "[firstValue](*firstValue)": "{string}",
            "[riceParameter](*riceParameter)": "{number}",
            "[numEntries](*numEntries)": "{number}",
            "[encodedData](*encodedData)": "{string}"
          }
        }
      ],
      "[newClientState](*newClientState)": "{string}",
      "[checksum](*checksum)": {
        "[sha256](*sha256)": "{string}"
      }     
    }
  ],
  "[minimumWaitDuration](*minimumWaitDuration)": "{string}"
}
```
{% include notitle [listUpdateResponses](../_includes/params.md#listUpdateResponses) %}

 
:   {% include notitle [threatType](../_includes/params.md#threatType) %}

    {% include notitle [threatEntryType](../_includes/params.md#threatEntryType) %}
    
    {% include notitle [platformType](../_includes/params.md#platformType) %}
    
    ##### {#responseType}

    {% include notitle [responseType](../_includes/params.md#responseType) %}
    
    ##### {#additions}
    
    {% include notitle [additions](../_includes/params.md#additions) %}
    
      
    :   {% include notitle [compressionType](../_includes/params.md#compressionType) %}
        
        {% include notitle [rawHashes](../_includes/params.md#rawHashes) %}

         
        :   {% include notitle [prefixSize](../_includes/params.md#prefixSize) %}
            
            #|
            ||
            ##rawHashes##
            |
            [Base64](https://en.wikipedia.org/wiki/Base64)-encoded hashes. They are concatenated to a single string in lexicographical order.
            ||
            |#

        {% include notitle [riceHashes](../_includes/params.md#riceHashes) %}

         
        :   {% include notitle [firstValue](../_includes/params.md#firstValue) %}

            {% include notitle [riceParameter](../_includes/params.md#riceParameter) %}

            {% include notitle [numEntries](../_includes/params.md#numEntries) %}

            {% include notitle [encodedData](../_includes/params.md#encodedData) %}

        {% include notitle [removals](../_includes/params.md#removals) %}

         
        :   {% include notitle [compressionType](../_includes/params.md#compressionType) %}

            {% include notitle [rawIndices](../_includes/params.md#rawIndices) %}

             
            :   {% include notitle [indices](../_includes/params.md#indices) %}
            
            {% include notitle [riceIndices](../_includes/params.md#riceIndices) %}

             
            :   {% include notitle [firstValue](../_includes/params.md#firstValue) %}

                {% include notitle [riceParameter](../_includes/params.md#riceParameter) %}

                {% include notitle [numEntries](../_includes/params.md#numEntries) %}

                {% include notitle [encodedData](../_includes/params.md#encodedData) %}            
        
        {#newClientState}
        
        #|
        ||
        ##newClientState##
        |
        
        The status of the local Safe Browsing list after the update (base64-encoded). The value is used in the request parameters:
        - [Update. Updating the local database of SB lists](../concepts/update-threatlist.md): The [state](*state_2) parameter.
        - [Update. Hash-based check](../concepts/update-fullhashes-find.md): The [clientStates](*clientStates) parameter.
        
        ||
        |#
        
        {% include notitle [checksum](../_includes/params.md#checksum) %}         
        

         
        :   {% include notitle [sha256](../_includes/params.md#sha256) %}
        
        ##### {#minimumWaitDuration}


#|
||
##minimumWaitDuration##
|

The minimum time in seconds before sending the next request for a Safe Browsing list update. Specified in the format `"minimumWaitDuration": "<time>s"`. Up to nine decimal digits are supported.

||
|# 

\* Required

## Example {#example}

Request URL:

```
https://sba.yandex.net/v4/threatListUpdates:fetch?key=2f8...8ea
```

Request body:

```json
{
  "[client](*client)": {
    "[clientId](*clientId)": "client_name",
    "[clientVersion](*clientVersion)": "1.1.1"
  },
  "[listUpdateRequests](*listUpdateRequests)": [
    {
      "[threatType](*threatType)": "MALWARE",
      "[platformType](*platformType)": "ANY_PLATFORM",
      "[threatEntryType](*threatEntryType)": "URL",
      "[state](*state)": "",
      "[constraints](*constraints)": {
        "[supportedCompressions](*supportedCompressions)": ["RAW"]
      }
    }
  ]
}
```

Response:

```json
{
  "[listUpdateResponses](*listUpdateResponses)": [
    {
      "[responseType](*responseType)": "FULL_UPDATE",
      "[threatType](*threatType)": "MALWARE",
      "[newClientState](*newClientState)": "NjU3OTRhNzM2MTU4NGU...NTk2ZTZiN=",
      "[checksum](*checksum)": {
        "[sha256](*sha256)": "cJtIDwizkuJigkPe+uax+1ZYAXI6zP/2NH60/bjp6oY="
      },
      "[threatEntryType](*threatEntryType)": "URL",
      "[additions](*additions)": [
        {
          "[compressionType](*compressionType)": "RAW",
          "[rawHashes](*rawHashes)": {
            "[prefixSize](*prefixSize)": 8,
            "[rawHashes](*rawHashes)": "BpxeY80IjdgMk9zDOTrDdA8tAP...uDTeqvchw=="
          }
        },
        {
          "[compressionType](*compressionType)": "RAW",
          "[rawHashes](*rawHashes)": {
            "[prefixSize](*prefixSize)": 4,
            "[rawHashes](*rawHashes)": "AAAbtwAAKNYAAD1lAAD7RgABjYMAA...F4ledReTNRUXliXg=="
          }
        },
        {
          "[compressionType](*compressionType)": "RAW",
          "[rawHashes](*rawHashes)": {
            "[prefixSize](*prefixSize)": 7,
            "[rawHashes](*rawHashes)": "BUI8ZWf1VQWf2ulg27kKW7JaaHHsD7UhE5sBzBit7mQ977U1wQBFu00wTXuBOf1OHQ=="
          }
        }
      ],
      "[platformType](*platformType)": "ANY_PLATFORM"
    }
  ],
  "[minimumWaitDuration](*minimumWaitDuration)": "300.00s"
}
```
{% include notitle [table-style-none.md](../_includes/table-style-none.md) %}

[*key]: [API key](https://yandex.com/dev/safebrowsing/doc/en/concepts/restricts.md) value.

[*requiredParam]: \* Required

[*client]:
    {% include notitle [client](../_includes/popups.md#client) %}

[*clientId]:
    {% include notitle [clientId](../_includes/popups.md#clientId) %}

[*clientVersion]:
    {% include notitle [clientVersion](../_includes/popups.md#clientVersion) %}

[*threatType]:
    {% include notitle [threatType](../_includes/popups.md#threatType) %}

[*platformType]:
    {% include notitle [platformType](../_includes/popups.md#platformType) %}

[*threatEntryType]:
    {% include notitle [threatEntryType](../_includes/popups.md#threatEntryType) %}

[*responseType]:
    {% include notitle [responseType](../_includes/popups.md#responseType) %}

[*additions]:
    {% include notitle [additions](../_includes/popups.md#additions) %}

[*constraints]:
    {% include notitle [constraints](../_includes/popups.md#constraints) %}

[*supportedCompressions]:
    {% include notitle [supportedCompressions](../_includes/popups.md#supportedCompressions) %}

[*compressionType]:
    {% include notitle [compressionType](../_includes/popups.md#compressionType) %}

[*rawHashes]:
    {% include notitle [rawHashes](../_includes/popups.md#rawHashes) %}

[*prefixSize]:
    {% include notitle [prefixSize](../_includes/popups.md#prefixSize) %}

[*rawHashes]:
    {% include notitle [rawHashes](../_includes/popups.md#rawHashes) %}

[*riceHashes]:
    {% include notitle [riceHashes](../_includes/popups.md#riceHashes) %}

[*firstValue]:
    {% include notitle [firstValue](../_includes/popups.md#firstValue) %}

[*riceParameter]:
    {% include notitle [riceParameter](../_includes/popups.md#riceParameter) %}

[*numEntries]:
    {% include notitle [numEntries](../_includes/popups.md#numEntries) %}

[*encodedData]:
    {% include notitle [encodedData](../_includes/popups.md#encodedData) %}

[*removals]:
    {% include notitle [removals](../_includes/popups.md#removals) %}

[*compressionType]:
    {% include notitle [compressionType](../_includes/popups.md#compressionType) %}

[*rawIndices]:
    {% include notitle [rawIndices](../_includes/popups.md#rawIndices) %}

[*indices]:
    {% include notitle [indices](../_includes/popups.md#indices) %}

[*riceIndices]:
    {% include notitle [riceIndices](../_includes/popups.md#riceIndices) %}

[*newClientState]:
    {% include notitle [newClientState](../_includes/popups.md#newClientState) %}

[*checksum]:
    {% include notitle [checksum](../_includes/popups.md#checksum) %}

[*sha256]:
    {% include notitle [sha256](../_includes/popups.md#sha256) %}

[*minimumWaitDuration]:
    {% include notitle [minimumWaitDuration](../_includes/popups.md#minimumWaitDuration) %}

[*listUpdateRequests]:
    {% include notitle [listUpdateRequests](../_includes/popups.md#listUpdateRequests) %}

[*listUpdateResponses]:
    {% include notitle [listUpdateResponses](../_includes/popups.md#listUpdateResponses) %}

[*minimumWaitDuration]:
    {% include notitle [minimumWaitDuration](../_includes/popups.md#minimumWaitDuration) %}

[*state]:
The current status of the Safe Browsing list. It corresponds to the value of the [newClientState](#newClientState) parameter obtained on the latest successful list update.
 
ЕIf this parameter is omitted, the query completely replaces the current list with a new one.

[*state_2]:
The current status of the Safe Browsing list. It corresponds to the value of the [newClientState](#newClientState) parameter obtained on the latest successful list update

[*clientStates]:
Safe Browsing list statuses at the time of the last update. Array of objects.
