# API topic's external\_ID can't be reused after deleting a topic and creating a new one

**URL:** https://meta.discourse.org/t/api-topics-external-id-cant-be-reused-after-deleting-a-topic-and-creating-a-new-one/280835
**Category:** Feature
**Tags:** rest-api
**Created:** [August 29, 2022, 3:09am UTC](https://meta.discourse.org/t/api-topics-external-id-cant-be-reused-after-deleting-a-topic-and-creating-a-new-one/280835 "2022-08-29T03:09:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![george\_m](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/george_m/32/272202_2.png) [@george\_m](https://meta.discourse.org/u/george_m)
#### Post date: [August 29, 2022, 3:09am UTC](https://meta.discourse.org/t/api-topics-external-id-cant-be-reused-after-deleting-a-topic-and-creating-a-new-one/280835/1 "2022-08-29T03:09:39Z")

</div>

Hi @blake,  
We’re happily using the `external_id` feature for [our integration](https://github.com/linuxdojo/catalogbot). I note however that if we delete a Topic, we can not create a new one with the same `external_id` and instead receive the error:

```plaintext
{'action': 'create_post', 'errors': ['External has already been taken']}

```

Is it at all possible to re-use the same `external_id` after a Topic that used it is deleted?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [June 9, 2024, 8:10am UTC](https://meta.discourse.org/t/api-topics-external-id-cant-be-reused-after-deleting-a-topic-and-creating-a-new-one/280835/2 "2024-06-09T08:10:52Z")

</div>

I understand why external ids can’t be re-used, but it would be handy if they could be. My use case is wanting to add external ids to topics that are pushed to Discourse from a user’s local file system with a CLI application.

The relationship between Discourse topics and local files is being maintained in a database. It’s kind of inevitable that databases will get deleted, corrupted, etc. It would be reassuring to know that the local database could be rebuilt based on the results of a [Data Explorer](https://meta.discourse.org/t/32566?silent=true) query.

Unfortunately, not being able to re-use external ids after a topic is deleted will create another problem. I ran into it in the first 5 minutes of testing. Based on past experience with the WordPress plugin, it’s common for people to delete topics that have been created via the API. Especially when first setting up an integration.

Edit: maybe un-deleting the topic via the API would work for my use case.
