Subscriptions

Manage Member Plan Lifecycle

Pause, resume, cancel immediately, or schedule cancellation for a member plan.

All endpoints are authenticated and scoped to your account.

Headers (all endpoints)

Name / Type / Description
NameTypeDescription
AuthorizationStringBearer YOUR_API_KEY

Cancel Immediately

POST https://api.dyntube.com/v1/member-plans/{id}/cancel-now

Cancels access right away and sets status to Canceled.

Schedule Cancel at Period End

POST https://api.dyntube.com/v1/member-plans/{id}/cancel-at-period-end

Schedules cancellation at the plan’s endDate/period end. Sets cancelAt and cancelAtPeriodEnd=true.

Resume (Undo Cancel/Pause)

POST https://api.dyntube.com/v1/member-plans/{id}/resume

Restores the plan to Active, clears cancelAt and cancelAtPeriodEnd.

Pause

POST https://api.dyntube.com/v1/member-plans/{id}/pause

Sets status to Paused.

Path Parameters (all endpoints)

Name / Type / Description
NameTypeDescription
idStringMember plan ID

Responses

200: OK

json
{ "ok": true }

404: Not Found

json
{ "message": "Subscription not found" }

Notes

  • Choose cancel-now when access should end immediately, or cancel-at-period-end when access should continue through the current period.
  • Use resume to restore an assignment that was paused or scheduled for cancellation.
  • Use GET /v1/member-plans/{id} to inspect cancelAt, cancelAtPeriodEnd, status, and current period dates after an action.

Code Samples

C#

csharp
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");

await client.PostAsync("https://api.dyntube.com/v1/member-plans/{id}/pause", null);
await client.PostAsync("https://api.dyntube.com/v1/member-plans/{id}/resume", null);
await client.PostAsync("https://api.dyntube.com/v1/member-plans/{id}/cancel-now", null);
await client.PostAsync("https://api.dyntube.com/v1/member-plans/{id}/cancel-at-period-end", null);

Node.js

javascript
const axios = require('axios');
const headers = { Authorization: 'Bearer YOUR_API_KEY' };

async function updateLifecycle(id) {
  await axios.post(`https://api.dyntube.com/v1/member-plans/${id}/pause`, {}, { headers });
  await axios.post(`https://api.dyntube.com/v1/member-plans/${id}/resume`, {}, { headers });
  await axios.post(`https://api.dyntube.com/v1/member-plans/${id}/cancel-now`, {}, { headers });
  await axios.post(`https://api.dyntube.com/v1/member-plans/${id}/cancel-at-period-end`, {}, { headers });
}

updateLifecycle('{id}');

Python

python
import requests

headers = {'Authorization': 'Bearer YOUR_API_KEY'}
requests.post('https://api.dyntube.com/v1/member-plans/{id}/pause', headers=headers)
requests.post('https://api.dyntube.com/v1/member-plans/{id}/resume', headers=headers)
requests.post('https://api.dyntube.com/v1/member-plans/{id}/cancel-now', headers=headers)
requests.post('https://api.dyntube.com/v1/member-plans/{id}/cancel-at-period-end', headers=headers)

PHP

php
<?php
$headers = ["Authorization: Bearer YOUR_API_KEY"];

function call($url, $headers) {
  $ch = curl_init($url);
  curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers
  ]);
  $response = curl_exec($ch);
  curl_close($ch);
  return $response;
}

call("https://api.dyntube.com/v1/member-plans/{id}/pause", $headers);
call("https://api.dyntube.com/v1/member-plans/{id}/resume", $headers);
call("https://api.dyntube.com/v1/member-plans/{id}/cancel-now", $headers);
call("https://api.dyntube.com/v1/member-plans/{id}/cancel-at-period-end", $headers);
  • Get a member plan to inspect the current lifecycle state.
  • Get member's plans to list all assignments for a member.
  • Attach plan to member to create a new assignment.

Something missing or wrong here? Tell us and we will correct it. New to DynTube? Start with uploading and embedding.