Set source-document retention
PATCH
/organizations/current/retention
const url = 'https://api.invogi.com/v1/organizations/current/retention';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"retention_months":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.invogi.com/v1/organizations/current/retention \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "retention_months": 1 }'OWNER only; requires the advanced-retention capability. The policy changes eligibility; deletion is a separate explicit action.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”X-Invogi-Organization
string format: uuid
For a Clerk session, selects a workspace in which the user has an active membership. If omitted, the remembered accessible workspace is used. API keys remain bound to their own workspace and cannot select another tenant.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
retention_months
required
integer
Example
{ "retention_months": 1}Responses
Section titled “Responses”Successful response
Media typeapplication/json
object
retentionMonths
required
number
Example generated
{ "retentionMonths": 1}Invalid request
Media typeapplication/json
Missing or invalid API key
Media typeapplication/json
API key lacks required scope/role
Media typeapplication/json