We shoudl be seeing this kind of stuf fin your code, as we had to custom build to get proper APi functionality... but alas, you still do not have this type of functionality!
public function create_item( $request ) {
$params = $request->get_params();
$url = Helper::get_data( $params, 'url', '' );
$title = Helper::get_data( $params, 'title', '' );
$domain = Helper::get_data( $params, 'domain', '' );
$post_id = Helper::get_data( $params, 'post_id', 0 );
$slug = Helper::get_data( $params, 'slug', '' );
if ( ! empty( $url ) ) {
$url = sanitize_url( $url );
}
$data = array(
'url' => $url,
'title' => $title,
'domain' => $domain,
'post_id' => $post_id,
'slug' => $slug,
);