Concurrency status polling
# support
n
How can I poll the concurrency status via API? It isn't very clear in the documentation. I believe the concurrencyCounter needs to be retrieved via the analytics endpoint, but in my initial probing I haven't been able to retrieve any data from the subscription table. Please share specifics including structure of the query to be made.
k
Send a POST request to /analytics/queries with metrics: ["concurrencyCounter"], a valid timeRange in ISO format, and granularity, then parse the metricResults response for active call counts..
n
@Kings_big💫 Can you please be a little more specific about the request? The docs show only a single POST /analytics endpoint that accepts a queries array—there is no /analytics/queries. And I'm unable to query the 'concurrencyCounter' column. It would be great if you can just share the json structure. I'm able to retrieve historical concurrency in the following way with 'history' or 'max': curl -X POST https://api.vapi.ai/analytics \ -H "Authorization: Bearer xxx" \ -H "Content-Type: application/json" \ -d '{ "queries": [ { "table": "subscription", "name": "active_calls_concurrency", "operations": [ { "operation": "history", "column": "concurrency" } ], "timeRange": { "step": "hour", "start": "2025-05-20T12:59:21.000Z", "end": "2025-06-21T15:00:21.000Z" } } ] }' Response: [ { "name": "active_calls_concurrency", "timeRange": { "start": "2025-05-20T12:59:21.000Z", "end": "2025-06-21T15:00:21.000Z", "step": "hour", "timezone": "UTC" }, "result": [ { "date": "2025-05-30T21:00:00.000Z", "historyConcurrency": 0 }, { "date": "2025-06-02T10:00:00.000Z", "historyConcurrency": 1 }, ... ] } ]
@Vapi Support Bot Any help on this?
@Sahil Please take a look when you get a chance.
k
To query
concurrencyCounter
, send a POST to
/analytics
with a
queries
array using
"table": "call"
, an operation like
"history"
or
"max"
, the
"concurrencyCounter"
column, and a valid ISO
timeRange
with a `step`; results return as
{operation}ConcurrencyCounter
.. https://docs.vapi.ai/api-reference/analytics/get
n
@Kings_big💫 Based on your instructions: Request:
Copy code
{
  "queries": [
    {
      "table": "call",
      "name": "active_calls_concurrency",
      "operations": [
        {
          "operation": "max",
          "column": "concurrencyCounter"
        }
      ],
      "timeRange": {
        "step": "hour",
        "start": "2025-06-20T21:00:21.000Z",
        "end": "2025-06-21T15:00:21.000Z"
      }
    }
  ]
}
Response: {"message":["queries.0.operations.0.operation can't be
max
for column
concurrencyCounter
.
max
supports cost, duration, costBreakdown.llm, costBreakdown.stt, costBreakdown.tts, costBreakdown.ttsCharacters, costBreakdown.llmPromptTokens, costBreakdown.llmCompletionTokens, costBreakdown.vapi, concurrency columns","queries.0.operations.0.column must be one of the following values: id, cost, costBreakdown.llm, costBreakdown.stt, costBreakdown.tts, costBreakdown.vapi, costBreakdown.ttsCharacters, costBreakdown.llmPromptTokens, costBreakdown.llmCompletionTokens, duration, concurrency, minutesUsed"],"error":"Bad Request","statusCode":400} Request:
Copy code
{
  "queries": [
    {
      "table": "call",
      "name": "active_calls_concurrency",
      "operations": [
        {
          "operation": "history",
          "column": "concurrencyCounter"
        }
      ],
      "timeRange": {
        "step": "hour",
        "start": "2025-06-20T21:00:21.000Z",
        "end": "2025-06-21T15:00:21.000Z"
      }
    }
  ]
}
Response: {"message":["queries.0.operations.0.operation can't be
history
for column
concurrencyCounter
.
history
supports concurrency, minutesUsed columns","queries.0.operations.0.column must be one of the following values: id, cost, costBreakdown.llm, costBreakdown.stt, costBreakdown.tts, costBreakdown.vapi, costBreakdown.ttsCharacters, costBreakdown.llmPromptTokens, costBreakdown.llmCompletionTokens, duration, concurrency, minutesUsed"],"error":"Bad Request","statusCode":400}
@Shubham Bajaj @Sahil Please address this today when you guys are online.
k
Hey Neeraj, it's not available directly through the API, but you can find it in the dashboard metrics section.