api - matrix sort ids