# I cannot get the relation of an collection

**URL:** <https://community.directus.com/t/i-cannot-get-the-relation-of-an-collection/1629>\
**Category:** Help\
**Tags:** api\
**Created:** [December 6, 2025, 7:16pm UTC](https://community.directus.com/t/i-cannot-get-the-relation-of-an-collection/1629 "2025-12-06T19:16:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HeapReaper](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/heapreaper/32/1213_2.png) [@HeapReaper](https://community.directus.com/u/HeapReaper)\
**Post date:** [December 6, 2025, 7:16pm UTC](https://community.directus.com/t/i-cannot-get-the-relation-of-an-collection/1629/1 "2025-12-06T19:16:44Z")

</div>

Hi!

So i’ve 2 collections: `Team` and `Rollen` with in `Rollen` the fields `id` and `naam`.  
Now i’ve made a Many-to-Many relationship between `Team` and `Rollen`with as key `Rol`. It shows the junction as `Team_Rollen`.

In `Access Policies` → `Public`i have allowed `Team`, `Rollen` and `Team_Rollen` to be publicly accessible.

I query it with: `/items/Team` tho i only get the role ID of that team:

```auto
    {
      "id": 1,
      "avatar": "199bc1ca-8c96-4b9f-b836-bdb4a6f1a087",
      "naam": "HeapReaper",
      "Rol": [
        1
      ]
    },

```

I did figgle around with `?fields=` tho i can’t seem to figure it out.  
Help is appriciated!

---

<div class="post-metadata">

**Author:** ![ahmad\_quvor](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/ahmad_quvor/32/310_2.png) [@ahmad\_quvor](https://community.directus.com/u/ahmad_quvor)\
**Post date:** [December 7, 2025, 6:57am UTC](https://community.directus.com/t/i-cannot-get-the-relation-of-an-collection/1629/2 "2025-12-07T06:57:43Z")

</div>

I think this might be two separate things happening:

## 1) Expanding the many-to-many relation

For a M2M field like `Rol`, Directus returns only the IDs unless you tell it to expand the related items. Try a query like:

`/items/Team?fields=*,Rol.*`

or, if your junction uses something like `Rollen_id`, then:

`/items/Team?fields=*,Rol.Rollen_id.*`

(Just replace the field name with whatever you see inside the junction.)

* * *

## 2) Permissions / Access Policy

If you’re calling the API **with a token** , Directus will **not** use the `Public` role.  
Access policies for `Public` only apply when the request is made **without** any token.

So if the token’s role doesn’t have access to `Rollen` or `Team_Rollen`, the API will only show IDs.

Try either:

- Removing the Authorization header to test `Public` access, **or**
- Giving the authenticated role permissions for `Rollen` and the junction table.

---

<div class="post-metadata">

**Author:** ![jonathanwagner](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/jonathanwagner/32/47_2.png) [@jonathanwagner](https://community.directus.com/u/jonathanwagner)\
**Post date:** [December 8, 2025, 5:30pm UTC](https://community.directus.com/t/i-cannot-get-the-relation-of-an-collection/1629/3 "2025-12-08T17:30:00Z")

</div>

Ahmad has provided the correct answers for the fields parameter. Some helpful resources to review in our docs:

- [https://directus.io/docs/guides/connect/relations](https://directus.io/docs/guides/connect/relations)
- [https://directus.io/docs/guides/connect/query-parameters#fields](https://directus.io/docs/guides/connect/query-parameters#fields)

Regarding M2M relationships:

- fields=`*` —\> returns all fields in the current collection (relational fields will be foreign key value)
- fields=`m2m_field.*` –\> returns all junction table fields (junction PK, FK current collection, FK far collection, if any exist also includes direct fields in the junction table)
- fields=`m2m_field.far_table_fk.*` –\> returns all fields in the far collection

Hope this helps!
