# Creating a staged user with an API call

**URL:** https://meta.discourse.org/t/creating-a-staged-user-with-an-api-call/84667
**Category:** Development
**Tags:** rest-api
**Created:** [April 5, 2018, 7:19pm UTC](https://meta.discourse.org/t/creating-a-staged-user-with-an-api-call/84667 "2018-04-05T19:19:10Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [February 24, 2020, 9:08pm UTC](https://meta.discourse.org/t/creating-a-staged-user-with-an-api-call/84667/8 "2020-02-24T21:08:45Z")

</div>

The only parameter this endpoint takes is a valid `email` message:

```plaintext
curl -i -sS -X POST "http://localhost:3000/admin/email/handle_mail" \
-H "Api-Key: 852b2d8556777aeb62346e0d8b36ed248a89b03f0261165a685c0aae9c8c2fdd" \
-H "Api-Username: system" \
-F "email=Date: Mon, 24 Feb 2020 13:13:34 -0700
From: stageduser2@example.com
To: awesome@example.com
Subject: test email5

This is a sample email message.
"

```

You will need to make sure you enable `email_in` correctly setup your category or group to receive these emails:

> [@Configuring incoming email to create new topics or group messages](https://meta.discourse.org/t/start-a-new-topic-via-email-e-mail/62977):
>
> bookmark This guide explains how to set up incoming emails to create new topics or group messages in Discourse, including configuration of site settings and category or group-specific settings. person_raising_hand Required user level: Administrator This guide covers: Enabling and configuring incoming emails Choosing between category and group for incoming emails Setting up incoming emails for a group Setting up incoming emails for a category Deciding how forwarded emails are handled …

> [@dm.linov](#):
>
> Also, did I get it right, that such a user will receive notifications for new posts in such a topic and will be able to reply to it via email?

Yes, I believe so.

> [@dm.linov](#):
>
> And what happens, if I try to create a staged user and a topic via an API call with an email address that belongs to an active user? Will this topic be created on behalf of such user?

Yes, the topic will be created on behalf of the user.

---

_[View the full topic](https://meta.discourse.org/t/creating-a-staged-user-with-an-api-call/84667)._
