# API bug? Spaces not allowed in user/profile/organization?

**URL:** <https://devforum.okta.com/t/api-bug-spaces-not-allowed-in-user-profile-organization/8372>\
**Category:** Questions\
**Created:** [March 6, 2020, 5:05am UTC](https://devforum.okta.com/t/api-bug-spaces-not-allowed-in-user-profile-organization/8372 "2020-03-06T05:05:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwpllpz](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mwpllpz](https://devforum.okta.com/u/mwpllpz)\
**Post date:** [March 6, 2020, 5:05am UTC](https://devforum.okta.com/t/api-bug-spaces-not-allowed-in-user-profile-organization/8372/1 "2020-03-06T05:05:06Z")

</div>

Am I missing documentation that would explain why spaces would not be allowed in the organization field when creating a user with the Users API?

Using [CreateUserWithPassword](https://developer.okta.com/docs/reference/api/users/#create-user-with-password) in curl I am entirely successful when there are no spaces in the organization field of the json like this:

`{"profile":{"email":"help@me.com","login":"help@me.com","firstName":"Firstname","lastName":"Lastname","organization":"MyCompanyLLC"},"credentials":{"password":{"value":"mypassword"},"recovery_question":{"question":"something","answer":"different"}}}`

But when I use this:

`{"profile":{"email":"help@me.com","login":"help@me.com","firstName":"Firstname","lastName":"Lastname","organization":"My Company LLC"},"credentials":{"password":{"value":"mypassword"},"recovery_question":{"question":"something","answer":"different"}}}`

…I get scolded with a

`{"errorCode":"E0000003","errorSummary":"The request body was not well-formed.","errorLink":"E0000003","errorId":"oaehWVoh6c5Rs2VSOV2sh0GiQ","errorCauses":[]}`

Are there other fields where this “rule” applies? Are there other “rules” I won’t find out until I get deeper into a database import?

* * *

Update: Here’s another. What the heck? How many unwritten rules am I going to find out about in this process, and who cares if I leave the first and last names blank in the API? Prince can’t have an account?

`"errorCauses":[{"errorSummary":"firstName: The field cannot be left blank"},{"errorSummary":"lastName: The field cannot be left blank"}`

---

<div class="post-metadata">

**Author:** ![chu123](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/chu123/32/1816_2.png) [@chu123](https://devforum.okta.com/u/chu123)\
**Post date:** [March 6, 2020, 2:09pm UTC](https://devforum.okta.com/t/api-bug-spaces-not-allowed-in-user-profile-organization/8372/2 "2020-03-06T14:09:34Z")

</div>

For some fields, look at the profile editor in the admin console. It will tell you - for example - that the firstName and lastName attributes are REQUIRED. (You can change this requirement using the admin console).

Can’t comment on the organization issue.

[EDIT] PS: Perhaps using the schemas API will help you determine in advance what input validation might be required? [https://developer.okta.com/docs/reference/api/schemas/](https://developer.okta.com/docs/reference/api/schemas/)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 23, 2024, 10:47pm UTC](https://devforum.okta.com/t/api-bug-spaces-not-allowed-in-user-profile-organization/8372/3 "2024-01-23T22:47:32Z")

</div>

Closed on January 23, 2024, 10:47pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
