# تحقق من توفر اسم الفئة. جافة تشغيل API / تعبير مخصص؟

**URL:** <https://meta.discourse.org/t/check-whether-a-category-name-is-available-api-dry-run-custom-slug/90373>\
**Category:** Feature\
**Created:** [21 يونيو 2018، 7:46ص UTC](https://meta.discourse.org/t/check-whether-a-category-name-is-available-api-dry-run-custom-slug/90373 "2018-06-21T07:46:59Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![ryancey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryancey/32/99309_2.png) [@ryancey](https://meta.discourse.org/u/ryancey)\
**Post date:** [25 يونيو 2018، 10:22ص UTC](https://meta.discourse.org/t/check-whether-a-category-name-is-available-api-dry-run-custom-slug/90373/13 "2018-06-25T10:22:56Z")

</div>

You’re right, but I just saw that in fact Discourse doesn’t allow duplicate category **names** even with different slugs.

I can indeed check if the category name is already present in `/categories.json`, but what about string cleaning, escaping, and such? I can’t be 100% sure the name given by the user in my app front-end will be the same as the one Discourse would use when creating the category.

**Example:** Would `🎹 Category with an emoji` appear as so in `/categories.json` or will the emoji be stripped? If not now, I can’t be sure it won’t be the case tomorrow. Depends on so many factors, from the app to the server.

The only way I can be sure is to feed Discourse this name and get the response. As of today, the only way is to try to create it, and therefore having side-effect.

My feature proposal still stands 🙂 It would be great to have a side-effect free way to check if a category name is available.

Allowing duplicate category names (restricting unicity to slugs) is another request.

---

_[View the full topic](https://meta.discourse.org/t/check-whether-a-category-name-is-available-api-dry-run-custom-slug/90373)._
