# Create user through Backend API

**URL:** <https://forum.social.plus/t/create-user-through-backend-api/998>\
**Category:** General\
**Created:** [December 5, 2023, 4:22am UTC](https://forum.social.plus/t/create-user-through-backend-api/998 "2023-12-05T04:22:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![muhammad.nasir.ext](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@muhammad.nasir.ext](https://forum.social.plus/u/muhammad.nasir.ext)\
**Post date:** [December 5, 2023, 4:22am UTC](https://forum.social.plus/t/create-user-through-backend-api/998/1 "2023-12-05T04:22:51Z")

</div>

Hi,

I am looking for a way to create users from back-end API. What I can read from [here](https://docs.amity.co/amity-sdk/core-concepts/user/create-user) is that I can create user by creating his session ([API endpoint is here](https://api-docs.amity.co/#/Session/post_api_v4_sessions)) If secure mode is enabled than it will ignore displayName as well while creating a new user. I want to create user with his avatar as well. Let me know if that is enable through session only?

The best is if I can create in a single call and if that is not possible than please confirm the following flow

- Create a new user with Session API
- Upload avatar file through File API (Can skip in case of avatarCustomUrl)
- Update user info by [Amity API](https://api-docs.amity.co/#/UserV3/put_api_v3_users)

Regards,  
Nasir

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [December 5, 2023, 12:39pm UTC](https://forum.social.plus/t/create-user-through-backend-api/998/2 "2023-12-05T12:39:47Z")

</div>

Hello, the steps you have listed are accurate. The avatar will need to be updated later using the user update API, as you mentioned in the third bullet point.

Please let us know if you have further questions.

---

<div class="post-metadata">

**Author:** ![hossam](https://avatars.discourse-cdn.com/v4/letter/h/e8c25b/32.png) [@hossam](https://forum.social.plus/u/hossam)\
**Post date:** [January 12, 2024, 3:31am UTC](https://forum.social.plus/t/create-user-through-backend-api/998/3 "2024-01-12T03:31:32Z")

</div>

Please can you help me upload avatar , file , image .  
because when i upload file or image and make get user information doesn’t return any file or image that i upload for this user

---

<div class="post-metadata">

**Author:** ![muhammad.nasir.ext](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@muhammad.nasir.ext](https://forum.social.plus/u/muhammad.nasir.ext)\
**Post date:** [January 12, 2024, 4:56am UTC](https://forum.social.plus/t/create-user-through-backend-api/998/4 "2024-01-12T04:56:20Z")

</div>

@hossam After uploading image to file API you need to set the uploaded fileId to ```  
avatarFileId

```auto

https://api-docs.amity.co/#/UserV3/put_api_v3_users
```

---

<div class="post-metadata">

**Author:** ![hossam](https://avatars.discourse-cdn.com/v4/letter/h/e8c25b/32.png) [@hossam](https://forum.social.plus/u/hossam)\
**Post date:** [January 12, 2024, 3:54pm UTC](https://forum.social.plus/t/create-user-through-backend-api/998/5 "2024-01-12T15:54:33Z")

</div>

and this step for the file and video also ?

---

<div class="post-metadata">

**Author:** ![hossam](https://avatars.discourse-cdn.com/v4/letter/h/e8c25b/32.png) [@hossam](https://forum.social.plus/u/hossam)\
**Post date:** [January 12, 2024, 3:59pm UTC](https://forum.social.plus/t/create-user-through-backend-api/998/6 "2024-01-12T15:59:29Z")

</div>

and when try to upload file how can put the access token for the user I put it in the header or what .  
and finally if you have any social network can contact you on it , can you share it with me please?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [January 12, 2024, 5:10pm UTC](https://forum.social.plus/t/create-user-through-backend-api/998/7 "2024-01-12T17:10:56Z")

</div>

Hello, if you are referring to uploading file and video in general, please look at these endpoints for upload:

- [Amity API](https://api-docs.amity.co/#/File/post_api_v4_images)
- [Amity API](https://api-docs.amity.co/#/File/post_api_v4_files)
- [Amity API](https://api-docs.amity.co/#/File/post_api_v4_videos)

Regarding the access token, yes, you can pass it in the header as the bearer token. Please see the sample below:

curl --location ‘[https://api.sg.amity.co/api/v4/videos](https://api.sg.amity.co/api/v4/videos)’   
–header ‘accept: application/json’   
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkdTLWNDSUFib1IyQUhfQXczY29Bb0VtR1ZkdzFfaxxxxx’   
–form ‘files=@“/Users/Screen Recording 2567-01-08 at 16.47.22.mov”’   
–form ‘feedType=@“/path/to/file”’

---

<div class="post-metadata">

**Author:** ![hossam](https://avatars.discourse-cdn.com/v4/letter/h/e8c25b/32.png) [@hossam](https://forum.social.plus/u/hossam)\
**Post date:** [January 12, 2024, 7:12pm UTC](https://forum.social.plus/t/create-user-through-backend-api/998/8 "2024-01-12T19:12:23Z")

</div>

Hello I have user and I will upload for this user avatar and image , file and video , so I need to make this and when i try to get user information I need to get this files also but when i make get users the files doesn’t contains anything
