Plex.tv - Change Opt-Out Settings
This API request will allow a user to change what settings they will opt-out of for in Plex. Each user will need to set this using their own Plex token.
URL
POST https://plex.tv/api/v2/user/{uuid}/settings/opt_outs?key={opt_out_key}&value={opt_out_value}&X-Plex-Token={plex_token}
Parameters
Name | Description |
---|---|
plex_token | The Plex user token. |
uuid | The UUID associated to the user. This value can be obtained by making a request to the Plex.tv - Get Users endpoint and using the uuid value for the user. |
opt_out_key | The key for the opt out setting. See Remarks for more information on the valid keys. |
opt_out_value | The opt-out value. See Remarks for more information on the valid values. |
Return Status
HTTP Code | Description |
---|---|
200 | Success - The request was successful. |
400 | Bad request. A parameter value was invalid. |
401 | Unauthorized - The Plex token provided was not valid. |
Response
An XML string value is returned that lists the opt-out setting being changed and the new value.
An example of the XML response is shown below:
<?xml version="1.0" encoding="UTF-8"?> <optOuts type="array"> <optOut key="includeSocialProof" value="opt_out"/> </optOuts>
Remarks
There are several opt-out settings that can be changed with this API endpoint. The values that can be used is dependent on the key that is being changed.
Each value of each setting can be at least two of the values from the following table:
Value | Description |
---|---|
opt_in | Enabled |
opt_out | Disabled |
opt_out_managed | Disabled for Managed Accounts |
the table below lists the opt-out keys for the settings along with their valid values.
Key | Valid Values | Description |
---|---|---|
includeAvailabilities | opt_in, opt_out, opt_out_managed | Display availabilities from other streaming services on detail pages. |
includeDiscoverSource | opt_out, opt_out_managed | Discover source. |
includeMetadataInSearch | opt_out, opt_out_managed | Display "More Ways to Watch" search results. |
includeSocialProof | opt_in, opt_out | Display activity from my friends on detail pages. |
tv.plex.provider.epg | opt_in, opt_out, opt_out_managed | Live TV from online media sources. |
tv.plex.provider.vod | opt_in, opt_out, opt_out_managed | Movies & shows from online media sources. |
There are additional opt-out settings, but some are no longer in use, so changing those settings may not have any effect.
Also, if an opt-out setting is misspelled, it will actually add that misspelled setting instead of producing an error. At this time, doing so doesn't seem to have an impact on Plex.
Incorrect value
If an incorrect value is provided for an opt-out key, then a 400 Bad Request
status code. The following XML response is also returned:
<?xml version="1.0" encoding="UTF-8"?> <errors> <error code="1004" message="value does not have a valid value" status="400"/> </errors>
Examples
curl -X POST https://plex.tv/api/v2/user/{uuid}/settings/opt_outs?key={opt_out_key}&value={opt_out_value}&X-Plex-Token={plex_token}
import requests plex_url = https://plex.tv/api/v2/user/{uuid}/settings/opt_outs?key={opt_out_key}&value={opt_out_value}&X-Plex-Token={plex_token} response = requests.post(plex_url) print(response.text)
$response = Invoke-RestMethod "https://plex.tv/api/v2/user/{uuid}/settings/opt_outs?key={opt_out_key}&value={opt_out_value}&X-Plex-Token={plex_token}" -Method POST Write-Output $response