Set a future end date for one membership, a selected batch, or all memberships in your Telegram or Discord subscription bot project. extend is a target date, not a duration.
Restricted keys can extend selected membership_ids. Whole-project updates with all_memberships: true require an unrestricted project API key.
Choose exactly one selector:membership_ids or all_memberships: true. Sending neither selector, or both, returns 422.
PATCH/v2/projects/{project_id}/memberships/extend
Authorization
Bearer API KeyRequired
API key scope:memberships:update (required for restricted keys).
Path Parameters
project_idstringrequired
The unique identifier of the project.
Request Body
extendstring | numberrequired
Future target expiry in UTC ISO format YYYY-MM-DDTHH:mm:ss.sssZ, for example 2030-01-01T00:00:00.000Z. Also accepts 13-digit Unix milliseconds for compatibility.
membership_idsstring[]
One to 100 distinct membership UUIDs. Use a one-item array to extend a particular membership.
all_membershipsboolean
Must be true when selecting the whole project. Cannot be combined with membership_ids.
For membership_ids, every membership must exist in this project, have no pending termination, and end on or before the target. Reactivating expired access must fit the plan's subscriber limit. A failure returns 404 or 409 without changing the selection.
For all_memberships: true, later end dates, lifetime memberships, and expired memberships whose plans are full are skipped. More than 10,000 memberships returns 409 without changes. The response message reports skipped memberships.
End dates never move earlier, and lifetime memberships are never given an expiration. Sending the same target again succeeds without extending access twice. Find IDs through the membership list API. To update a user's memberships together, use the user membership extension route.
To extend a membership granted through Redeem for Member, put its returned membership_id in a one-item membership_ids array.