Skip to content
Leadtime
English
Esc
navigateopen⌘Jpreview

List sales opportunities

Retrieves a paginated grid of sales opportunities with filtering and sorting capabilities. Quick search available on: name, shortName, orgName. Filterable fields: id, name, shortName, type, valueGroup, categoryId, statusId, phaseId, deadline, organizationId, orgName, guestAccess, isFavorite, isArchived, openTasksCount, createdAt, editedAt. Sortable fields: id, name, shortName, type, valueGroup, categoryId, statusId, phaseId, deadline, organizationId, orgName, guestAccess, isFavorite, isArchived, openTasksCount, createdAt, editedAt.

What are Sales Opportunities?

Sales opportunities represent potential projects in the customer lifecycle where a customer has not placed any order yet. They are used to organize leads, track sales stages, manage contacts, and systematically move potential deals forward. In Leadtime, sales opportunities work as projects that are assigned to an external organization (customer). The goal of every opportunity is to create an offer, and if successful, it can turn into an implementation project.

How Sales Opportunities Work:

  • Sales opportunities are Single-type projects that have an organizationId (external projects)
  • They can be linked to one or more offers or estimates
  • They use project phases to track progress through the sales process (e.g., Uncontacted, Research, Contact made, Reminder, Implementation, Won, Finished)
  • They support custom fields for storing additional information like probability, source, region, or segment
  • They include a journal for documenting activities, feedback, and interactions with potential customers

Automatic Filtering:

This endpoint automatically applies three filters to ensure only relevant sales opportunities are returned:

  1. Project type: Must be Single (only single projects can be sales opportunities)
  2. Organization ID: Must not be empty (only external projects linked to organizations)
  3. Status exclusion: Projects with Done status type are automatically excluded (only active opportunities are shown)

Data Returned:

The response includes project grid items with fields such as:

  • Project identification: id, name, shortName, icon
  • Project classification: type, valueGroup, categoryId, statusId, phaseId
  • Organization information: organizationId, orgName, orgColor
  • Project metadata: createdAt, editedAt, isFavorite, isArchived, guestAccess
  • Task information: openTasksCount

Access Control:

Users can only see opportunities for projects they have access to based on their project permissions. The endpoint requires the Opportunities.manageSalesOpportunities permission.

GET/sales/opportunities
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:read
or
AuthorizationBearer token (JWT) · headerrequired
Query parameters
pagenumber
Page number (1-based)
pageSizenumber
Number of items per page
viewIdstring
View identifier for saved grid configurations
quickSearchstring
Quick search text. Searches across: name, shortName, orgName
filtersstring
JSON string containing filter configuration. **Available Fields:** - **id** (string): Project ID - **name** (string): Project name - **shortName** (string): Project short name (organization prefix + number) - **type** (set): Project type - **valueGroup** (set): Value group classification - **categoryId** (string): Project category ID - **statusId** (string): Project status ID - **phaseId** (string): Project phase ID - **deadline** (date): Project deadline date - **organizationId** (string): Organization ID - **orgName** (string): Organization name - **guestAccess** (boolean): Whether guest access is enabled - **isFavorite** (boolean): Whether the project is marked as favorite by the current user - **isArchived** (boolean): Whether the project is archived - **openTasksCount** (number): Number of open tasks - **createdAt** (date): Creation timestamp - **editedAt** (date): Last update timestamp **Filter Structure:** ```json [ { "type": "string|number|date|set|boolean|array|task_status|task_type", "fieldName": "field_name", "value": { "comparison": "comparison_type", "value": "filter_value" } } ] ``` **Group Filters (AND/OR Combinations):** ```json [ { "type": "group", "fieldName": "group0.18807479823070028", "value": { "type": "or", "filters": [ { "type": "string", "fieldName": "fileName", "value": { "comparison": "contain", "value": "aa" } }, { "type": "number", "fieldName": "rowCount", "value": { "comparison": ">=", "value": 33 } } ] } } ] ``` **Available Comparison Operators:** - **id** (string): Project ID (string filter). Available comparisons: contain, not_contain, equal, starts_with, ends_with, is_empty, is_not_empty - **name** (string): Project name (string filter). Available comparisons: contain, not_contain, equal, starts_with, ends_with, is_empty, is_not_empty - **shortName** (string): Project short name (organization prefix + number) (string filter). Available comparisons: contain, not_contain, equal, starts_with, ends_with, is_empty, is_not_empty - **type** (set): Project type (set filter). Available comparisons: in, not_in, is_empty, is_not_empty - **valueGroup** (set): Value group classification (set filter). Available comparisons: in, not_in, is_empty, is_not_empty - **categoryId** (string): Project category ID (string filter). Available comparisons: contain, not_contain, equal, starts_with, ends_with, is_empty, is_not_empty - **statusId** (string): Project status ID (string filter). Available comparisons: contain, not_contain, equal, starts_with, ends_with, is_empty, is_not_empty - **phaseId** (string): Project phase ID (string filter). Available comparisons: contain, not_contain, equal, starts_with, ends_with, is_empty, is_not_empty - **deadline** (date): Project deadline date (date filter). Available comparisons: equal, not_equal, >, <, >=, <=, between, lastMonth, thisMonth, is_empty, is_not_empty - **organizationId** (string): Organization ID (string filter). Available comparisons: contain, not_contain, equal, starts_with, ends_with, is_empty, is_not_empty - **orgName** (string): Organization name (string filter). Available comparisons: contain, not_contain, equal, starts_with, ends_with, is_empty, is_not_empty - **guestAccess** (boolean): Whether guest access is enabled (boolean filter). Available comparisons: equal, not_equal - **isFavorite** (boolean): Whether the project is marked as favorite by the current user (boolean filter). Available comparisons: equal, not_equal - **isArchived** (boolean): Whether the project is archived (boolean filter). Available comparisons: equal, not_equal - **openTasksCount** (number): Number of open tasks (number filter). Available comparisons: equal, not_equal, >, <, >=, <=, is_empty, is_not_empty - **createdAt** (date): Creation timestamp (date filter). Available comparisons: equal, not_equal, >, <, >=, <=, between, lastMonth, thisMonth, is_empty, is_not_empty - **editedAt** (date): Last update timestamp (date filter). Available comparisons: equal, not_equal, >, <, >=, <=, between, lastMonth, thisMonth, is_empty, is_not_empty **Note:** Use `quickSearch` parameter for simple text search instead of adding it to filters.
sortstring
JSON array of sort objects. **Sortable Fields:** - **id**: Project ID - **name**: Project name - **shortName**: Project short name (organization prefix + number) - **type**: Project type - **valueGroup**: Value group classification - **categoryId**: Project category ID - **statusId**: Project status ID - **phaseId**: Project phase ID - **deadline**: Project deadline date - **organizationId**: Organization ID - **orgName**: Organization name - **guestAccess**: Whether guest access is enabled - **isFavorite**: Whether the project is marked as favorite by the current user - **isArchived**: Whether the project is archived - **openTasksCount**: Number of open tasks - **createdAt**: Creation timestamp - **editedAt**: Last update timestamp **Sort Structure:** ```json [ { "field": "field_name", "direction": "asc|desc" } ] ``` **Default Sort:** createdAt (desc)
fieldsToReturnany[]
Comma-separated list of field names to include in response items. If not provided, all fields are returned. **Available Fields:** id, name, shortName, icon, type, valueGroup, categoryId, statusId, phaseId, deadline, organizationId, orgName, orgColor, guestAccess, isFavorite, isArchived, openTasksCount, createdAt, editedAt
Responses
200Paginated list of sales opportunities
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X GET "https://leadtime.app/api/public/sales/opportunities" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
Paginated list of sales opportunities