# Alternative ways to update multiple objects

**URL:** <https://discuss.jsonapi.org/t/alternative-ways-to-update-multiple-objects/952>\
**Category:** Uncategorized\
**Created:** [April 13, 2017, 7:16am UTC](https://discuss.jsonapi.org/t/alternative-ways-to-update-multiple-objects/952 "2017-04-13T07:16:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![michaelhibay](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/michaelhibay/32/405_2.png) [@michaelhibay](https://discuss.jsonapi.org/u/michaelhibay)\
**Post date:** [April 14, 2017, 3:24pm UTC](https://discuss.jsonapi.org/t/alternative-ways-to-update-multiple-objects/952/2 "2017-04-14T15:24:57Z")

</div>

~~Here’s a thought, why not just manage it yourself as an async resource?~~

EDIT: Ok, actually read the comment and I think that is exactly his suggestion. Maybe without the async part.

The way I would approach this is to create a resource which represents a bulk operation, maybe not even on the errand resource. I wouldn’t concern myself with what the operation is, the resource representation should give that information.

```
/bulktransactions/.....
```

That way your payload could be something like this:

```
{
  "data": {
    "type": "bulktransaction",
    "attributes": {
      "resources": [{"type":"errands"}],
      "operations": [
        {"id":123,"method":"PATCH", "payload":1},
        {"id":124,"method":"PATCH", "payload":1},
        {"id":125,"method":"PATCH","payload":1}
      ],
      "payload":[
        {"id":1,
          "value":{
            "data": {
              "type": "errands",
              "attributes": {
                "dirty": true
              }
            }
          }
        }
      ]
    }
  }
}
```

You could return a location header for the bulk transaction resource itself, and get all the info and updates you needed from there.

---

_[View the full topic](https://discuss.jsonapi.org/t/alternative-ways-to-update-multiple-objects/952)._
