# Import scripts fail to relate topics and posts

**URL:** https://meta.discourse.org/t/import-scripts-fail-to-relate-topics-and-posts/60377
**Category:** Development
**Created:** [April 3, 2017, 12:56pm UTC](https://meta.discourse.org/t/import-scripts-fail-to-relate-topics-and-posts/60377 "2017-04-03T12:56:34Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![paultaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/paultaylor/32/166024_2.png) [@paultaylor](https://meta.discourse.org/u/paultaylor)
#### Post date: [January 10, 2020, 12:55pm UTC](https://meta.discourse.org/t/import-scripts-fail-to-relate-topics-and-posts/60377/3 "2020-01-10T12:55:31Z")

</div>

Trying to work out how to create topic so owned by a particular user rather than adminuser  
running the script.

> [@With Api how do you create topics and posts so owned by particular user](https://meta.discourse.org/t/with-api-how-do-you-create-topics-and-posts-so-owned-by-partiocular-user/138235):
>
> Importing my data from csv files using the api. I’m importing my users successfully. I’m importing categories, topics and posts successfully, except at the moment all my topics and posts are shown as being created by me the discourse admin for the site. Not clear how I create them so owned by the actual user Does the correct user have to be specified as the Api-Username for each post, and if so does that mean the user has to be an admin user (which they wouldnt be). Or do I create the topics…

From your post looks like you can just pass user\_id to api although not documented, but it doesn’t seem to work for me. Is that the case and if so is user\_id the **id** column of the users table or the **username** column?

---

_[View the full topic](https://meta.discourse.org/t/import-scripts-fail-to-relate-topics-and-posts/60377)._
