Skip to main content

Presence

Generated from apiome-rest/openapi.yaml (API version 1.719.0) — do not edit by hand. How to authenticate is on the REST API reference.

Tag: presence · 7 operations

GET /v1/tenants/{tenant_slug}/projects/{project_ref}/presence​

Who is viewing a project, and what is locked

Read the project's live viewers and element locks without announcing the caller.

Operation id: get_presence_v1_tenants__tenant_slug__projects__project_ref__presence_get

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for who is viewing a project, and what is locked.application/json PresenceSnapshot
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/presence/heartbeat​

Announce a tab and renew its locks

Mark the tab present for the lease, renew the locks it holds, and read the snapshot.

lost in the answer names held keys that another tab now holds — the notice a takeover happened. Clients heartbeat at least twice per ttl_seconds.

Operation id: post_heartbeat_v1_tenants__tenant_slug__projects__project_ref__presence_heartbeat_post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Request body (required)

Request body for announce a tab and renew its locks.

Responses

StatusDescriptionBody
200Successful response for announce a tab and renew its locks.application/json PresenceSnapshot
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/presence/leave​

Leave a project (release presence and locks)

Drop the tab's presence and every lock it holds. Safe to repeat.

Operation id: post_leave_v1_tenants__tenant_slug__projects__project_ref__presence_leave_post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Request body (required)

Request body for leave a project (release presence and locks).

Responses

StatusDescriptionBody
204Successful response for leave a project (release presence and locks).—
422Validation Errorapplication/json HTTPValidationError

PUT /v1/tenants/{tenant_slug}/projects/{project_ref}/presence/locks/{element_key}​

Lock an element

Mark an element as being edited by session_id. 409 presence-lock-held if another live tab holds it.

Operation id: put_lock_v1_tenants__tenant_slug__projects__project_ref__presence_locks__element_key__put

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
element_keypathstringyesPath parameter identifying the element key segment.
session_idquerystringyesRequired. Query parameter: session id.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for lock an element.application/json PresenceSnapshot
422Validation Errorapplication/json HTTPValidationError

DELETE /v1/tenants/{tenant_slug}/projects/{project_ref}/presence/locks/{element_key}​

Unlock an element

Release a lock the tab holds.

Operation id: delete_lock_v1_tenants__tenant_slug__projects__project_ref__presence_locks__element_key__delete

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
element_keypathstringyesPath parameter identifying the element key segment.
session_idquerystringyesRequired. Query parameter: session id.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for unlock an element.application/json PresenceSnapshot
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/presence/request-takeover/{element_key}​

Ask the holder to hand an element over

Notify the holder (on their next heartbeat) that the caller wants the element.

Operation id: post_request_takeover_v1_tenants__tenant_slug__projects__project_ref__presence_request_takeover__element_key__post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
element_keypathstringyesPath parameter identifying the element key segment.
session_idquerystringyesRequired. Query parameter: session id.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for ask the holder to hand an element over.application/json PresenceSnapshot
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/presence/take-over/{element_key}​

Take an element over after asking

Steal a lock once the grace period since the caller's request has passed; the previous holder sees it in lost.

Operation id: post_take_over_v1_tenants__tenant_slug__projects__project_ref__presence_take_over__element_key__post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
element_keypathstringyesPath parameter identifying the element key segment.
session_idquerystringyesRequired. Query parameter: session id.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for take an element over after asking.application/json PresenceSnapshot
422Validation Errorapplication/json HTTPValidationError

Schemas used​

HTTPValidationError​

Validation error response emitted when request data fails schema checks.

PropertyTypeRequiredDescription
detailarray of ValidationErrornoDetail.

HeartbeatRequest​

Renew a tab's presence and the locks it holds.

PropertyTypeRequiredDescription
session_idstringyesClient-generated id of this tab (8-64 URL-safe chars).
viewstring or nullnoWhich view the tab is on.
heldarray of stringnoElement keys this tab believes it holds.

PresenceSnapshot​

Everything a client needs to draw avatars and lock adornments.

PropertyTypeRequiredDescription
viewersarray of ViewerRecordnoViewers.
locksarray of LockRecordnoLocks.
lostarray of stringnoElement keys the caller's session claimed to hold that another session now holds — the previous holder's notice that a takeover happened.
server_timestringyesServer clock (ISO 8601), for client skew.
ttl_secondsintegeryesHeartbeat at least twice per this many seconds.