List all opportunities

GET https://api.zenoti.com/v1/opportunities

Supply the unique identifier of the center and the fields on which you want to filter the opportunities and this API will return the list of opportunities in that center.

Before you begin

Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.

Endpoint

GET /v1/opportunities

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

Request

Headers

Header Required Description
Authorization Yes bearer {{access_token}}

Query parameters

Parameter Type Required Default Description
center_id string No — Unique identifier of the center.
page_num integer (int32) No — The number of pages on which you want the opportunity records to be retrieved and displayed.
records integer (int32) No — The number of records in a single page.
keywords string No — Keywords for the retrieving the opportunities.
guest_id string No — Unique identifier of the guest.
disposition_id string No — Unique identifier of the call disposition.
followup_from_date string (date) No — Date of the follow-up from which the API should list all the opportunities.
followup_to_date string (date) No — Date till which the API should retrieve all the opportunities.
creation_from_date string (date) No — Date when the opportunities were created.
creation_to_date string (date) No — Date of creation of the opportunities.
status_id string No — Unique identifier of the status of the opportunity.
priority_id string No — Identifier of the priority of the opportunity.
source_id string No — Identifier of the source of the opportunity.
last_modified_start_date string (date) No — Last modified date of the opportunity.
last_modified_end_date string (date) No — Last modified date of the opportunity.

Response

Success (200 OK)

{
  "opportunities": [
    {
      "...": "..."
    }
  ],
  "total_records": 188
}

Response fields

Field Type Description
opportunities object[]
opportunities[].opportunity_id string
opportunities[].opportunity_no integer
opportunities[].opportunity_title string
opportunities[].center_name string
opportunities[].sales_owner string
opportunities[].stage_name string
opportunities[].creation_date string
opportunities[].followup_date string
opportunities[].price object
opportunities[].call_status object
opportunities[].guest object
opportunities[].invoices object[]
total_records integer

Example

curl --request GET \
  --url 'https://api.zenoti.com/v1/opportunities' \
  --header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/opportunities', {
  method: 'GET',
  headers: {
    'Authorization': 'bearer {{access_token}}'
  },
});
const data = await response.json();
import requests

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

uri = URI('https://api.zenoti.com/v1/opportunities')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)

Error codes

Status Description
400 400
401 Unauthorized -- invalid or expired access token
429 Too many requests -- rate limit exceeded