# Allow or stop public sharing of single diagrams

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

The owner's setting.

`PUT /orgs/{org}/sharing/public`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Allow or stop public sharing of single diagrams. |
| What does it take? | A JSON body of type [`SetOrganisationPublicSharingBody`](https://docs.plotwork.dev/api/schemas.md#setorganisationpublicsharingbody). |
| What does it return? | Status 200 with a body of type [`OrganisationPublicSharingChanged`](https://docs.plotwork.dev/api/schemas.md#organisationpublicsharingchanged). |
| What can go wrong? | `400` the body is not valid; `401` not signed in; `403` only the owner may (orgs.forbidden), or the request came from an origin that may not make changes; `404` no such organisation, or the caller is not a member of it; `429` too many requests; `503` organisations are not set up on this server. Every failure uses the one error envelope. |

## What it does

The owner's setting. On, the owner and admins may share any diagram at a public link, and a member one they published. Off ends every link at once, and linksEnded says how many. Only the owner may.

## Path parameters

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

## Request body

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

| Field | Type | Required | Description |
|---|---|---|---|
| `publicSharing` | `boolean` | yes | True to allow public links to single diagrams; false to end every one. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The settings now, and how many links ended. | [`OrganisationPublicSharingChanged`](https://docs.plotwork.dev/api/schemas.md#organisationpublicsharingchanged) |
| 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 | Only the owner may (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 the caller is not a member of it. | [`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 [`OrganisationPublicSharingChanged`](https://docs.plotwork.dev/api/schemas.md#organisationpublicsharingchanged).

| Field | Type | Required | Description |
|---|---|---|---|
| `publicSharing` | `boolean` | yes | "Allow public sharing of individual diagrams": while true, the owner and admins may share any diagram, and a member a diagram they published, at a public link. Off by default. Turning it off ends every link. |
| `sharedCount` | `integer` | yes | How many of the organisation's diagrams have a public link now. Counted against the plan's `stableLinks`. minimum 0. |
| `autoPublish` | `boolean` | yes | "Agents publish every diagram they draw": while true, every valid drawing made through one of the organisation's agent connections or keys is stored in its private library with its source. Off by default. |
| `linksEnded` | `integer` | yes | How many public links this call ended: every one when sharing was turned off, none otherwise. minimum 0. |

## 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 |
