<turbo-stream action="update" target="wiki_3611_3715_subpage_3721_info"><template>
<p>Below you see an example of how to delete aconnection. Examples both in JSON and JSONAPI of. </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><p></p>
<pre class="card">curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/json" 
  -H "Accept: application/json"
  -X DELETE
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/connections/2
</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 DELETE
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/connections/2
</pre>
<p>The output for both JSON and JSONAPI on successful deletion is that the response code <code>Status: 204 No Content</code> is returned.</p>

<p>For both JSON and JSONAPI the output when your deletion has failed (ex. connection has already been deleted / does not exist) the response code <code>Status: 404 Not Found</code> is returned + an error message:</p>
<pre class="card">Status: 404 Not Found

...

{"errors":[{"source":{"pointer":"/data/attributes/id"},"detail":"Could not find Connection with id 2"}]}
</pre>
</template></turbo-stream>
<turbo-stream action="prepend" target="flash"><template></template></turbo-stream>
