Share trips with a friend
trip_sharing_setGive one friend view or edit access to the user's own trips, change their level, or remove it (access=none), for specific trips (trip_ids) or every trip the user owns (all_trips=true, 25 per page). Idempotent: it checks each trip first and only changes what differs, so re-running it never sends a duplicate invitation. New access is an invitation emailed to the friend, who gets access once they accept. Without confirmed=true nothing is written or emailed: it returns the plan per trip (would_invite, would_update_access, would_revoke, already_correct, already_invited, needs_attention). Show that plan, and call again with the same arguments plus confirmed=true only once the user has explicitly asked for this change, in this conversation or in the instructions of a scheduled task they set up; after they approve the plan, apply it without previewing or asking again. Results per trip: invited, invitation_updated, access_updated, revoked, already_correct, already_invited, needs_attention (with a reason, e.g. not the owner or access via the traveler list) or failed; report them to the user, describing invited trips as pending invitations rather than access already granted. Friend summaries are separate and never changed here: they follow the user's friend settings and each trip's hide-from-friends switch. Only friends can get access; for someone who is not a friend yet, offer friend_request_send first. If their friend request is still pending, the call changes nothing and returns friendRequest and a note: tell the user they haven't accepted yet, and only if the user still wants it, call again with confirmed=true and pending_friend_confirmed=true. Get friend_user_id from friends_list; never guess it from a name. Never show IDs to the user.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | With all_trips, the 1-based page of 25 trips. Default 1. | |
| access | Yes | view = can see the trip; edit = can change it; none = remove their per-trip access. | |
| message | No | Optional note for new invitation emails (max 280 chars). | |
| trip_ids | No | Trip IDs to change. Provide this OR all_trips. | |
| all_trips | No | Apply to every trip the user owns, 25 per page. Provide this OR trip_ids. | |
| confirmed | No | true applies the change. Omit or false to preview without writing or emailing anything. | |
| upcoming_only | No | With all_trips, only trips that have not ended yet. Default false. | |
| friend_user_id | Yes | The friend's user_id from friends_list. For access=none, any user_id listed with access in trip_sharing_get. | |
| pending_friend_confirmed | No | Only when the friend request is still pending: true once the user, told they haven't accepted yet, still wants to grant this access. |