Show user name instead id in collection

Hi,

does anyone know if it is possible to get the related users name instead of the id when doing an GET request to a collection. In the response there is only the id of the “created_by” person, but I need his first and last name to be part of the response.

Hope anyone can help with this.

Yes, it’s possible. created_by is a relational field, so Directus only returns the ID by default.
You can request specific nested fields like this:

GET /items/your_collection?fields=*,created_by.first_name,created_by.last_name

This will return the full user object with the name instead of just the ID.

Thank you so much !
That helps me lot :blush: