# API for service availability/contact center availability

**URL:** <https://community.brightpattern.com/t/api-for-service-availability-contact-center-availability/737>\
**Category:** Product Q&A\
**Created:** [May 13, 2022, 2:19am UTC](https://community.brightpattern.com/t/api-for-service-availability-contact-center-availability/737 "2022-05-13T02:19:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fasilab](https://avatars.discourse-cdn.com/v4/letter/f/ea5d25/32.png) [@fasilab](https://community.brightpattern.com/u/fasilab)\
**Post date:** [May 13, 2022, 2:19am UTC](https://community.brightpattern.com/t/api-for-service-availability-contact-center-availability/737/1 "2022-05-13T02:19:58Z")

</div>

is there any API to know whether a service and/or the contact center is available or not (Need to know when Contact center is closed or the service is closed for some reason)

---

<div class="post-metadata">

**Author:** ![Derek](https://sea2.discourse-cdn.com/flex020/user_avatar/community.brightpattern.com/derek/32/103_2.png) [@Derek](https://community.brightpattern.com/u/Derek)\
**Post date:** [September 29, 2022, 5:51am UTC](https://community.brightpattern.com/t/api-for-service-availability-contact-center-availability/737/2 "2022-09-29T05:51:21Z")

</div>

You could leverage the real-time statistics API to get a logged in Agent count for the Service and if it is less than 1 then assume closed.

Here is an example of a subscription I created for my tenant. Section 1 is the Agent grid. It is an empty array because I have no one logged in at this time.

{  
“1”: {  
“agent\_grids”: [  
{  
“id”: “1”,  
“values”:   
}  
]  
},  
“2”: {  
“stats\_totals”: {  
“in\_calls\_waiting”: “0”  
}  
},  
“3”: {  
“stats\_totals”: {  
“in\_calls\_in\_ivr”: “0”,  
“in\_callbacks\_waiting”: “0”,  
“in\_calls\_active\_on\_agents”: “0”,  
“out\_calls\_active\_on\_agents”: “0”,  
“out\_calls\_in\_progress”: “0”,  
“in\_average\_speed\_of\_answer”: “”,  
“in\_calls\_in\_progress”: “0”  
}  
}  
}

and here is an example after I login an agent in.

{  
“1”: {  
“agent\_grids”: [  
{  
“id”: “1”,  
“values”: [  
{  
“1”: “Derek Greenwood”,  
“2”: “1004”,  
“3”: “not\_ready”,  
“4”: “51”,  
“5”: “not\_ready”,  
“6”: null,  
“7”: null,  
“8”: null,  
“9”: null,  
“10”: null  
}  
]  
}  
]  
},  
“2”: {  
“stats\_totals”: {  
“in\_calls\_waiting”: “0”  
}  
},  
“3”: {  
“stats\_totals”: {  
“in\_calls\_in\_ivr”: “0”,  
“in\_callbacks\_waiting”: “0”,  
“in\_calls\_active\_on\_agents”: “0”,  
“out\_calls\_active\_on\_agents”: “0”,  
“out\_calls\_in\_progress”: “0”,  
“in\_average\_speed\_of\_answer”: “”,  
“in\_calls\_in\_progress”: “0”  
}  
}  
}

Here is a link to the API docs: [5.8:Real-time-statistics-api/ListofStatistics - Bright Pattern Documentation](https://help.brightpattern.com/5.8:Real-time-statistics-api/ListofStatistics)
