HTTP API

Presence

POST/api/v1/presence/contexts
POST
/api/v1/presence/contexts

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/presence/contexts" \  -H "Content-Type: application/json" \  -d '{    "id": "string",    "kind": "string"  }'
{  "capacity": {    "max_active": 0,    "overflow_policy": "reject",    "soft_limit": 0  },  "created_at": "2019-08-24T14:15:22Z",  "geo": {    "enabled": true,    "precision": "string"  },  "heartbeat": {    "idle_after_seconds": 0,    "stale_after_seconds": 0,    "ttl_seconds": 0  },  "id": "string",  "kind": "string",  "metadata_schema": {    "allowed_keys": [      "string"    ]  },  "resource_id": "string",  "version": 0}
GET/api/v1/presence/contexts/{context_id}
GET
/api/v1/presence/contexts/{context_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

context_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/presence/contexts/string"
{  "context": {    "capacity": {      "max_active": 0,      "overflow_policy": "reject",      "soft_limit": 0    },    "created_at": "2019-08-24T14:15:22Z",    "geo": {      "enabled": true,      "precision": "string"    },    "heartbeat": {      "idle_after_seconds": 0,      "stale_after_seconds": 0,      "ttl_seconds": 0    },    "id": "string",    "kind": "string",    "metadata_schema": {      "allowed_keys": [        "string"      ]    },    "resource_id": "string",    "version": 0  },  "occupancy": {    "active": 0,    "available_agents": 0,    "capacity_remaining": 0,    "idle": 0,    "observers": 0,    "occupancy_state": "open",    "stale": 0,    "total": 0  }}
POST/api/v1/presence/multiplex
POST
/api/v1/presence/multiplex

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/presence/multiplex" \  -H "Content-Type: application/json" \  -d '{    "items": [      {        "context_id": "string",        "heartbeat": {}      }    ]  }'
{  "failed": 0,  "results": [    {      "context_id": "string",      "error": "string",      "heartbeat": null,      "message": "string",      "success": true    }  ],  "succeeded": 0}
GET/api/v1/presence/subjects/{subject_id}/last-seen
GET
/api/v1/presence/subjects/{subject_id}/last-seen

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

subject_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/presence/subjects/string/last-seen"
{  "contexts": [    {      "context_id": "string",      "context_kind": "string",      "last_seen_at": "2019-08-24T14:15:22Z",      "last_state": "available"    }  ],  "last_seen_at": "2019-08-24T14:15:22Z",  "subject_id": "string",  "subject_kind": null}
GET/api/v1/presence/{context_id}/count
GET
/api/v1/presence/{context_id}/count

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

context_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/presence/string/count"
{  "by_state": {    "property1": 0,    "property2": 0  },  "context_id": "string",  "occupancy": {    "active": 0,    "available_agents": 0,    "capacity_remaining": 0,    "idle": 0,    "observers": 0,    "occupancy_state": "open",    "stale": 0,    "total": 0  }}
POST/api/v1/presence/{context_id}/heartbeat
POST
/api/v1/presence/{context_id}/heartbeat

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

context_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/presence/string/heartbeat" \  -H "Content-Type: application/json" \  -d '{}'
{  "activity": "active",  "admission": "admitted",  "context_id": "string",  "expires_at": "2019-08-24T14:15:22Z",  "observer": true,  "occupancy": {    "active": 0,    "available_agents": 0,    "capacity_remaining": 0,    "idle": 0,    "observers": 0,    "occupancy_state": "open",    "stale": 0,    "total": 0  },  "session_id": "string",  "state": "available"}
POST/api/v1/presence/{context_id}/leave
POST
/api/v1/presence/{context_id}/leave

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

context_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/presence/string/leave" \  -H "Content-Type: application/json" \  -d '{}'
{  "context_id": "string",  "message": "string",  "removed_sessions": 0}
GET/api/v1/presence/{context_id}/list
GET
/api/v1/presence/{context_id}/list

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

context_id*string

Query Parameters

state?string

Filter by cognitive state

Value in

  • "available"
  • "thinking"
  • "busy"
  • "offline"
activity?string

Filter by activity state

Value in

  • "active"
  • "idle"
  • "stale"
kind?string

Filter by subject kind

Value in

  • "user"
  • "agent"
  • "service"
  • "device"
aggregate_by_subject?boolean

Collapse multiple sessions per subject into a single entry

limit?integer

Maximum number of sessions to return

Formatint64
Range0 <= value
offset?integer

Number of sessions to skip

Formatint64
Range0 <= value

Response Body

application/json

curl -X GET "https://example.com/api/v1/presence/string/list"
{  "count": 0,  "sessions": [    {      "activity": "active",      "connection_id": "string",      "context_id": "string",      "device_id": "string",      "expires_at": "2019-08-24T14:15:22Z",      "geo": null,      "last_heartbeat_at": "2019-08-24T14:15:22Z",      "metadata": {        "property1": null,        "property2": null      },      "observer": true,      "session_id": "string",      "state": "available",      "subject": {        "id": "string",        "kind": "user"      }    }  ]}
GET/api/v1/presence/{context_id}/nearby
GET
/api/v1/presence/{context_id}/nearby

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

context_id*string

Query Parameters

lat*number

Latitude in decimal degrees

Formatdouble
lon*number

Longitude in decimal degrees

Formatdouble
radius_meters*number

Search radius in meters

Formatdouble
limit?integer

Maximum number of sessions to return

Formatint64
Range0 <= value

Response Body

application/json

curl -X GET "https://example.com/api/v1/presence/string/nearby?lat=0.1&lon=0.1&radius_meters=0.1"
{  "context_id": "string",  "count": 0,  "sessions": [    {      "distance_meters": 0.1,      "geo": {        "lat": 0.1,        "lon": 0.1      },      "session_id": "string",      "subject": {        "id": "string",        "kind": "user"      }    }  ]}
POST/api/v1/presence/{context_id}/state
POST
/api/v1/presence/{context_id}/state

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

context_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/presence/string/state" \  -H "Content-Type: application/json" \  -d '{    "state": "available"  }'
{  "context_id": "string",  "previous_state": "available",  "session_id": "string",  "state": "available"}
POST/api/v1/presence/{context_id}/sweep
POST
/api/v1/presence/{context_id}/sweep

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

context_id*string

Response Body

application/json

curl -X POST "https://example.com/api/v1/presence/string/sweep"
{  "context_id": "string",  "reconciled": 0,  "transitions": {    "property1": "active",    "property2": "active"  }}

On this page