# Existe uma maneira de verificar a validade de um novo nome de usuário via API antes de tentar registrar?

**URL:** https://meta.discourse.org/t/is-there-a-way-to-check-validity-of-a-new-username-via-the-api-before-actually-trying-to-register/88153
**Category:** Development
**Created:** [Maio 22, 2018, 3:35pm UTC](https://meta.discourse.org/t/is-there-a-way-to-check-validity-of-a-new-username-via-the-api-before-actually-trying-to-register/88153 "2018-05-22T15:35:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Frank\_Bailey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frank_bailey/32/83927_2.png) [@Frank\_Bailey](https://meta.discourse.org/u/Frank_Bailey)
#### Post date: [Maio 22, 2018, 3:35pm UTC](https://meta.discourse.org/t/is-there-a-way-to-check-validity-of-a-new-username-via-the-api-before-actually-trying-to-register/88153/1 "2018-05-22T15:35:45Z")

</div>

Or alternatively is there a PHP implementation of the username rule set that anyone here knows of?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [Maio 22, 2018, 3:48pm UTC](https://meta.discourse.org/t/is-there-a-way-to-check-validity-of-a-new-username-via-the-api-before-actually-trying-to-register/88153/2 "2018-05-22T15:48:05Z")

</div>

You might be interested in reading this

> [@Reverse engineer the Discourse API](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576):
>
> Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api. The API is documented at [docs.discourse.org](https://docs.discourse.org). You can also use the [discourse\_api](https://github.com/discourse/discourse_api) Ruby gem as a client library. However, not every endpoint is documented. To determine how to do something with the JSON API here are some steps you can follow. Example: recategorize a topic. Go to a topic and start editing a category: Open Chrome dev tools, switch to the Network tab, select …

FTR, you want the `/u/check_username` endpoint 😉

---

<div class="post-metadata">

### Author: ![Frank\_Bailey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frank_bailey/32/83927_2.png) [@Frank\_Bailey](https://meta.discourse.org/u/Frank_Bailey)
#### Post date: [Maio 22, 2018, 5:06pm UTC](https://meta.discourse.org/t/is-there-a-way-to-check-validity-of-a-new-username-via-the-api-before-actually-trying-to-register/88153/3 "2018-05-22T17:06:01Z")

</div>

That’s great! Thanks very much once again!
