Skip to main content

Automatically Cancel Subscription Plan

Overview

This endpoint allows you to cancel subscription for a particular api key automatically.

Request

--request POST 'https://modelslab.com/api/v3/cancel_subscription' \
caution

Before calling this endpoint, you must have purchased subscription via this endpoint

Send a POST request to https://modelslab.com/api/v3/cancel_subscription endpoint and pass the desired key_to_cancel .

Attributes

ParameterTypeDescription
keyStringYour default API Key used for request authorization
key_to_cancelStringThe api custom api key you want to cancel the subscription for

Example

Body

Body Raw
{
"key":"your-default-api-key",
"key_to_cancel":"a2cSbgGXIqAHtr3iDBpCdb1yVLZZk000cCltCTtUNpkRM45mak5SpLY9gAlR"
}

Request

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"key": "",
"key_to_cancel":"a2cSbgGXIqAHtr3iDBpCdb1yVLZZk000cCltCTtUNpkRM45mak5SpLY9gAlR"
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://modelslab.com/api/v3/cancel_subscription", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Response

{
"status": "success",
"messege": "subscription cancelled successfully"
}