title: How to POST relation in Strapi
body: <p>I'm trying to do a POST to the Strapi API and can't seem to figure out how to attach a 'has and belongs to many' (many to many) relationship.</p>
  <p>I've already tried the following body's:</p>
  <pre><code>events: [&quot;ID&quot;, &quot;ID&quot;]
  name: &quot;name&quot;
  </code></pre>
  <p>&amp;</p>
  <pre><code>events: [ID, ID]
  name: &quot;name&quot;
  </code></pre>
  <p>Which regarding the <a href="https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#models" rel="nofollow noreferrer">docs</a> should be right, I think.</p>
  <p>There's no error, I get a '200 OK' response. It adds the record but without the relations.</p>
  <p>Event.settings.json:</p>
  <pre><code>{
    &quot;connection&quot;: &quot;default&quot;,
    &quot;collectionName&quot;: &quot;events&quot;,
    &quot;info&quot;: {
      &quot;name&quot;: &quot;event&quot;,
      &quot;description&quot;: &quot;&quot;
    },
    &quot;options&quot;: {
      &quot;increments&quot;: true,
      &quot;timestamps&quot;: [
        &quot;created_at&quot;,
        &quot;updated_at&quot;
      ],
      &quot;comment&quot;: &quot;&quot;
    },
    &quot;attributes&quot;: {
      &quot;name&quot;: {
        &quot;type&quot;: &quot;string&quot;
      },
      &quot;artists&quot;: {
        &quot;collection&quot;: &quot;artist&quot;,
        &quot;via&quot;: &quot;events&quot;,
        &quot;dominant&quot;: true
      }
    }
  }
  </code></pre>
  <p>Artist.settings.json:</p>
  <pre><code>{
    &quot;connection&quot;: &quot;default&quot;,
    &quot;collectionName&quot;: &quot;artists&quot;,
    &quot;info&quot;: {
      &quot;name&quot;: &quot;artist&quot;,
      &quot;description&quot;: &quot;&quot;
    },
    &quot;options&quot;: {
      &quot;increments&quot;: true,
      &quot;timestamps&quot;: [
        &quot;created_at&quot;,
        &quot;updated_at&quot;
      ],
      &quot;comment&quot;: &quot;&quot;
    },
    &quot;attributes&quot;: {
      &quot;name&quot;: {
        &quot;required&quot;: true,
        &quot;type&quot;: &quot;string&quot;
      },
      &quot;events&quot;: {
        &quot;collection&quot;: &quot;event&quot;,
        &quot;via&quot;: &quot;artists&quot;
      }
    }
  }
  </code></pre>
  <p>I'm using the standard SQLite database, strapi version 3.0.0-beta.13 and tried the request through Postman, HTML &amp; curl.</p>
  <p>I would love to know how to attach the relation on POST</p>
  <p><strong>Update 23-07:</strong></p>
  <p>Did a fresh install of Strapi and now everything is working.</p>