<turbo-stream action="update" target="wiki_3611_3666_subpage_3668_info"><template>
<p>Below you see an example on how to update a group for example if you need to change the description. Examples both in JSON and JSONAPI are provided.

</p><p>NOTE: Remember to substitute the token (after Bearer) and the service id (the "[SERVICE ID]" below) to your own token and service id.</p>
<p></p><h2>JSON:</h2>
<pre class="card">curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/json" 
  -H "Accept: application/json"
  -X PATCH
  -d "{\"code\":\"INVOICE_DK\",\"description\":\"Invoice Transfers DK\"}"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/groups/5
</pre>
<p>The out-put for this example would be:</p>
<pre class="card">{
  "code": "INVOICE_DK",
  "description": "Invoice Transfers DK",
  "comments": []
}
</pre>
<p></p><h2>JSONAPI:</h2><p></p>
<pre class="card">curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/vnd.api+json" 
  -H "Accept: application/vnd.api+json"
  -X PATCH
  -d "{\"data\":{\"id\":\"5\",\"type\":\"groups\",\"attributes\": {\"code\":\"INVOICE_DK\",\"description\":\"Invoice Transfers DK\"} }}"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/groups/5
</pre>
<p>The out-put for this example would be:</p>
<pre class="card">{
  "data": {
    "id":"5",
    "type": "groups",
    "attributes":{
      "code": "INVOICE_DK",
      "description": "Invoice Transfers DK"
    },
    "relationships": {
      "comments": {
        "data": []
      }
    }
  }
}
</pre>
</template></turbo-stream>
<turbo-stream action="prepend" target="flash"><template></template></turbo-stream>
