Delete an opportunity

DELETE https://api.zenoti.com/v1/opportunities/{opportunity_id}

Deletes an opportunity from the pipeline. This action is permanent.

Before you begin

Permission: Manage API Keys (under Administrator) — Required to access Zenoti APIs.

Endpoint

DELETE /v1/opportunities/{opportunity_id}

Base URL: https://api.zenoti.com

Request

Headers

Header Required Description
Authorization Yes bearer {{access_token}}

Path parameters

Parameter Type Required Description
opportunity_id string (GUID) Yes Opportunity identifier

Response

Success (200 OK)

{
  "is_deleted": true,
  "error": null
}

Response fields

Field Type Description
is_deleted boolean Whether the opportunity was deleted

Example

curl --request DELETE \
  --url 'https://api.zenoti.com/v1/opportunities/f6a7b8c9-d0e1-2f3a-4b5c-6d7e8f9a0b1c' \
  --header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/opportunities/{opportunity_id}', {
  method: 'DELETE',
  headers: {
    'Authorization': 'bearer {{access_token}}'
  },
});
const data = await response.json();
import requests

response = requests.delete(
    'https://api.zenoti.com/v1/opportunities/{opportunity_id}',
    headers={
        'Authorization': 'bearer {{access_token}}',
    },
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.DeleteAsync(
    "https://api.zenoti.com/v1/opportunities/{opportunity_id}");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'

uri = URI('https://api.zenoti.com/v1/opportunities/{opportunity_id}')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.zenoti.com/v1/opportunities/{opportunity_id}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: bearer {{access_token}}'
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);

Error codes

Status Description
401 Unauthorized — invalid or expired access token
404 Resource not found
429 Too many requests — rate limit exceeded (60/min)