Extend the expiration of all memberships in a project.
PATCH /v2/projects/{project_id}/memberships/extendTry it Path Parameters The unique identifier of the project.
Request Body Target end date - either Unix timestamp in milliseconds (13 digits as number) or ISO 8601 timestamp string. Must be in the future.
# Using Unix timestamp in milliseconds (number)
curl -X PATCH "https://api.botsubscription.com/v2/projects/YOUR_PROJECT_ID/memberships/extend" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"extend": 1768213947560
}'
# Or using ISO 8601 timestamp (string)
curl -X PATCH "https://api.botsubscription.com/v2/projects/YOUR_PROJECT_ID/memberships/extend" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"extend": "2026-01-12T10:32:27.560Z"
}' const project_id = 'YOUR_PROJECT_ID' ;
// Option 1: Using Unix timestamp in milliseconds
const newExpirationDate = new Date ( '2026-01-20T00:00:00Z' );
const extend = newExpirationDate. getTime (); // Number
// Option 2: Using ISO string
// const extend = '2026-01-20T00:00:00.000Z';
const response = await fetch ( `https://api.botsubscription.com/v2/projects/${ project_id }/memberships/extend` , {
method: 'PATCH' ,
headers: {
'Authorization' : 'Bearer YOUR_TOKEN' ,
'Content-Type' : 'application/json'
},
body: JSON . stringify ({ extend })
});
const data = await response. json (); import requests
from datetime import datetime, timezone
project_id = 'YOUR_PROJECT_ID'
# Option 1: Using Unix timestamp in milliseconds
new_expiration = datetime( 2026 , 1 , 20 , 0 , 0 , 0 , tzinfo = timezone.utc)
extend = int (new_expiration.timestamp() * 1000 ) # Number
# Option 2: Using ISO string
# extend = '2026-01-20T00:00:00.000Z'
response = requests.patch(
f 'https://api.botsubscription.com/v2/projects/ { project_id } /memberships/extend' ,
headers = { 'Authorization' : 'Bearer YOUR_TOKEN' },
json = { 'extend' : extend}
)
data = response.json() $project_id = 'YOUR_PROJECT_ID' ;
// Option 1: Using Unix timestamp in milliseconds
$extend = strtotime ( '2026-01-20 00:00:00' ) * 1000 ; // Number
// Option 2: Using ISO string
// $extend = '2026-01-20T00:00:00.000Z';
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://api.botsubscription.com/v2/projects/{ $project_id }/memberships/extend" );
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST , 'PATCH' );
curl_setopt ($ch, CURLOPT_HTTPHEADER , [
'Authorization: Bearer YOUR_TOKEN' ,
'Content-Type: application/json'
]);
curl_setopt ($ch, CURLOPT_POSTFIELDS , json_encode ([
'extend' => $extend
]));
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , true );
$response = curl_exec ($ch); Memberships extended application/json
{
"ok" : true ,
"request_id" : "11111111-1111-1111-1111-111111111111" ,
"method" : "PATCH" ,
"path" : "/v2/projects/YOUR_PROJECT_ID/memberships/extend" ,
"code" : 200 ,
"total" : 5 ,
"message" : "Membership end dates set successfully" ,
"data" : {
"new_end_date" : "2026-01-12T10:32:27.560Z"
}
} Invalid timestamp format application/json
{
"ok" : false ,
"request_id" : "11111111-1111-1111-1111-111111111111" ,
"method" : "PATCH" ,
"path" : "/v2/projects/YOUR_PROJECT_ID/memberships/extend" ,
"code" : 422 ,
"errors" : [
{
"message" : "Option 1: Timestamp must be 13 digits (milliseconds)." ,
"error_code" : "VALIDATION_ERROR"
},
{
"message" : "Option 2: Invalid timestamp: must be in UTC ISO-8601 format with three ms digits, e.g. 2025-06-16T10:43:04.920Z" ,
"error_code" : "VALIDATION_ERROR"
}
]
} Past timestamp application/json
{
"ok" : false ,
"request_id" : "11111111-1111-1111-1111-111111111111" ,
"method" : "PATCH" ,
"path" : "/v2/projects/YOUR_PROJECT_ID/memberships/extend" ,
"code" : 422 ,
"error" : {
"error_code" : "VALIDATION_ERROR" ,
"message" : "extend must be a future timestamp"
}
} Last updated: January 15, 2026
PreviousDelete Membership Next Extend User Membership