# Use of "type" parameter in Resource Objects

**URL:** <https://discuss.jsonapi.org/t/use-of-type-parameter-in-resource-objects/2468>\
**Category:** Uncategorized\
**Created:** [July 7, 2022, 9:52am UTC](https://discuss.jsonapi.org/t/use-of-type-parameter-in-resource-objects/2468 "2022-07-07T09:52:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vitox](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@vitox](https://discuss.jsonapi.org/u/vitox)\
**Post date:** [July 7, 2022, 9:52am UTC](https://discuss.jsonapi.org/t/use-of-type-parameter-in-resource-objects/2468/1 "2022-07-07T09:52:07Z")

</div>

Under [JSON:API — Latest Specification (v1.0)](https://jsonapi.org/format/#crud-creating) it says, that any POST-request MUST include a single Resource-Object [JSON:API — Latest Specification (v1.0)](https://jsonapi.org/format/#document-resource-objects).

The question is, is there a propper use for the type parameter of the resource-object in a POST-request

---

<div class="post-metadata">

**Author:** ![fdrake](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/fdrake/32/654_2.png) [@fdrake](https://discuss.jsonapi.org/u/fdrake)\
**Post date:** [July 7, 2022, 5:29pm UTC](https://discuss.jsonapi.org/t/use-of-type-parameter-in-resource-objects/2468/2 "2022-07-07T17:29:08Z")

</div>

It clearly indicates the type of resource to create. While some collections are homogeneous, and the examples in the specification appear to follow that pattern, that’s not required by JSON:API.

It’s also worth noting that nothing make the homogeneity of a collection directly discoverable via JSON:API. Therefore, it’s best for the client to always be explicit about expectations. In the case of a homogeneous collection, the `type` in the POSTed resource object allows the server to verify that the client’s expectation matches what the server is willing to provide: if the `type` doesn’t correlate with what’s allowed for the collection, an appropriate error can be returned.

-Fred
