# Sesiuni (/ro/docs/api/gateway/sessions)

Protocolul de sesiuni partajate v2: jurnal de evenimente, controale, lease de executor, dispatch și stream-ul SSE live.

Fiecare apel poartă `x-codai-device` (un UUID stabil) — acel header e cel care selectează protocolul v2 și înregistrează dispozitivul. Un singur executor ține lease-ul; viewer-ii și editorii trimit controale; toți citesc același jurnal de evenimente. Protocolul în sine e specificat în [secțiunea de sesiuni](../../sessions/protocol.mdx).

<OpenAPIPage document="./openapi/ro/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'}]} />
