> ## Documentation Index
> Fetch the complete documentation index at: https://help.commbox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Stream Availability

> This API checks the availability status of a stream (channel) and returns its current state.

### Availability States

The API returns one of the following states:

- **0** - Channel is not active
- **1** - Available (during business hours with agents ready)
- **2** - Busy (agent overload during business hours)
- **3** - Unavailable (outside business hours or on special days)

### Query Parameters

**ignoreAutomationExsistance**

Controls whether automation (bot) availability is considered in the status check.

- **true** - Ignores automation presence (returns status based only on human agents)
- **false** (default) - Includes automation in availability check

*Note: Since bots are always available, including automation may mask Busy/Unavailable states.*

**autoAssign**

Filters agents based on their auto-assignment permissions.

- **true** - Returns Available (state 1) only if agents with auto-assignment enabled are available
- **false** (default) - Returns status regardless of auto-assignment settings

**includeDetails**

Controls the response format and level of detail.

- **true** - Returns detailed response with availability state, agent list, statuses, and permissions
- **false** (default) - Returns only the availability state number (0, 1, 2, or 3)

### Path Parameters

**SUBSTREAM_ID**

Required when subchannels are configured for the brand. Omit this parameter if subchannels are not in use.

**Usage Examples**

Without Subchannel (Single Query Parameter)
```
GET /streams/11345/streamavailability?includeDetails=true
```

With Subchannel (Multiple Query Parameters)
```
GET /streams/TbxH9RJIQrWI0hzA%3d%3d/substreams/12/streamavailability?ignoreAutomationExsistance=false&autoAssign=true
```

### Voice Call Specific Behavior

For voice call streams, availability states have specific conditions:

#### State 1 (Available)
All of the following conditions must be met:
- Agents are active and online
- Agents are not currently on calls
- Agents have auto-assignment permission enabled for this stream/substream

#### State 2 (Busy)
- All agents with proper stream/substream permissions are currently on active calls

#### State 3 (Unavailable)
Any one of the following conditions triggers this state:
- Current time is outside business hours
- Special day is configured (holiday, maintenance, etc.)
- All agents are in AWAY status or inactive
- No active voice agents have the required auto-assignment permissions for this stream/substream

## OpenAPI

````json GET /streams/{STREAM_ID}/substreams/{SUBSTREAM_ID}/streamavailability
{
  "openapi": "3.0.3",
  "info": {
    "title": "CommBox API",
    "x-logo": {
      "url": "https://www.commbox.io/logo/commbox_logo_large.png"
    },
    "version": "2.07",
    "termsOfService": "https://www.commbox.io/end-user-license-agreement-eula/",
    "contact": {
      "name": "commbox",
      "url": "https://www.commbox.io",
      "email": "contactus@commbox.io"
    }
  },
  "servers": [
    {
      "url": "https://api.commbox.io/",
      "description": "Production server"
    }
  ],
  "paths": {
    "/streams/{STREAM_ID}/substreams/{SUBSTREAM_ID}/streamavailability": {
      "get": {
        "tags": [
          "Streams"
        ],
        "summary": "Get Stream Availability",
        "description": "This API checks the availability status of a stream (channel) and returns its current state.\n\n### Availability States\n\nThe API returns one of the following states:\n\n- **0** - Channel is not active\n- **1** - Available (during business hours with agents ready)\n- **2** - Busy (agent overload during business hours)\n- **3** - Unavailable (outside business hours or on special days)\n\n### Query Parameters\n\n**ignoreAutomationExsistance**\n\nControls whether automation (bot) availability is considered in the status check.\n\n- **true** - Ignores automation presence (returns status based only on human agents)\n- **false** (default) - Includes automation in availability check\n\n*Note: Since bots are always available, including automation may mask Busy/Unavailable states.*\n\n**autoAssign**\n\nFilters agents based on their auto-assignment permissions.\n\n- **true** - Returns Available (state 1) only if agents with auto-assignment enabled are available\n- **false** (default) - Returns status regardless of auto-assignment settings\n\n**includeDetails**\n\nControls the response format and level of detail.\n\n- **true** - Returns detailed response with availability state, agent list, statuses, and permissions\n- **false** (default) - Returns only the availability state number (0, 1, 2, or 3)\n\n### Path Parameters\n\n**SUBSTREAM_ID**\n\nRequired when subchannels are configured for the brand. Omit this parameter if subchannels are not in use.\n\n**Usage Examples**\n\nWithout Subchannel (Single Query Parameter)\n```\nGET /streams/11345/streamavailability?includeDetails=true\n```\n\nWith Subchannel (Multiple Query Parameters)\n```\nGET /streams/TbxH9RJIQrWI0hzA%3d%3d/substreams/12/streamavailability?ignoreAutomationExsistance=false&autoAssign=true\n```\n\n### Voice Call Specific Behavior\n\nFor voice call streams, availability states have specific conditions:\n\n#### State 1 (Available)\nAll of the following conditions must be met:\n- Agents are active and online\n- Agents are not currently on calls\n- Agents have auto-assignment permission enabled for this stream/substream\n\n#### State 2 (Busy)\n- All agents with proper stream/substream permissions are currently on active calls\n\n#### State 3 (Unavailable)\nAny one of the following conditions triggers this state:\n- Current time is outside business hours\n- Special day is configured (holiday, maintenance, etc.)\n- All agents are in AWAY status or inactive\n- No active voice agents have the required auto-assignment permissions for this stream/substream",
        "operationId": "Get_Stream_Availability",
        "parameters": [
          {
            "name": "STREAM_ID",
            "in": "path",
            "description": "A CommBox generated number for the channel",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "SUBSTREAM_ID",
            "in": "path",
            "description": "A CommBox generated number for the sub-channel",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ignoreAutomationExsistance",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "autoAssign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeDetails",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": 200
                    },
                    "description": {
                      "type": "string",
                      "example": "Operation successful"
                    },
                    "response_time": {
                      "type": "string",
                      "example": "2024-08-06T07:51:52.2581942Z"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "integer",
                          "example": 1
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - The request could not be understood by the server. Incoming parameters might not be valid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 400
                    },
                    "description": {
                      "type": "string",
                      "example": "Bad Request"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - The supplied credentials, if any, are not sufficient to access the resource",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 401
                    },
                    "description": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found - The requested resource is not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 404
                    },
                    "description": {
                      "type": "string",
                      "example": "Not Found"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - Too many requests have been made in a short period of time (Throttling)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 429
                    },
                    "description": {
                      "type": "string",
                      "example": "Too Many Requests"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server Error - The server could not return the representation due to an internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 500
                    },
                    "description": {
                      "type": "string",
                      "example": "Internal Server Error"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
````

