Delete user plan
curl --request DELETE \
--url https://app.autocalls.ai/api/white-label/users/{id}/plan \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.autocalls.ai/api/white-label/users/{id}/plan"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.autocalls.ai/api/white-label/users/{id}/plan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.autocalls.ai/api/white-label/users/{id}/plan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.autocalls.ai/api/white-label/users/{id}/plan"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.autocalls.ai/api/white-label/users/{id}/plan")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.autocalls.ai/api/white-label/users/{id}/plan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Plan removed.",
"data": null
}
{
"message": "Unauthenticated."
}
{
"message": "You are not an administrator."
}
{
"message": "You do not have access to these settings."
}
{
"message": "User not found."
}
{
"message": "This user has no plan."
}
{
"message": "This user's plan is paid in the platform, so it cannot be removed here."
}
{
"message": "Too Many Attempts."
}
White Label
Delete user plan
End a plan you gave to one of your users
DELETE
/
white-label
/
users
/
{id}
/
plan
Delete user plan
curl --request DELETE \
--url https://app.autocalls.ai/api/white-label/users/{id}/plan \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.autocalls.ai/api/white-label/users/{id}/plan"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.autocalls.ai/api/white-label/users/{id}/plan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.autocalls.ai/api/white-label/users/{id}/plan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.autocalls.ai/api/white-label/users/{id}/plan"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.autocalls.ai/api/white-label/users/{id}/plan")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.autocalls.ai/api/white-label/users/{id}/plan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Plan removed.",
"data": null
}
{
"message": "Unauthenticated."
}
{
"message": "You are not an administrator."
}
{
"message": "You do not have access to these settings."
}
{
"message": "User not found."
}
{
"message": "This user has no plan."
}
{
"message": "This user's plan is paid in the platform, so it cannot be removed here."
}
{
"message": "Too Many Attempts."
}
This endpoint ends a plan you gave with Update user plan, for example when the customer cancels with you. The plan ends immediately: its unused minutes, and what is left of a yearly prepayment, go back to the owner’s balance, and the user keeps their other minutes and their chat credits. It is the Remove plan button in the Plan action of your administration panel.
Without a plan, the user is handled like any other user without one: your default limits apply while free accounts are allowed, and if they are not, the account is deactivated, as when a paid plan ends.
Deleting a user also ends the plan you gave them, and returns its unused minutes, and what is left of a yearly prepayment, to the owner’s balance.
This endpoint is available to the account owner (with an active plan) and to team members with Billing Access. Other users receive a 403 Forbidden error. Only users of your platform can be changed: any other ID, including the owner account, returns 404. Plans a user subscribed to on your platform cannot be removed here.
Path Parameters
integer
required
The ID of the user. Administrators can list user IDs with Get platform users.
Response
string
Plan removed.null
Always
null: the user has no plan anymore{
"message": "Plan removed.",
"data": null
}
{
"message": "Unauthenticated."
}
{
"message": "You are not an administrator."
}
{
"message": "You do not have access to these settings."
}
{
"message": "User not found."
}
{
"message": "This user has no plan."
}
{
"message": "This user's plan is paid in the platform, so it cannot be removed here."
}
{
"message": "Too Many Attempts."
}
Rate limit
The platform settings, default limits, user settings and plan endpoints share a limit of 60 requests per minute for each account. Above it they return429, and the Retry-After response header tells you how many seconds to wait.
Example
curl -X DELETE https://app.autocalls.ai/api/white-label/users/123/plan \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"

