API - List Funnel Opportunities with Custom Field Filter
API - List Opportunities in Pipeline with Custom Field Filter
List opportunities in a pipeline
POST /crm/opportunities/XXXX?i=instancia&apitoken=XXXXXXX
XXXX = Pipeline ID (CRM)
Full endpoint: https://sprinthub-api-master.sprinthub.app/crm/opportunities/XXXX?i=instancia&apitoken=XXXXXXX
Unlike other CRM endpoints, authentication here goes in the query string, not in headers.
Headers
Content-Type
application/json
Body
page
number
Yes
Page, starts at 0. It only actually paginates when there is columnId
limit
number
Yes
Maximum 100. Above that returns 400
filters
array
No
Conditions on custom fields. See below
columnId
number
No
Stage ID. Changes the response format
filterByUsers
array
No
Responsible user IDs. Empty = all
filterByStatus
array
No
Included statuses: open, gain, lost
filterByCreateDate
date | null
No
Creation date window
filterByExpectedCloseDate
date | null
No
Expected closing date window
search
string
No
Searched text. Does not reach custom fields
searchBy
string
No
Where to search. Accepts only lead or opportunity
Filter by custom field
Each condition in the array filters has two layers: the outer one identifies the condition type, and properties carries the comparison.
filterType
string
Yes
opField for opportunity field. Without it the condition is silently discarded
properties.field
string
Yes
Field name, exactly as in the CRM. It is not an ID
properties.value
string
Yes
Searched value
properties.operator
string
No
=, != or contains. Omitted, assumes =
properties.fieldType
string
No
Field type, e.g. text
category
string
No
opportunity for opportunity field
operator
string
No
Combination with others: AND or OR
id
string
No
Used by the panel to identify the row in the interface. The API ignores
Operators: = compares the exact value, != brings everything that is not that value, contains searches for a segment — 845 finds 84521. The values like e isNotNull are accepted by the API but do not filter.
Multiple conditions in the array are applied together. Even though several fields are optional, the recommended approach is to send the complete structure, as the panel sends it.
Response
200 — without columnId (kanban)
Stage array, each one with total, totalValue e items. In this mode page is ignored and items brings only the first limit opportunities from each stage.
200 — with columnId (flat list)
Direct list of the stage's opportunities, with pagination working.
400 — page or limit missing
400 — limit above 100
400 — searchBy invalid
Notes
Custom fields are defined by pipeline. A field that exists in one pipeline may not exist in another. Filtering by a field that does not exist in that pipeline returns an empty list with status 200 OK, with no error message.
The array filters has no schema for the items. The API only validates that it is an array. A condition without filterType — or malformed in another way — is silently discarded, and the response returns complete with status 200, giving the impression that the filter was applied.
To confirm that the filter is active, make the same call with an value nonexistent. Empty result means filter working; complete result means filter ignored.
The pipeline and stage IDs come from GET /crm?i=instancia&apitoken=XXXXXXX, which returns the pipelines with the stages embedded in the field columns.
Last updated
Was this helpful?