# Schema for many-to-many relations for custom integration

**URL:** <https://community.fibery.io/t/schema-for-many-to-many-relations-for-custom-integration/6672>\
**Category:** API & Programming\
**Created:** [September 19, 2024, 1:48pm UTC](https://community.fibery.io/t/schema-for-many-to-many-relations-for-custom-integration/6672 "2024-09-19T13:48:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nvee](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/nvee/32/6860_2.png) [@nvee](https://community.fibery.io/u/nvee)\
**Post date:** [September 19, 2024, 1:48pm UTC](https://community.fibery.io/t/schema-for-many-to-many-relations-for-custom-integration/6672/1 "2024-09-19T13:48:30Z")

</div>

I found [the docs on relations](https://the.fibery.io/@public/User_Guide/Guide/Custom-App-REST-Endpoints-272/anchor=Relations--3468502a-5a32-4179-88e6-02f547969e13) for custom integrations but it doesn’t have an example of the required schema for a many-to-many relation. I’m not sure what’s required on either property to make it all work. Does anyone have an example schema of many-to-many relations?

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [September 19, 2024, 3:07pm UTC](https://community.fibery.io/t/schema-for-many-to-many-relations-for-custom-integration/6672/2 "2024-09-19T15:07:22Z")

</div>

It’s pretty much the same as the many-to-one schema, e.g.

```auto
"repositoryIds": {
      "type": "text",
      "name": "Repository Ids",
      "relation": {
        "cardinality": "many-to-many",
        "name": "Repositories",
        "targetName": "Pull Requests",
        "targetType": "repository",
        "targetFieldId": "id"
      }
    }

```

---

<div class="post-metadata">

**Author:** ![nvee](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/nvee/32/6860_2.png) [@nvee](https://community.fibery.io/u/nvee)\
**Post date:** [September 19, 2024, 3:39pm UTC](https://community.fibery.io/t/schema-for-many-to-many-relations-for-custom-integration/6672/3 "2024-09-19T15:39:29Z")

</div>

OK, is it required to have the inverse of this on the Repository as well?

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [September 19, 2024, 3:57pm UTC](https://community.fibery.io/t/schema-for-many-to-many-relations-for-custom-integration/6672/4 "2024-09-19T15:57:36Z")

</div>

Nope. Just define it from one side of the relation
