# How to set First and Last name with /account/registration/?

**URL:** https://discuss.openedx.org/t/how-to-set-first-and-last-name-with-account-registration/3711
**Category:** Development
**Tags:** api
**Created:** [November 27, 2020, 2:02am UTC](https://discuss.openedx.org/t/how-to-set-first-and-last-name-with-account-registration/3711 "2020-11-27T02:02:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rhasan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/rhasan/32/1831_2.png) [@rhasan](https://discuss.openedx.org/u/rhasan)
#### Post date: [November 27, 2020, 2:02am UTC](https://discuss.openedx.org/t/how-to-set-first-and-last-name-with-account-registration/3711/1 "2020-11-27T02:02:38Z")

</div>

Hi,

Im trying to figure out how to set **First Name and Last Name** when I create users using the account/registration/ endpoint.

Here is what Ive got:

**EDX version** :  
3.2.14

**POST URL** :  
…/user\_api/v1/account/registration/

**Data:**  
name=“Lorem Ipsum”  
[email="lorem@ipsum.com](mailto:email=%22lorem@ipsum.com)"  
username=“L1”  
password=“123456789”  
honor\_code=“true”

**Result:**  
User Created and visible at  
…/admin/auth/user/{userID}/change

–

**Missing Name Fields:**  
Personal info \> First Name  
Personal info \> Last Name

**Correctly Set Name Field:**  
User Profile \> Name

–

So basically, there are 2 different sections for name, one is set the other is not.

Also, where is this API Endpoint documented? I only found out about it after reading this post:

> [@REST API Documentation](https://discuss.openedx.org/t/rest-api-documentation/3001):
>
> I am creating this topic so that we can have good documentation for all REST API endpoints which are currently available in the open edX platform. Where can I find the REST API endpoint for user creation? I have seen this question very often on the discussion forum and on the slack channels. And yes, we have an [endpoint](https://github.com/edx/edx-platform/blob/open-release/juniper.master/openedx/core/djangoapps/user_authn/urls_common.py#L27#L28) for this. Normally when anyone lookup for the API for open edX they (or me) end up with this link: [https://courses.edx.org/api-docs/](https://courses.edx.org/api-docs/). This link has APIs listed but some of t…

---

<div class="post-metadata">

### Author: ![braden](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/braden/32/46_2.png) [@braden](https://discuss.openedx.org/u/braden)
#### Post date: [November 27, 2020, 9:51pm UTC](https://discuss.openedx.org/t/how-to-set-first-and-last-name-with-account-registration/3711/2 "2020-11-27T21:51:06Z")

</div>

Hi @rhasan,

As Open edX is an international product, it is designed to work with names from around the world, which often don’t fall into the simple “First Name” + “Last Name” formula. [Here’s a good article from the W3C showing examples of why that doesn’t work](https://www.w3.org/International/questions/qa-personal-names).

I believe that the “First Name” + “Last Name” fields you’re seeing exist in the Django admin and in the underlying data model, because they are provided by the framework that Open edX is built on, but Open edX itself doesn’t use those fields. So it’s safe/best to just leave them blank.

My recommendation is to change your business logic so that you only work with full names and don’t need the First Name / Last Name split. Alternatively, you can create your own API to get/set the `first_name` and `last_name` fields that exist in the database, but you’ll have to understand that those fields will be ignored by the platform and won’t be used by any of the standard APIs. You can use [this extension point](https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/customize_registration_page.html) to add additional fields to the registration form, including “First name” and “Last name”, if required.

---

<div class="post-metadata">

### Author: ![jramnai](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/jramnai/32/87_2.png) [@jramnai](https://discuss.openedx.org/u/jramnai)
#### Post date: [November 28, 2020, 6:49am UTC](https://discuss.openedx.org/t/how-to-set-first-and-last-name-with-account-registration/3711/3 "2020-11-28T06:49:24Z")

</div>

Hello @rhasan,

> [@rhasan](#):
>
> Also, where is this API Endpoint documented? I only found out about it after reading this post:

This API endpoint is not documented yet but the upstream [PR](https://github.com/edx/edx-platform/pull/25020) is in review state.

---

<div class="post-metadata">

### Author: ![guruprasad](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/guruprasad/32/303_2.png) [@guruprasad](https://discuss.openedx.org/u/guruprasad)
#### Post date: [December 10, 2020, 10:45am UTC](https://discuss.openedx.org/t/how-to-set-first-and-last-name-with-account-registration/3711/4 "2020-12-10T10:45:04Z")

</div>

@rhasan, there are many more additional fields that can be added to the registration form but are not enabled by default ([code](https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/user_authn/views/registration_form.py#L300)). To enable additional fields, you can configure them by specifying appropriate values for `REGISTRATION_EXTRA_FIELDS` either in the settings (via `lms.yml`) or in `SiteConfiguration`.

Though the Django User model has support for fields like ‘first name’, ‘last name’ etc., you will see that the platform stores these as key-value pairs in the `UserProfile.meta` field instead.

Some of these fields can be enabled and made visible in the Account Settings page by configuring the extended profile fields ([code](https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/user_api/accounts/settings_views.py#L217)).

---

<div class="post-metadata">

### Author: ![rhasan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/rhasan/32/1831_2.png) [@rhasan](https://discuss.openedx.org/u/rhasan)
#### Post date: [March 1, 2021, 8:45am UTC](https://discuss.openedx.org/t/how-to-set-first-and-last-name-with-account-registration/3711/5 "2021-03-01T08:45:00Z")

</div>

@guruprasad  
So how do I add it to `SiteConfiguration`?

This is what I got and it doesnt work:  
{  
“REGISTRATION\_EXTRA\_FIELDS”: {  
“first\_name”: “required”  
}  
}

---

<div class="post-metadata">

### Author: ![rhasan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/rhasan/32/1831_2.png) [@rhasan](https://discuss.openedx.org/u/rhasan)
#### Post date: [March 1, 2021, 8:55am UTC](https://discuss.openedx.org/t/how-to-set-first-and-last-name-with-account-registration/3711/6 "2021-03-01T08:55:45Z")

</div>

Similarly, if I do the following it doesnt work and I still see the field on the form:

“REGISTRATION\_EXTRA\_FIELDS”:{“country”:“hidden”}
