[comment]: # translation:outdated

[comment]: # ({97b0e55a-97b0e55a})
# mediatype.update

[comment]: # ({/97b0e55a-97b0e55a})

[comment]: # ({new-4cbfe789})
### Description

`object mediatype.update(object/array mediaTypes)`

This method allows to update existing media types.

::: noteclassic
This method is only available to *Super admin* user type.
Permissions to call the method can be revoked in user role settings. See
[User
roles](/manual/web_interface/frontend_sections/administration/user_roles)
for more information.
:::

[comment]: # ({/new-4cbfe789})

[comment]: # ({new-7db8f4bd})
### Parameters

`(object/array)` Media type properties to be updated.

The `mediatypeid` property must be defined for each media type, all
other properties are optional. Only the passed properties will be
updated, all others will remain unchanged.

Additionally to the [standard media type properties](object#media_type),
the method accepts the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data_types)|Description|
|---------|---------------------------------------------------|-----------|
|parameters|array|[Webhook parameters](object#webhook_parameters) to replace the current webhook parameters.|
|message\_templates|array|[Message templates](object#message_template) to replace the current message templates.|

[comment]: # ({/new-7db8f4bd})

[comment]: # ({665d000d-665d000d})
### Valori di ritorno

`(object)` Restituisce un oggetto contenente gli ID dei tipi di supporto aggiornati
sotto la proprietà `mediatypeids`.

[comment]: # ({/665d000d-665d000d})

[comment]: # ({b41637d2-b41637d2})
### Esempi

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({new-8d3ba0cc})
#### Enabling a media type

Enable a media type, that is, set its status to "0".

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "mediatype.update",
    "params": {
        "mediatypeid": "6",
        "status": "0"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

``` {.java}
{
    "jsonrpc": "2.0",
    "result": {
        "mediatypeids": [
            "6"
        ]
    },
    "id": 1
}
```

[comment]: # ({/new-8d3ba0cc})

[comment]: # ({b9cdc31e-b9cdc31e})
### Fonte

CMediaType::update() in
*ui/include/classes/api/services/CMediaType.php*.

[comment]: # ({/b9cdc31e-b9cdc31e})
