Pagination

When endpoints return large datasets, such as collections, pagination helps manage the response. Use the page and take query parameters to control pagination:

  • page: Specifies the page number to retrieve. Default is 1.
  • take: Specifies the number of records per page. Default is 100.

To retrieve the first 50 collections in an organization, use the following query parameters:

curl --request GET \
 --url 'https://api.withcortex.ai/apps/{app_id}/collections?page=1&take=50'

Filtering

Endpoints may support filtering to refine responses. Filtering parameters vary by endpoint. For example, the /collections endpoint supports the following filters:

  • search: Search for a specific term within the response.
  • visibility: Filter collections by visibility status.
  • tags: Filter collections by associated tags.

To search for collections with the term “Debt,” visibility “PUBLIC,” and tags “pending,” use these query parameters:

curl --request GET \
 --url 'https://api.withcortex.ai/apps/{app_id}/collections?search=Debt&visibility=PUBLIC&tags=pending'

Filtering parameters vary by endpoint. Refer to the endpoint documentation for the specific parameters supported.