Pagination, Timeouts, and Date-Time Format

Learn about pagination, timeouts, and date-time fields.

Pagination

deepset Cloud API uses pagination to divide a large set of entities into separate pages, enhancing response times. Endpoints use either page-based or cursor-based pagination. Sometimes both options are possible but you can't use them at the same time.
When a request involves pagination, the API provides details about the total number of items available.

In page-based pagination, you specify the desired page and the number of items per page by using the page_number and limit query parameters. For example, to view 20 evaluation sets on page 2, your request would be as follows:

curl --request GET \
     --url 'https://api.cloud.deepset.ai/api/v1/workspaces/default/evaluation_sets?limit=20&page_number=2' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <api_key>

To retrieve more files, make another request with updated pagination parameters. If you're using a script or application, iterate through the pages until you retrieve all the items or reach the desired number.

In cursor-based pagination, you can use the before or after parameter to view items preceding or following a specific item ID. For instance, to display 10 evaluation sets preceding the one with ID ab61f0cd-316a-4c66-879f-65dbe28ced1e, include this ID in the before parameter as shown below:

curl --request GET \
     --url 'https://api.cloud.deepset.ai/api/v1/workspaces/workspace_name/evaluation_sets?limit=10&before=ab61f0cd-316a-4c66-879f-65dbe28ced1e' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <api_key>

Date-Time

All date-time values are in the UTC time in the ISO 8601 format, which follows the convention: YYYY-MM-DDTHH:MM:SS.sssZ, where:

  • YYYY is the year
  • MM is the month
  • DD is the day
  • T is the delimiter that separates the date from time
  • HH is the hour in a 24-hour clock format
  • MM is minutes
  • SS is seconds
  • .sss is fractional seconds, can be one or more digits, represent a decimal fraction of a second
  • Z is a suffix that indicates that the time is in UTC.

For example, 2023-04-25T07:37:58.326042Z represents 25th April 2023, 7:37 and 58.326042 seconds in UTC.

Timeouts

The timeout for search is 2 minutes. The timeout for other requests is 3 minutes.