# Give an embed link a new address

> Page: https://docs.plotwork.dev/api/post-orgs-org-diagrams-id-embed-links-link-rotate. Index of every page: https://docs.plotwork.dev/llms.txt

A new token replaces the old one, and the old address shows the placeholder.

`POST /orgs/{org}/diagrams/{id}/embed-links/{link}/rotate`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Give an embed link a new address. |
| What does it take? | `org`, `id`, `link` in the path. |
| What does it return? | Status 200 with a body of type [`EmbedLink`](https://docs.plotwork.dev/api/schemas.md#embedlink). |
| What can go wrong? | `401` not signed in; `403` the role may not, or the request came from an origin that may not make changes; `404` no such organisation, diagram or link, 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

A new token replaces the old one, and the old address shows the placeholder. The websites and the end are kept.

## Path parameters

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

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The link, with its new address. | [`EmbedLink`](https://docs.plotwork.dev/api/schemas.md#embedlink) |
| 401 | Not signed in. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | The role may not, 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, diagram or link, 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 [`EmbedLink`](https://docs.plotwork.dev/api/schemas.md#embedlink).

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | `string` | yes |  |
| `diagramId` | `string` | yes |  |
| `url` | `string \| null` | yes | The address, `{EMBED_URL}/o/<token>.svg`. A page on one of `sites` that shows it as an image gets the picture, without its source; anything else gets a placeholder. Null when the server cannot show it again: rotate the link for a new one. |
| `label` | `string \| null` | yes | An optional name for the page it is for. |
| `sites` | `string[]` | yes | The websites a page must be on, lower case. |
| `proxiedSites` | `string[]` | yes | Sites in `sites` whose images reach Plotwork through a proxy that names no page (GitHub), so the link shows them the placeholder. |
| `expiresAt` | `integer \| null` | yes | When it stops, in milliseconds since the epoch, or null for never. |
| `expired` | `boolean` | yes |  |
| `createdBy` | `string \| null` | yes |  |
| `createdAt` | `integer` | yes |  |
| `updatedAt` | `integer` | yes |  |
| `rotatedAt` | `integer \| null` | 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 |
