> For the complete documentation index, see [llms.txt](https://docs.stellic.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stellic.com/stellic-partner-api/audits/unlink-a-shared-requirement.md).

# Unlink a shared requirement

Use this endpoint to replace a linked shared requirement in a draft audit with a copy this audit owns, so you can edit it and later publishes of the shared requirement stop reaching it. `{requirement_id}` is the shared node's `id` (a key in `shared_requirement_mapping`), and it must be a direct child of `{parent_req_id}` in the draft `{audit_id}`.

## DELETE /audits/{audit\_id}/requirements/{parent\_req\_id}/unlink/{requirement\_id}

>

```json
{"openapi":"3.0.0","info":{"title":"Stellic for Developers","version":"1.0"},"tags":[{"name":"Audits","description":"Read, draft, edit, and publish an audit's requirement tree. Edits go to a draft; publishing recomputes student progress in the background."}],"servers":[{"url":"https://{institution}.stellic.com/partnerapi/v1","variables":{"institution":{"default":"{institution}","description":"Your institution's Stellic subdomain: the part before `.stellic.com` in the URL you use to sign in. It becomes the host in every request, as in `https://{institution}.stellic.com/partnerapi/v1/...`. Replace the `{institution}` placeholder with your subdomain before sending."}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Personal Access Token issued by your Stellic integration partner. Send it as `Authorization: Bearer <token>` on every request. One token per institution; do not share across environments."}},"schemas":{"SuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"}}},"ErrorMessage":{"type":"object","description":"Error envelope used by the programs, audits, and requirements endpoints.","properties":{"error":{"type":"string","description":"Human-readable reason. Match on it if you need to branch; the strings on each endpoint page are verbatim."}}}}},"paths":{"/audits/{audit_id}/requirements/{parent_req_id}/unlink/{requirement_id}":{"delete":{"tags":["Audits"],"parameters":[{"name":"audit_id","in":"path","required":true,"description":"Internal numeric ID of the draft audit you are editing.","schema":{"type":"integer"}},{"name":"parent_req_id","in":"path","required":true,"description":"Internal numeric ID of the parent requirement the shared requirement sits under. Must belong to `audit_id`.","schema":{"type":"integer"}},{"name":"requirement_id","in":"path","required":true,"description":"Internal numeric ID of the shared requirement node to unlink (a node with `is_shared: true` in the draft's `requirement_tree`, listed in `shared_requirement_mapping`). Must currently sit under `parent_req_id`.","schema":{"type":"integer"}}],"responses":{"200":{"description":"The shared requirement was replaced, at the same position, by an independent copy that this audit owns. The copy has a new `id`; read the draft again to pick it up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Validation failure.\n\nCommon causes:\n- No audit has this ID - returns `No Audit matches the given query.`\n- Unknown parent - returns `Invalid parent_requirement: no requirement found with id {parent_req_id}`\n- Unknown requirement - returns `Invalid child: no requirement found with id {requirement_id}`\n- Parent is not in this audit - returns `Parent requirement {parent_req_id} does not belong to audit {audit_id}`\n- Not a child of that parent - returns `Requirement {requirement_id} is not a child of parent {parent_req_id}`\n- The token's account cannot edit this audit - returns `Forbidden Access.`\n- The draft is an orphan (its published version is gone) - returns `['Cannot edit this audit. Please contact the Stellic team.']`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401":{"description":"Missing or invalid Bearer token.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}}}}}},"403":{"description":"Your IP address isn't on the allowlist for this endpoint. Contact Stellic to add it; the response includes the `client_ip` Stellic saw. Also returned, with only `error` set, when the audit isn't a draft (`Can only unlink requirements in draft audits.`) or belongs to a compliance requirement (`Compliance requirements are not available via the API.`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"client_ip":{"type":"string"}}}}}}}}}}}
```

#### What happens after the call

* A copy of the shared block takes its place at the same position, no longer shared, and the link is removed.
* Program-dependent rules on the parent and double-count rules in the draft that pointed at the block now point at the copy.
* When you publish, the published audit gets the copy.

#### Notes

* **Read the draft again after the call.** The response is only `{"success": true}`, and the copy has new IDs.
* **Use it only on shared nodes.** On a regular requirement the call still succeeds and replaces it with a copy under new IDs.
* **The token's account needs edit rights on the audit.** Without them the call returns a 400 with `Forbidden Access.`
* **Only drafts can be edited.** A published or under-review audit returns a 403 with `Can only unlink requirements in draft audits.` A draft that's lost its link to its published audit returns `['Cannot edit this audit. Please contact the Stellic team.']`
* **Mismatched IDs return 400s that name the problem,** such as `Requirement <id> is not a child of parent <id>`. A compliance requirement's audit returns a 403.

#### Related APIs

* [`GET /audits/{audit_id}`](/stellic-partner-api/audits/read-an-audit.md) to find shared nodes and the copy's new IDs.
* [`DELETE /audits/{audit_id}/requirements/{parent_req_id}/subrequirements/{subrequirement_id}`](/stellic-partner-api/audits/remove-a-sub-requirement.md) to drop a shared requirement instead.
* [`POST /audits/{audit_id}/publish`](/stellic-partner-api/audits/publish-a-draft-audit.md) to publish the draft.
