Sorting support for model and user list endpoints
Nov 30, 2024
1 minute read
Model and user list endpoints now support sorting via sort_by and sort_direction query parameters.
Models
GET /models, GET /models/{owner}, and GET /user/models can be sorted by created_at (default) or predictions_count. When sorting by prediction count, only models with at least one prediction are returned.
1curl "https://api.wrift.ai/v1/models?sort_by=predictions_count&sort_direction=desc" \2 -H "Authorization: Bearer $WRIFTAI_ACCESS_TOKEN"
Users
GET /users can be sorted by created_at (default).
sort_direction accepts asc or desc for all supported endpoints. See the API reference for details.