Skip to content

Delete a plan (partner-api)

Deletes one of your plans, only when no customer is on it right now (the same rule as Delete in the portal). A plan in use answers 409; deactivate it with is_active false instead. A plan of another partner answers 404; a global Voxbi plan answers 403.

Required scopes: partner-api and partner-plans-write.

HTTP: PartnerApiKey

Partner API key. A bearer token that a Reseller Admin generates in the partner portal under Settings, API keys. It belongs to the reseller partner, not to a person, and carries the scopes ticked at creation time. Send it on every request as Authorization: Bearer <partner_api_key>.

Every response is confined to the partner the key belongs to. Keep the key secret and call the API from your server only, never from a browser app.

HTTP Authorization Scheme
bearer
Bearer format
Bearer <partner_api_key>
plan path · string · uuid *
Plan id (UUID). It must be one of your plans or a global plan, otherwise the answer is `404`.
accept header · string
example: application/json

Responses

Deleted. No content.
Response schema
No response body.
Unauthenticated. The `Authorization: Bearer <token>` header was missing, malformed, or names a token that has been revoked or deleted.
Response schema
messagestring
Forbidden. Either the key lacks `partner-plans-write` (the body lists `required_scopes`), or the plan is visible to you but not yours to change: a global Voxbi plan can be read but not edited or deleted.
Response schema
messagestring
Human-readable reason.
example: This API key is missing a required scope.
required_scopesarray<string>
Present on the missing-scope 403 only. Scopes the endpoint needs that the key lacks.
[]string
Not Found. No plan with this id is visible to your partner (a plan of another partner, a nonexistent id and an id that is not a UUID answer the same way).
Response schema
messagestring
Human-readable reason.
example: This API key is missing a required scope.
required_scopesarray<string>
Present on the missing-scope 403 only. Scopes the endpoint needs that the key lacks.
[]string
Conflict. At least one customer is on the plan right now, so it cannot be deleted. Move the customers to another plan first, or deactivate the plan (`is_active` false) to stop selling it. Nothing was deleted.
Response schema
messagestring
Human-readable reason.
example: This API key is missing a required scope.
required_scopesarray<string>
Present on the missing-scope 403 only. Scopes the endpoint needs that the key lacks.
[]string
Too Many Requests. Two budgets apply: 120 requests per minute per API key, and 600 per minute across all of a partner's keys together. Wait for the number of seconds in the `Retry-After` header before retrying.
Response schema
messagestring
delete https://cockpit.voxbi.com/api/v1/api/v1/plans/{plan}
Base URL
Request sample
curl -X DELETE 'https://cockpit.voxbi.com/api/v1/api/v1/plans/{plan}' \
  -H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/api/v1/plans/{plan}', {
  method: 'DELETE',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${YOUR_TOKEN}`,
  },
});

const data = await response.json();
console.log(data);
import requests

response = requests.delete('https://cockpit.voxbi.com/api/v1/api/v1/plans/{plan}',
    headers={'Authorization': f'Bearer {YOUR_TOKEN}'}
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$context = stream_context_create([
    'http' => [
        'method'  => 'DELETE',
        'header'  => "Content-Type: application/json\r\nAuthorization: Bearer YOUR_TOKEN",
    ],
]);

$response = file_get_contents('https://cockpit.voxbi.com/api/v1/api/v1/plans/{plan}', false, $context);
$data = json_decode($response, true);
print_r($data);
No example for this status.
{ … }
"message": "Unauthenticated."
}
Content-Type string
example: application/json
{ … }
"message": "This API key is missing a required scope.",
"required_scopes": [ … ]
"partner-plans-write"
]
}
Content-Type string
example: application/json
{ … }
"message": "Plan not found."
}
Content-Type string
example: application/json
{ … }
"message": "This plan can't be deleted while customers are on it. Move them to another plan or remove them first, then delete the plan."
}
Content-Type string
example: application/json
{ … }
"message": "Too Many Attempts."
}
Retry-After integer
Seconds to wait before retrying.
example: 30
Content-Type string
example: application/json