# No description in a category via API

**URL:** <https://meta.discourse.org/t/no-description-in-a-category-via-api/277473>\
**Category:** Migration\
**Tags:** rest-api\
**Created:** [September 1, 2023, 8:58am UTC](https://meta.discourse.org/t/no-description-in-a-category-via-api/277473 "2023-09-01T08:58:09Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![FLucas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flucas/32/317231_2.png) [@FLucas](https://meta.discourse.org/u/FLucas)\
**Post date:** [September 1, 2023, 4:49pm UTC](https://meta.discourse.org/t/no-description-in-a-category-via-api/277473/3 "2023-09-01T16:49:54Z")

</div>

Thank you for your reply

I created this script allowing you to create a category and then modify its description:

```bash
curl -X POST "https://site-discourse/categories.json" \
 -H "Api-Key: api-key" \
 -H "Api-Username: api-username" \
 -d "name=Catégorie 1"
 
sleep 2 
 
latest_posts_response=$(curl -X GET "https://site-discourse/posts.json" \
 -H "Content-Type: application/json" \
 -H "Api-Key: api-key" \
 -H "Api-Username: api-username") 
                 
post_id=$(echo $latest_posts_response | jq '.latest_posts[0] .id')
   
curl -X PUT "https://site-discourse/posts/$post_id.json" \
 -H "Content-Type: application/json" \
 -H "Api-Key: api-key" \
 -H "Api-Username: api-username" \
 -d '{
        "post": {
        "raw": "Description de la catégorie 1"
      }
     }'

```

---

_[View the full topic](https://meta.discourse.org/t/no-description-in-a-category-via-api/277473)._
