Title: rest_add_application_passwords_to_index
Published: December 9, 2020
Last modified: August 20, 2026

---

# rest_add_application_passwords_to_index( WP_REST_Response $response ): 󠀁[WP_REST_Response](https://developer.wordpress.org/reference/classes/wp_rest_response/)󠁿

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/rest_add_application_passwords_to_index/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/rest_add_application_passwords_to_index/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/rest_add_application_passwords_to_index/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/rest_add_application_passwords_to_index/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/rest_add_application_passwords_to_index/?output_format=md#changelog)

Adds Application Passwords info to the REST API index.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/rest_add_application_passwords_to_index/?output_format=md#parameters)󠁿

 `$response`[WP_REST_Response](https://developer.wordpress.org/reference/classes/wp_rest_response/)
required

The index response object.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/rest_add_application_passwords_to_index/?output_format=md#return)󠁿

 [WP_REST_Response](https://developer.wordpress.org/reference/classes/wp_rest_response/)

## 󠀁[Source](https://developer.wordpress.org/reference/functions/rest_add_application_passwords_to_index/?output_format=md#source)󠁿

    ```php
    function rest_add_application_passwords_to_index( $response ) {
    	if ( ! wp_is_application_passwords_available() ) {
    		return $response;
    	}

    	$response->data['authentication']['application-passwords'] = array(
    		'endpoints' => array(
    			'authorization' => admin_url( 'authorize-application.php' ),
    		),
    	);

    	return $response;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/rest-api.php#L1282)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api.php#L1282-L1294)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/rest_add_application_passwords_to_index/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_is_application_passwords_available()](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/)`wp-includes/user.php` |

Checks if Application Passwords is globally available.

  | 
| [admin_url()](https://developer.wordpress.org/reference/functions/admin_url/)`wp-includes/link-template.php` |

Retrieves the URL to the admin area for the current site.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/rest_add_application_passwords_to_index/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Frest_add_application_passwords_to_index%2F)
before being able to contribute a note or feedback.