Update a subscription
This endpoint allows clients to update information about a subscription. The client MAY update the following information:
- The podcast’s GUID
- The podcast’s feed URL
- An update to the subscription status for the user
This endpoint returns the following information:
Field | Type | Required? | Description |
---|---|---|---|
new_feed_url | String | No | The URL of the podcast RSS feed. Only returned if the feed_url field was updated by the request |
is_subscribed | Boolean | No | Whether the user is subscribed to the podcast or not. Only returned if the is_subscribed field was updated by the request |
subscription_changed | Datetime | No | The date on which the is_subscribed or feed_url field was last updated. Presented in ISO 8601 format. Only returned if the is_subscribed field was updated by the request |
guid_changed | Datetime | No | The date on which the podcast’s GUID was last updated. Presented in ISO 8601 format. Only returned if the guid field was updated by the request |
new_guid | String<UUID> | No | The new GUID associated with the podcast. Only returned if the guid field was updated by the request |
Parameters
The client MUST pass the subscription GUID in the query path and add at least one field update in the request body.
Parameter | Type | In | Required? | Description |
---|---|---|---|---|
guid | String | Query | Yes | The GUID of the subscription object that needs to be updated |
new_feed_url | String | Body | No | The URL of the new RSS feed for the subscription |
new_guid | String <UUID> | Body | No | The new GUID of the podcast |
is_subscribed | Boolean | Body | No | Whether the user is subscribed to the podcast or not |
Server-side behavior
On receipt of a PATCH request for a subscription, the server MUST do the following:
- If the subscription in the request has a
new_guid
specified in the database, follow thenew_guid
chain to find the latest version of the subscription - If the request contains a
new_feed_url
parameter:- Update the subscription entry’s
feed_url
field to the new value - Update the subscription entry’s
subscription_changed
field to the current date
- Update the subscription entry’s
- If the request contains a
new_guid
parameter:- Check if the GUID is already present in the system
- If the GUID is already present, update the subscription entry’s
new_guid
field to point to the existing entry - If the GUID isn’t already present, create a new subscription entry and update the existing entry’s
new_guid
field to point to the newly created entry - Update the subscription entry’s
guid_changed
to the current date
- If the request contains an
is_subscribed
parameter:- Update the subscription entry’s
is_subscribed
to the new value - Update the subscription entry’s
subscription_changed
field to the current date
- Update the subscription entry’s
- Return a summary of the changes