# Keep a diagram from the library retention

> Page: https://docs.plotwork.dev/api/put-orgs-org-diagrams-id-kept. Index of every page: https://docs.plotwork.dev/llms.txt

True keeps the diagram whatever "Delete library diagrams not updated for" says; the plan's own retention still applies.

`PUT /orgs/{org}/diagrams/{id}/kept`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Keep a diagram from the library retention. |
| What does it take? | A JSON body of type [`SetDiagramKeptBody`](https://docs.plotwork.dev/api/schemas.md#setdiagramkeptbody). |
| What does it return? | Status 200 with a body of type [`DiagramKept`](https://docs.plotwork.dev/api/schemas.md#diagramkept). |
| What can go wrong? | `400` the body is not valid; `401` not signed in; `403` the role may not (orgs.forbidden), or the request came from an origin that may not make changes; `404` no such organisation or diagram, or the caller is not a member, or the diagram is in a folder the caller may not use; `429` too many requests; `503` organisations are not set up on this server. Every failure uses the one error envelope. |

## What it does

True keeps the diagram whatever "Delete library diagrams not updated for" says; the plan's own retention still applies. The owner and admins.

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `org` | `string` | yes | The organisation's id or its slug. |
| `id` | `string` | yes |  |

## Request body

The body has the type [`SetDiagramKeptBody`](https://docs.plotwork.dev/api/schemas.md#setdiagramkeptbody).

| Field | Type | Required | Description |
|---|---|---|---|
| `kept` | `boolean` | yes | True keeps the diagram from the library retention; false lets it go when it is due. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The diagram's value now. | [`DiagramKept`](https://docs.plotwork.dev/api/schemas.md#diagramkept) |
| 400 | The body is not valid. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 401 | Not signed in. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | The role may not (orgs.forbidden), or the request came from an origin that may not make changes. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 404 | No such organisation or diagram, or the caller is not a member, or the diagram is in a folder the caller may not use. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | Organisations are not set up on this server. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## Response body

A 200 answer has the type [`DiagramKept`](https://docs.plotwork.dev/api/schemas.md#diagramkept).

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | `string` | yes |  |
| `kept` | `boolean` | yes |  |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
