Get Current Media Call State

Prev Next
Get
/media-calls.state

Returns every media call the authenticated user is part of and that has not yet ended. Each entry reflects the call's latest server-side state — ringing, active, etc. It also includes the caller, callee, supported features, and lifecycle timestamps.

Header parameters
X-User-Id
stringRequired

The user ID.

ExampleCkCPNctrgCDfmWLqC
X-Auth-Token
stringRequired

The authentication token.

Example1Dd4iN_ClKn5jl-xPC36snQ4s9Zd5GZnXCQuCNSKcVE
Responses
200

The list of in-flight calls for the authenticated user.

ringing

Outbound call is still ringing

{
  "calls": [
    {
      "_id": "9f44ec94-2046-4fac-976b-fa8b0e022b08",
      "service": "webrtc",
      "kind": "direct",
      "state": "ringing",
      "createdBy": {
        "type": "user",
        "id": "aEGCdnFoBFCFNdiyX",
        "contractId": "7b96e74d-1e01-412a-8bcb-145db1bc9ac4"
      },
      "createdAt": "2026-04-30T13:30:53.165Z",
      "caller": {
        "type": "user",
        "id": "aEGCdnFoBFCFNdiyX",
        "contractId": "7b96e74d-1e01-412a-8bcb-145db1bc9ac4",
        "displayName": "Funke Olasupo",
        "username": "funke.olasupo"
      },
      "callee": {
        "type": "user",
        "id": "iaZWAXecuCuBx4FnX",
        "displayName": "Agent1",
        "username": "agent1"
      },
      "expiresAt": "2026-04-30T13:33:02.878Z",
      "uids": [
        "aEGCdnFoBFCFNdiyX",
        "iaZWAXecuCuBx4FnX"
      ],
      "ended": false,
      "callerRequestedId": "7b96e74d-1e01-412a-8bcb-145db1bc9ac4-38b61a15-8c41-4ee4-be75-977c48cd94ea",
      "features": [
        "audio",
        "screen-share",
        "transfer",
        "hold"
      ],
      "_updatedAt": "2026-04-30T13:31:02.878Z"
    }
  ],
  "success": true
}
active

Call has been picked up and is active

{
  "calls": [
    {
      "_id": "9f44ec94-2046-4fac-976b-fa8b0e022b08",
      "service": "webrtc",
      "kind": "direct",
      "state": "active",
      "createdBy": {
        "type": "user",
        "id": "aEGCdnFoBFCFNdiyX",
        "contractId": "7b96e74d-1e01-412a-8bcb-145db1bc9ac4"
      },
      "createdAt": "2026-04-30T13:30:53.165Z",
      "caller": {
        "type": "user",
        "id": "aEGCdnFoBFCFNdiyX",
        "contractId": "7b96e74d-1e01-412a-8bcb-145db1bc9ac4",
        "displayName": "Funke Olasupo",
        "username": "funke.olasupo"
      },
      "callee": {
        "type": "user",
        "id": "iaZWAXecuCuBx4FnX",
        "contractId": "7488b84e-e096-46fb-8d62-1e6e3db479c9",
        "displayName": "Agent1",
        "username": "agent1"
      },
      "expiresAt": "2026-04-30T13:33:12.993Z",
      "uids": [
        "aEGCdnFoBFCFNdiyX",
        "iaZWAXecuCuBx4FnX"
      ],
      "ended": false,
      "callerRequestedId": "7b96e74d-1e01-412a-8bcb-145db1bc9ac4-38b61a15-8c41-4ee4-be75-977c48cd94ea",
      "features": [
        "audio",
        "screen-share",
        "transfer",
        "hold"
      ],
      "_updatedAt": "2026-04-30T13:31:12.993Z",
      "acceptedAt": "2026-04-30T13:31:10.070Z",
      "activatedAt": "2026-04-30T13:31:12.698Z"
    }
  ],
  "success": true
}
empty

User has no in-flight calls

{
  "calls": [],
  "success": true
}
Expand All
object
calls
Array of object

All in-flight calls the authenticated user participates in.

object
_id
string (uuid)

Unique identifier of the call.

Example9f44ec94-2046-4fac-976b-fa8b0e022b08
service
string

Underlying media service powering the call.

Valid values[ "webrtc" ]
Examplewebrtc
kind
string

Call topology.

Valid values[ "direct" ]
Exampledirect
state
string

Current lifecycle state of the call.

  • ringing : invitation sent, callee has not yet answered.
  • active : call accepted and media is flowing.
Valid values[ "ringing", "active" ]
Exampleringing
createdBy
object

The actor who created the call.

type
string
Exampleuser
id
string

Rocket.Chat user id.

ExampleaEGCdnFoBFCFNdiyX
contractId
string (uuid)

Device/session contract id registered with the media-call service.

Example7b96e74d-1e01-412a-8bcb-145db1bc9ac4
createdAt
string (date-time)

When the call record was created on the server.

Example2026-04-30T13:30:53.165Z
caller
object

The party initiating the call. Always carries contractId.

type
string
Exampleuser
id
string
ExampleaEGCdnFoBFCFNdiyX
contractId
string
Example7b96e74d-1e01-412a-8bcb-145db1bc9ac4
displayName
string
ExampleFunke Olasupo
username
string
Examplefunke.olasupo
callee
object

The party being called. contractId is omitted while the call is ringing (no device has answered yet) and populated once accepted.

type
string
Exampleuser
id
string
ExampleiaZWAXecuCuBx4FnX
contractId
string

Set once the call is accepted.

Example7488b84e-e096-46fb-8d62-1e6e3db479c9
displayName
string
ExampleAgent1
username
string
Exampleagent1
expiresAt
string

When the current state will expire if no further activity occurs.

Example2026-04-30T13:33:12.993Z
uids
Array of string

User IDs of every participant in the call.

Example[ "aEGCdnFoBFCFNdiyX", "iaZWAXecuCuBx4FnX" ]
string
ended
boolean

Always false for entries returned by this endpoint.

Examplefalse
callerRequestedId
string

Client-supplied correlation id for the call request.

Example7b96e74d-1e01-412a-8bcb-145db1bc9ac4-38b61a15-8c41-4ee4-be75-977c48cd94ea
features
Array of string

Feature flags negotiated for this call.

Example[ "audio", "screen-share", "transfer", "hold" ]
string
_updatedAt
string

When the call record was last updated.

Example2026-04-30T13:31:12.993Z
acceptedAt
string

Set once the callee accepts. Absent while ringing.

Example2026-04-30T13:31:10.070Z
activatedAt
string

Set once media becomes active. Absent while ringing.

Example2026-04-30T13:31:12.698Z
success
boolean
Exampletrue
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string