public function addKey() {

		/*
		 * @todo A section of this code has been duplicated in Boldgrid\Library\Library\Key\addKey()
		 * because the code for saving a key should be in the Key class and not the KeyPrompt class.
		 * This method needs to be refactored using that addKey method.
		 */

		// When adding Keys, delete the transient to make sure we get new license info.
		delete_site_transient( 'bg_license_data' );
		delete_site_transient( 'boldgrid_api_data' );

		$key = $this->validate();
		$data = $this->key->callCheckVersion( array( 'key' => $key ) );
		$msg = $this->getMessages();

		if ( is_object( $data ) ) {
			$this->key->save( $data, $key );
			wp_send_json_success( array(
				'message'   => $msg->success,
				'site_hash' => $data->result->data->site_hash,
				'api_key'   => apply_filters( 'Boldgrid\Library\License\getApiKey', false ),
			) );
		} else {
			$is_timeout = false !== strpos( $data, 'cURL error 28:' );
			wp_send_json_error( array( 'message' => $is_timeout ? $msg->timeout : $msg->error ) );
		}
	}