Set the company’s session rules
const url = 'https://api.emite.cr/v1/tenants/me/security-policy/session';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"maxAgeMinutes":120,"idleTimeoutMinutes":15}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.emite.cr/v1/tenants/me/security-policy/session \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "maxAgeMinutes": 120, "idleTimeoutMinutes": 15 }'maxAgeMinutes shortens every member’s session, counted from their sign-in (the platform’s maximum stays the ceiling); idleTimeoutMinutes closes a session nobody used for that long. null removes that rule. It applies at once: a session the new rule would end gets 5 minutes to save its work. It applies to the web — WhatsApp has its own rule. Audited as security_policy.updated.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Maximum session length in minutes, counted from sign-in. null = the platform’s maximum.
Example
240Minutes without activity after which the session closes. null = no such rule.
Example
30Responses
Section titled “Responses”The security policy after the change (unchanged when the values were the same).
object
The company's session rules as saved.
object
Maximum session length in minutes, counted from sign-in; null = no rule of the company's own (the platform maximum, platformMaxAgeMinutes, applies).
Minutes without activity after which a session closes; null = no such rule.
When the session rules last changed, a reset included; null when they never were.
The values the company may choose — served, so a client never offers one the API refuses.
object
The maximum session lengths the company may choose, in minutes — the only values PUT …/session accepts, leaving out any at or above the platform maximum.
The inactivity timeouts the company may choose, in minutes, with the same filter.
The inactivity timeout EmiteCR recommends, in minutes.
The platform's maximum session length, in minutes: the ceiling of every company rule.
Whether the company's plan includes the session policy — what changing it with PUT …/session needs (402 FEATURE_NOT_IN_PLAN otherwise). Resetting never does, and saved rules keep applying after a downgrade.
The cheapest plan on the company's ladder that includes the session policy, for an upgrade prompt; null when the plan already includes it, or no sold plan does.
object
Code of the plan (pf_t3 on the persona física ladder, pj_t3 on the jurídica).
Its commercial name.
Example
{ "session": { "maxAgeMinutes": 240, "idleTimeoutMinutes": 30 }, "options": { "maxAgeMinutes": [ 120, 240 ], "idleTimeoutMinutes": [ 15, 30, 60 ], "recommendedIdleTimeoutMinutes": 30 }, "platformMaxAgeMinutes": 480, "requiredPlan": { "code": "pj_t3", "label": "Ocelote" }}SESSION_POLICY_OPTION_INVALID — a value not offered; SECURITY_POLICY_NOT_AVAILABLE_IN_DEMO.
Missing or invalid JWT.
FEATURE_NOT_IN_PLAN — the plan does not include the session policy.
Requires the security:manage scope (JWT only).