> For the complete documentation index, see [llms.txt](https://docs.catalyx.solutions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.catalyx.solutions/catalyx-blockchain-manager/canton-network/version-2.0/support-and-resources/openapi-reference/pruning.md). Agents can also search and read this documentation through its [MCP server](https://docs.catalyx.solutions/~gitbook/mcp).

# Pruning

Participant pruning: the schedule

## Update the pruning schedule

> Saves the schedule in the validator settings as validator.participantPruningSchedule.enabled, .cron, .maxDuration and .retention. The operator restarts the validator-app, which sets the schedule on the participant, or clears it when pruning is disabled. 400 when a value is not valid. 409 with the validator's extraEnv sets the schedule.

```json
{"openapi":"3.1.0","info":{"title":"Catalyx Canton API 2.0","version":"v1"},"tags":[{"name":"Pruning","description":"Participant pruning: the schedule"}],"servers":[{"url":"/","description":"Current server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"PruningScheduleRequest":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Prune the participant on the schedule."},"cron":{"type":"string","description":"When pruning starts, as a Quartz cron expression in UTC: 6 or 7 fields, seconds first.","maxLength":300,"minLength":0},"maxDuration":{"type":"string","description":"How long pruning can run after each cron time: a whole number and a unit, s, m or h, at most 24h.","minLength":1,"pattern":"^[1-9][0-9]{0,8}(s|m|h)$"},"retention":{"type":"string","description":"How much ledger history to keep: a whole number and a unit, s, m, h or d, longer than 24h and at most 3650d.","minLength":1,"pattern":"^[1-9][0-9]{0,8}(s|m|h|d)$"}},"required":["cron","enabled","maxDuration","retention"]},"PruningResponse":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/PruningScheduleDto","description":"The schedule in effect: the Validator's spec.validator.participantPruningSchedule with the validator settings applied, then the defaults; or the participant's, when extraEnv sets it."},"scheduleSetInExtraEnv":{"type":"boolean","description":"True when the extraEnv of the validator overrides sets the schedule. Then schedule is the participant's (null when the participant does not answer), and the console cannot change it."},"nextRunAt":{"type":"string","format":"date-time","description":"The next time the schedule starts pruning, in UTC. Null when pruning is disabled."},"participantReachable":{"type":"boolean","description":"Whether the participant answered. When false, participantSchedule, scheduleApplied and prunedUpTo are null because they are not known."},"participantSchedule":{"$ref":"#/components/schemas/PruningScheduleDto","description":"The schedule the participant has now, as the validator-app set it. Null when it has none."},"scheduleApplied":{"type":"boolean","description":"Whether the participant's schedule is the validator's schedule. False until the validator-app restarts with a changed schedule."},"prunedUpTo":{"type":"integer","format":"int64","description":"The offset the participant is pruned up to, inclusive. Null before the first prune."}}},"PruningScheduleDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the participant is pruned on this schedule."},"cron":{"type":"string","description":"When pruning starts, as a Quartz cron expression in UTC."},"maxDuration":{"type":"string","description":"How long pruning can run after each cron time."},"retention":{"type":"string","description":"How much ledger history the participant keeps."}}},"ProblemDetail":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string","format":"uri"},"properties":{"type":"object","additionalProperties":{}}}}}},"paths":{"/api/v1/validators/{name}/pruning/schedule":{"put":{"tags":["Pruning"],"summary":"Update the pruning schedule","description":"Saves the schedule in the validator settings as validator.participantPruningSchedule.enabled, .cron, .maxDuration and .retention. The operator restarts the validator-app, which sets the schedule on the participant, or clears it when pruning is disabled. 400 when a value is not valid. 409 with the validator's extraEnv sets the schedule.","operationId":"updateSchedule","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PruningScheduleRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PruningResponse"}}}},"400":{"description":"The request was invalid.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"401":{"description":"The bearer token is missing or invalid.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"404":{"description":"The requested resource does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"405":{"description":"The HTTP method is not supported by this endpoint.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"406":{"description":"None of the media types in the Accept header can be produced.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"409":{"description":"The request conflicts with the resource's current state.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"413":{"description":"The uploaded file exceeds the maximum allowed size.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"415":{"description":"The request Content-Type is not supported by this endpoint.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"422":{"description":"The upstream system rejected the content of the request.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"500":{"description":"An upstream system refused the credentials of this API.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"502":{"description":"An upstream call (Ledger/Admin/Scan/Validator/Wallet Gateway/CPM registry/Kubernetes) failed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"503":{"description":"An upstream system is down, not reachable, overloaded or temporarily refuses changes. Retry later; the Retry-After header gives the seconds when known.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"504":{"description":"An upstream system did not answer before the read timeout or call deadline expired.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}}}}
```

## Check a cron expression

> Whether the participant accepts a cron expression, and the next 3 times it starts pruning, in UTC. An expression that is not valid is a 200 with the reason.

```json
{"openapi":"3.1.0","info":{"title":"Catalyx Canton API 2.0","version":"v1"},"tags":[{"name":"Pruning","description":"Participant pruning: the schedule"}],"servers":[{"url":"/","description":"Current server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CronCheckRequest":{"type":"object","properties":{"cron":{"type":"string","description":"A Quartz cron expression in UTC.","maxLength":300,"minLength":0}},"required":["cron"]},"CronCheckResponse":{"type":"object","properties":{"valid":{"type":"boolean"},"error":{"type":"string","description":"Why the expression is not valid. Null when it is."},"nextRuns":{"type":"array","description":"The next 3 times the expression fires, in UTC. Empty when it is not valid.","items":{"type":"string","format":"date-time"}}}},"ProblemDetail":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string","format":"uri"},"properties":{"type":"object","additionalProperties":{}}}}}},"paths":{"/api/v1/validators/{name}/pruning/schedule/next-runs":{"post":{"tags":["Pruning"],"summary":"Check a cron expression","description":"Whether the participant accepts a cron expression, and the next 3 times it starts pruning, in UTC. An expression that is not valid is a 200 with the reason.","operationId":"checkCron","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronCheckRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CronCheckResponse"}}}},"400":{"description":"The request was invalid.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"401":{"description":"The bearer token is missing or invalid.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"404":{"description":"The requested resource does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"405":{"description":"The HTTP method is not supported by this endpoint.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"406":{"description":"None of the media types in the Accept header can be produced.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"409":{"description":"The request conflicts with the resource's current state.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"413":{"description":"The uploaded file exceeds the maximum allowed size.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"415":{"description":"The request Content-Type is not supported by this endpoint.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"422":{"description":"The upstream system rejected the content of the request.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"500":{"description":"An upstream system refused the credentials of this API.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"502":{"description":"An upstream call (Ledger/Admin/Scan/Validator/Wallet Gateway/CPM registry/Kubernetes) failed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"503":{"description":"An upstream system is down, not reachable, overloaded or temporarily refuses changes. Retry later; the Retry-After header gives the seconds when known.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"504":{"description":"An upstream system did not answer before the read timeout or call deadline expired.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}}}}
```

## Get the pruning state

> The validator's pruning schedule as the operator applies it, its next run, the schedule the participant has, and the offset the participant is pruned up to. 409 when the saved validator settings are not valid.

```json
{"openapi":"3.1.0","info":{"title":"Catalyx Canton API 2.0","version":"v1"},"tags":[{"name":"Pruning","description":"Participant pruning: the schedule"}],"servers":[{"url":"/","description":"Current server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"PruningResponse":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/PruningScheduleDto","description":"The schedule in effect: the Validator's spec.validator.participantPruningSchedule with the validator settings applied, then the defaults; or the participant's, when extraEnv sets it."},"scheduleSetInExtraEnv":{"type":"boolean","description":"True when the extraEnv of the validator overrides sets the schedule. Then schedule is the participant's (null when the participant does not answer), and the console cannot change it."},"nextRunAt":{"type":"string","format":"date-time","description":"The next time the schedule starts pruning, in UTC. Null when pruning is disabled."},"participantReachable":{"type":"boolean","description":"Whether the participant answered. When false, participantSchedule, scheduleApplied and prunedUpTo are null because they are not known."},"participantSchedule":{"$ref":"#/components/schemas/PruningScheduleDto","description":"The schedule the participant has now, as the validator-app set it. Null when it has none."},"scheduleApplied":{"type":"boolean","description":"Whether the participant's schedule is the validator's schedule. False until the validator-app restarts with a changed schedule."},"prunedUpTo":{"type":"integer","format":"int64","description":"The offset the participant is pruned up to, inclusive. Null before the first prune."}}},"PruningScheduleDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the participant is pruned on this schedule."},"cron":{"type":"string","description":"When pruning starts, as a Quartz cron expression in UTC."},"maxDuration":{"type":"string","description":"How long pruning can run after each cron time."},"retention":{"type":"string","description":"How much ledger history the participant keeps."}}},"ProblemDetail":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string","format":"uri"},"properties":{"type":"object","additionalProperties":{}}}}}},"paths":{"/api/v1/validators/{name}/pruning":{"get":{"tags":["Pruning"],"summary":"Get the pruning state","description":"The validator's pruning schedule as the operator applies it, its next run, the schedule the participant has, and the offset the participant is pruned up to. 409 when the saved validator settings are not valid.","operationId":"getPruning","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PruningResponse"}}}},"400":{"description":"The request was invalid.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"401":{"description":"The bearer token is missing or invalid.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"404":{"description":"The requested resource does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"405":{"description":"The HTTP method is not supported by this endpoint.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"406":{"description":"None of the media types in the Accept header can be produced.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"409":{"description":"The request conflicts with the resource's current state.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"413":{"description":"The uploaded file exceeds the maximum allowed size.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"415":{"description":"The request Content-Type is not supported by this endpoint.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"422":{"description":"The upstream system rejected the content of the request.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"500":{"description":"An upstream system refused the credentials of this API.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"502":{"description":"An upstream call (Ledger/Admin/Scan/Validator/Wallet Gateway/CPM registry/Kubernetes) failed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"503":{"description":"An upstream system is down, not reachable, overloaded or temporarily refuses changes. Retry later; the Retry-After header gives the seconds when known.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"504":{"description":"An upstream system did not answer before the read timeout or call deadline expired.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.catalyx.solutions/catalyx-blockchain-manager/canton-network/version-2.0/support-and-resources/openapi-reference/pruning.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
