links
POST /v1/link-edits
Change or remove a target's links across the network.
Autenticación
Envía una clave de API como token de portador. Este endpoint no especifica un permiso concreto en la especificación, así que otorga a tu clave los mínimos privilegios necesarios y comprueba la respuesta en lugar de dar por sentado.
Este endpoint no requiere ningún id de organización. Su clave ya identifica la organización a la que pertenece, y la respuesta está delimitada a ella.
Pruébalo
Reemplaza cualquier elemento entre corchetes angulares por tus propios valores, y el marcador de posición key con una clave de tu panel de control.
curl -X POST https://api.zinndigital.com/v1/link-edits \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "target_id": <string>, "action": <string<rewrite, unlink>> }'¿Has iniciado sesión? La consola de la API en tu panel de control rellena el ID de tu organización real y tu propia clave, y ejecuta la solicitud contra la API en vivo para que puedas ver la respuesta real. Abre este endpoint en la consola de la API
Detalles
**The one write in this feature, and the most consequential single action in the customer surface**: it rewrites published content on every site that links to the target. It is therefore gated on its own permission, `links.edit`, which `links.view` does not imply and which the `read_only` role does not hold. **Returns `202`, never the result.** Two hundred sites is minutes of work on the boxes; holding the request open is the uncached hot-path work CLAUDE.md 2.16 forbids. Poll `getLinkEdit` and read each site's outcome from `items`. **How the change is made.** Each item is one exact `<a>` tag on one site, replaced by a whole-site string replacement. That is what makes the edit *idempotent* (the second run finds nothing), *reversible* (`undoLinkEdit` swaps the two strings) and cheap on a large site (no post content is ever read back). Only the `href` — and the text, if you supply one — changes: `rel="nofollow"`, `target` and the theme's classes are carried through byte for byte, because for a PBN operator dropping a `rel` across two hundred sites is a change to what the link *does*. **`unlink` keeps the words.** The tag is replaced by its inner HTML, so an image link leaves the image and a bold anchor leaves the bold. **A host with no managed command is `unsupported`, not failed.** this platform exposes no shell, so those sites report that per item and the rest of the network still changes.
Cuerpo de la solicitud
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
target_id | string | Sí | — |
action | string<rewrite, unlink> | Sí | — |
href | string | No | Where the links should point, for a `rewrite`. **`http`/`https` or a site-relative path only** — a scheme-relative `//host` form is refused with a message telling the operator t… |
anchor_text | string | No | New visible text. Omit to keep whatever each link already says. |
site_ids | string[] | No | Narrow the edit to these sites. **Omit the field entirely to change every site**; an empty array is refused, because it is a UI that failed to send a selection rather than a req… |
Respuesta
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
id | string | Sí | — |
target_id | string | No | — |
target_host | string | Sí | The host as it read when the edit was made. Kept as a string as well as a key, because a rewrite can empty a target of its last link and an audit line reading "edited (deleted t… |
action | string<rewrite, unlink> | Sí | — |
new_href | string | No | — |
new_text | string | No | New visible text. Empty means *keep whatever each link already says* — which is the common case, because one target's links carry many different anchors and flattening them all… |
status | string<pending, running, applied, partial, failed> | Sí | `partial` is the honest answer when some sites succeeded and some did not, and it exists because the other two are lies in that case: an operator's next action depends entirely… |
expected_links | integer | Sí | What the operator was told would change, **recorded when they confirmed it** rather than recomputed later. The whole value of a confirmation is that it can be held up against th… |
expected_posts | integer | Sí | — |
expected_sites | integer | Sí | — |
undo_of | string | No | The edit this one reverses, if any. |
undone_by | string | No | The edit that has already reversed this one. Present so the screen offers undo once — two undos of one edit put the original change back. |
created_at | string | Sí | — |
finished_at | string | No | — |
items | LinkEditItem[] | No | — |
Errores que este endpoint puede devolver
401 · 403 · 404 · 422 · 503