Presence
POST/api/v1/presence/contexts
Authorization
bearer_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}
Authorization
bearer_token In: header
Path Parameters
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
Authorization
bearer_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
Authorization
bearer_token In: header
Path Parameters
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
Authorization
bearer_token In: header
Path Parameters
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
Authorization
bearer_token In: header
Path Parameters
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
Authorization
bearer_token In: header
Path Parameters
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
Authorization
bearer_token In: header
Path Parameters
Query Parameters
Filter by cognitive state
Value in
- "available"
- "thinking"
- "busy"
- "offline"
Filter by activity state
Value in
- "active"
- "idle"
- "stale"
Filter by subject kind
Value in
- "user"
- "agent"
- "service"
- "device"
Collapse multiple sessions per subject into a single entry
Maximum number of sessions to return
int640 <= valueNumber of sessions to skip
int640 <= valueResponse 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
Authorization
bearer_token In: header
Path Parameters
Query Parameters
Latitude in decimal degrees
doubleLongitude in decimal degrees
doubleSearch radius in meters
doubleMaximum number of sessions to return
int640 <= valueResponse 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
Authorization
bearer_token In: header
Path Parameters
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
Authorization
bearer_token In: header
Path Parameters
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" }}