# Running monitor to check API availability

**URL:** <https://community.postman.com/t/running-monitor-to-check-api-availability/35803>\
**Category:** Help Hub\
**Created:** [May 31, 2022, 6:22pm UTC](https://community.postman.com/t/running-monitor-to-check-api-availability/35803 "2022-05-31T18:22:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![automationtester2496](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@automationtester2496](https://community.postman.com/u/automationtester2496)\
**Post date:** [May 31, 2022, 6:22pm UTC](https://community.postman.com/t/running-monitor-to-check-api-availability/35803/1 "2022-05-31T18:22:58Z")

</div>

I have a basic test in my collection to check if the API returns a “Status code is 200”. When I run this via the collection it passes. But when I run it via the monitor it fails with the following error. Any thoughts?

```auto
pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
});

```

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/0/02b7ba8904f9c42ca366d69277ce07cf3150f167.png)
