---
title: "openre.key-rotate-request@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/openre.key-rotate-request"
updated: null
---

# openre.key-rotate-request@1 · OpenVibe.Services

HTML: [openre.key-rotate-request@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/openre.key-rotate-request)

# OpenreKeyRotateRequest `openre.key-rotate-request@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.0).

- Version: 1.0.0
- Owner: openre
- Visibility: first-party
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/openre/key-rotate-request.v1.json`](/docs/contracts/openre.key-rotate-request.json)

openre.key-rotate-request@1: the body of POST /api/v1/streams/:id/keys/rotate on OpenRestream (openre.key.rotate). grace\_seconds (0 by default, at most 7 days) keeps the old key working that long; end\_sessions true also ends the stream's open sessions. An empty body rotates with no grace.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `grace_seconds` | integer \| string |  | Clamped to 0..604800. | - `minimum 0` |
| `end_sessions` | boolean |  |  |  |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: grace

~~~~
{
  "grace_seconds": 3600,
  "end_sessions": false
}
~~~~

Rejected: end-not-boolean

~~~~
{
  "end_sessions": "yes"
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('openre.key-rotate-request@1', value);   // { valid, errors: [{ path, message }] }
~~~~
