# Update File Malware Scanner State

Implemented by Symphony, the API is exposed on the customer's pod. The malware-scanning service should use this API to update the malware scanning state of a given file on the pod. The calling service account should have 'Malware Scan State User' role to make this call.

Allowed values: `OK`, `BAD`, `UNSCANNABLE`, `SCAN_ERROR` and `EXPIRED`.

* `OK` - Malware Scan state is ok. The file can be downloaded.
* `BAD` - Malware Scan determined the file to be bad. The file cannot be downloaded.
* `UNSCANNABLE` - Malware Scan cannot be done for the file. The file will not be downloadable. Symphony will treat this equivalent to the '`BAD`' state.
* `EXPIRED` - Malware Scan state is too old to be used any more. The file will not be downloadable. The customers can use this state to prevent further downloads of the file. As of now, Symphony doesn't support the TTL functionality. Therefore, Symphony will not be changing an existing '`OK`' state to '`EXPIRED`'.

## Updates the file malware scan state on the pod.

<mark style="color:orange;">`PUT`</mark> `https://your-pod-subdomain.symphony.com/maestro/api/v1​/attachments​/malware-scan​/state`

Implemented by Symphony, the API is exposed on the customer's pod. The malware-scanning service should use this API to update the malware scanning state of a given file on the pod. The calling service account should have 'Malware Scan State User' role to make this call. Allowed values: OK, BAD, UNSCANNABLE, SCAN\_ERROR and EXPIRED.

OK - Malware Scan state is ok. The file can be downloaded. BAD - Malware Scan determined the file to be bad. The file cannot be downloaded. UNSCANNABLE - Malware Scan cannot be done for the file. The file will not be downloadable. Symphony will treat this equivalent to the 'BAD' state. EXPIRED - Malware Scan state is too old to be used any more. The file will not be downloadable. The customers can use this state to prevent further downloads of the file. As of now, Symphony doesn't support the TTL functionality. Therefore, Symphony will not be changing an existing 'OK' state to 'EXPIRED'.

#### Query Parameters

| Name                                     | Type   | Description                                                                          |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| fileId<mark style="color:red;">\*</mark> | string | Id of the file whose malware scan state should be updated. It should be URL encoded. |

#### Headers

| Name                                           | Type   | Description                                                                                                                                                           |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sessionToken<mark style="color:red;">\*</mark> | string | Authentication session token.                                                                                                                                         |
| X-Trace-Id                                     | string | Trace ID that shall be returned back in header when updating the malware scan state for the file. This field is not required, being used for debugging purposes only. |

#### Request Body

| Name   | Type   | Description                                                                                                                                       |
| ------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| status | string | Contains the result of scanning and some additional information. Accepted values: OK, BAD, UNSCANNABLE, SCAN\_ERROR and EXPIRED.                  |
| status | int32  | TTL timestamp in epoch seconds. After that point in time file shall be re-scanned in case of download attempt. This has not been implemented yet. |

{% tabs %}
{% tab title="204: No Content Result" %}

```javascript
//Successfully posted, see response body for further information.
```

{% endtab %}

{% tab title="400: Bad Request Result" %}

```javascript
//Bad request, see response body for further details.
```

{% endtab %}

{% tab title="500: Internal Server Error Result" %}

```javascript
//An error occurred while updating a file. See response body for further details.
```

{% endtab %}
{% endtabs %}
