-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Summary
When updating a subscriber via PUT /api/subscribers/{id}, omitting the lists array from the payload removes all list memberships. This behavior may be unexpected for API consumers who only want to update attributes.
Current Behavior
Subscriber has 3 list memberships
curl -X PUT /api/subscribers/123
-d '{"email": "[email protected]", "attribs": {"foo": "bar"}}'
Result: Subscriber now has 0 list memberships
Question
Is this the intended/expected behavior? If so, could a warning be added to the API documentation clarifying that:
- PUT replaces the entire subscriber resource
- Omitting lists is equivalent to setting lists: []
- To preserve existing lists when updating attributes, callers must first fetch the subscriber and include the current list IDs in the PUT
Suggested Documentation Addition
Something like:
Warning: The lists field defaults to an empty array if not specified. To update subscriber attributes without modifying list memberships, you must include the current list IDs in your request.
Workaround
We now fetch the subscriber first and include existing list IDs in every PUT:
- GET current subscriber
- Extract list IDs from response
- Include list IDs in PUT payload