# Guaranteed fields for user records in API responses

**URL:** <https://community.auth0.com/t/guaranteed-fields-for-user-records-in-api-responses/65126>\
**Category:** Get Help\
**Tags:** users, schema, management-api\
**Created:** [June 26, 2021, 4:13pm UTC](https://community.auth0.com/t/guaranteed-fields-for-user-records-in-api-responses/65126 "2021-06-26T16:13:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sazzer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sazzer/32/27418_2.png) [@sazzer](https://community.auth0.com/u/sazzer)\
**Post date:** [June 26, 2021, 4:13pm UTC](https://community.auth0.com/t/guaranteed-fields-for-user-records-in-api-responses/65126/1 "2021-06-26T16:13:30Z")

</div>

Plugging in the Management API for managing user records, and I notice that the docs claim that _every_ field is optional. Is that really the case? If so, that implies that the empty JSON object - `{}` - is a perfectly valid response for getting user details.

If it’s not the case, is there anything that tells me which fields I can guarantee will always be present? I assume things like `user_id` and `created_at` are always going to be present, but the API docs say otherwise.

Cheers

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 28, 2021, 8:55pm UTC](https://community.auth0.com/t/guaranteed-fields-for-user-records-in-api-responses/65126/3 "2021-06-28T20:55:45Z")

</div>

Hi @sazzer,

Can you tell us specifically which endpoint you are referring to? E.G. `POST/api/v2/users`

---

<div class="post-metadata">

**Author:** ![sazzer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sazzer/32/27418_2.png) [@sazzer](https://community.auth0.com/u/sazzer)\
**Post date:** [June 28, 2021, 9:29pm UTC](https://community.auth0.com/t/guaranteed-fields-for-user-records-in-api-responses/65126/4 "2021-06-28T21:29:08Z")

</div>

I mean, that would have been helpful, wouldn’t it?

It’s “GET /api/v2/users/{id}”.

Cheers

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 28, 2021, 9:46pm UTC](https://community.auth0.com/t/guaranteed-fields-for-user-records-in-api-responses/65126/5 "2021-06-28T21:46:35Z")

</div>

Thanks 😄

The reason that all response fields are considered optional is because you can request a response with only specific fields. The important note from doc of the fields param:

> **Fields** `string` Comma-separated list of fields to include or exclude (based on value provided for include\_fields) in the result. Leave empty to retrieve all fields.

This option makes it possible for every field to be optional in the response. As an example, you could exclude the `user_id` field from the response, even though the user’s profile contains a valid user id, making user\_id an optional response field.

I agree though, it is confusing to have every field labeled optional.

---

<div class="post-metadata">

**Author:** ![sazzer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sazzer/32/27418_2.png) [@sazzer](https://community.auth0.com/u/sazzer)\
**Post date:** [June 28, 2021, 11:09pm UTC](https://community.auth0.com/t/guaranteed-fields-for-user-records-in-api-responses/65126/6 "2021-06-28T23:09:22Z")

</div>

Ah - I’d missed that! However, is there anything that tells the fields that are guaranteed/optional _if you don’t exclude them_? If not, could I suggest that it would be useful? 🙂

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 29, 2021, 3:28pm UTC](https://community.auth0.com/t/guaranteed-fields-for-user-records-in-api-responses/65126/7 "2021-06-29T15:28:25Z")

</div>

I can’t find anything that indicates which fields are guaranteed in the user’s profile. I’d be happy to submit that feedback to our docs team. Thanks for the feedback!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 14, 2021, 3:28pm UTC](https://community.auth0.com/t/guaranteed-fields-for-user-records-in-api-responses/65126/8 "2021-07-14T15:28:46Z")

</div>

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