Title: rest_after_insert_user
Published: December 6, 2018
Last modified: February 24, 2026

---

# do_action( ‘rest_after_insert_user’, WP_User $user, WP_REST_Request $request, bool $creating )

## In this article

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

[ Back to top](https://developer.wordpress.org/reference/hooks/rest_after_insert_user/?output_format=md#wp--skip-link--target)

Fires after a user is completely created or updated via the REST API.

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

 `$user`[WP_User](https://developer.wordpress.org/reference/classes/wp_user/)

Inserted or updated user object.

`$request`[WP_REST_Request](https://developer.wordpress.org/reference/classes/wp_rest_request/)

Request object.

`$creating`bool

True when creating a user, false when updating.

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

    ```php
    do_action( 'rest_after_insert_user', $user, $request, true );
    ```

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

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

| Used by | Description | 
| [WP_REST_Users_Controller::create_item()](https://developer.wordpress.org/reference/classes/wp_rest_users_controller/create_item/)`wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php` |

Creates a single user.

  | 
| [WP_REST_Users_Controller::update_item()](https://developer.wordpress.org/reference/classes/wp_rest_users_controller/update_item/)`wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php` |

Updates a single user.

  |

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

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

## User Contributed Notes

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