[x] A server MAY choose to support requests to sort resource collections according to one or more criteria (“sort fields”).
[x] An endpoint MAY support requests to sort the primary data with a sort query parameter. The value for sort MUST represent sort fields.
[x] An endpoint MAY support multiple sort fields by allowing comma-separated (U+002C COMMA, “,”) sort fields. Sort fields SHOULD be applied in the order specified.
[x] The sort order for each sort field MUST be ascending unless it is prefixed with a minus (U+002D HYPHEN-MINUS, “-“), in which case it MUST be descending.
[x] If the server does not support sorting as specified in the query parameter sort, it MUST return 400 Bad Request.
[x] If sorting is supported by the server and requested by the client via query parameter sort, the server MUST return elements of the top-level data array of the response ordered according to the criteria specified. The server MAY apply default sorting rules to top-level data if request parameter sort is not specified.
Per the documentation