User API "lastModified" and "archived" field empty?

I tested these users APIs.

I was expecting to get “lastModified” and “archived” with “at” and “by” data based on the document.

However, when I try to get those information, the fields “lastModified” and “archived” have nothing inside. I just see empty {}.

Is it just me?

Hi Aoki-san, it’s expected that you would see {} for lastModified and archived.

The way the API documentation is formatted doesn’t make this obvious, but the at and by fields are optional for lastModified and archived (if they were required, it would say required on them; since it doesn’t, they are optional), so {} is a valid value for those fields.

In practice, we currently would never provide at and by for these fields because we don’t record when a user was last modified or archived or who performed this action. This may change in the future, but at the moment, you will always get {}. The reason it’s designed this way is so that we can add this metadata in the future without introducing a breaking change.

Currently, if a user is active, the archived field would be omitted entirely, and if they are archived, you would get "archived": {}. The "lastModified" field would always be set to {}. Again, this may change in the future when we start recording this data.

2 Likes