I got curious, so I tested this barebone demo: add_action( ‘rest_api_init’, function () { register_rest_route( ‘wpse/v1’, ‘/post_by_permalink/(?P<path>[\S]+)’, [ ‘methods’ => WP_REST_Server::READABLE, ‘callback’ => ‘wpse_callback’, ‘show_in_rest’ => true ] ); }); function wpse_callback( $request ) { $data = [ ‘path’ => base64_decode( $request[‘path’] ) ]; return $data; } Testing: https://example.com/wp-json/wpse/v1/post_by_permalink/aHR0cHM6Ly93b3JkcHJlc3Muc3RhY2tleGNoYW5nZS5jb20vcS8zMDEwNjcv gives { path: “https://wordpress.stackexchange.com/q/301067/” } Tested … Read more