# What do you assert on when doing API testing?

**URL:** <https://club.ministryoftesting.com/t/what-do-you-assert-on-when-doing-api-testing/48635>\
**Category:** Archive\
**Tags:** automation, api-testing\
**Created:** [22 March 2021 08:00 UTC](https://club.ministryoftesting.com/t/what-do-you-assert-on-when-doing-api-testing/48635 "2021-03-22T08:00:49Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![meowy24](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/meowy24/32/8234_2.png) [@meowy24](https://club.ministryoftesting.com/u/meowy24)\
**Post date:** [22 March 2021 09:32 UTC](https://club.ministryoftesting.com/t/what-do-you-assert-on-when-doing-api-testing/48635/5 "2021-03-22T09:32:30Z")

</div>

- Status codes and response times are great things to assert on every request.
- Check the response is coming back how you expect. you can assert the format (is it a string, object, array, null?)
- if you’ve changed data with your POST or PUT/PATCH is that coming back in the response?
- Checking validation. Does the response have error text you can validate and make assertions against?
- Assert any headers that are being returned and they are in the correct format?
- Assert a token is being returned?
- If you supply an invalid verb for that request you can assert to response.

---

_[View the full topic](https://club.ministryoftesting.com/t/what-do-you-assert-on-when-doing-api-testing/48635)._
