From parameter in delete by query API

I am trying to use the [delete_by_query]( API to keep a maximum of 5 documents for a user that are most recent. I am using the sort parameter on a date field along with the from parameter. The from parameter is giving me the following error

Validation Failed: 1: using [from] is not allowed in a scroll context;
2: from is not supported in this context

I am using the following query -

POST http://<ip>/<index_name>/_delete_by_query
    "query": {
        "term": {
            "user": "12345"
    "sort": {
        "date": {
            "order": "desc"
    "from": 5

Could you help me identify what is causing the error? Do I need to change the scroll context to something else?