# Sessions (/docs/api/gateway/sessions)

Shared-sessions protocol v2: event log, controls, executor lease, dispatch and the live SSE stream.

Every call carries `x-codai-device` (a stable UUID) — that header is what selects protocol v2 and registers the device. One executor holds the lease; viewers and editors send controls; everyone reads the same event log. The protocol itself is specified in the [sessions section](../../sessions/protocol.mdx).

<OpenAPIPage document="./openapi/en/gateway.yaml" operations={[{path: '/v1/sessions',method: 'post'},{path: '/v1/sessions',method: 'get'},{path: '/v1/sessions/{id}',method: 'get'},{path: '/v1/sessions/{id}',method: 'patch'},{path: '/v1/sessions/{id}',method: 'delete'},{path: '/v1/sessions/{id}/events',method: 'get'},{path: '/v1/sessions/{id}/events',method: 'post'},{path: '/v1/sessions/{id}/controls',method: 'get'},{path: '/v1/sessions/{id}/control',method: 'post'},{path: '/v1/sessions/{id}/control/{cid}/applied',method: 'post'},{path: '/v1/sessions/{id}/dispatch',method: 'post'},{path: '/v1/sessions/{id}/lease',method: 'post'},{path: '/v1/sessions/{id}/lease',method: 'put'},{path: '/v1/sessions/{id}/lease',method: 'delete'},{path: '/v1/sessions/{id}/stream',method: 'get'}]} />
