---
title: DELETE /api/articles/[id]/sections/[sid]
description: Remove one section by anchor. If it was the last one, the article keeps a single empty section so it stays editable. Backs scripto section rm.
---

<Note>

The CLI equivalent is `scripto section rm <id> <anchor>`.

</Note>

Removes one section, addressed by anchor. If it was the **last** remaining section, the article keeps one empty section so it stays editable.

## Endpoint

```text
DELETE https://scripto.codika.io/api/articles/{id}/sections/{sid}
```

## Auth

`Authorization: Bearer scripto_…`

## Response (200)

```json
{ "success": true, "data": { "outline": [ "… the full fresh outline …" ] } }
```

## Errors

| HTTP | `code` | Cause | `nextAction` |
|---|---|---|---|
| 400 | `invalid-argument` | The anchor is ambiguous. | Use a longer anchor. |
| 404 | `not-found` | No such article, or no section matches the anchor. | Call GET /outline for current anchors. |
| 401 | `unauthenticated` | Missing or invalid key. | — |

## curl

```bash
curl -sS -X DELETE "https://scripto.codika.io/api/articles/$ID/sections/e5f6a7b8" \
  -H "Authorization: Bearer $SCRIPTO_API_KEY"
```

## Next

- **[GET .../outline](/api-reference/get-outline)** — re-read the anchors.
- **[Working with sections](/guides/working-with-sections)** — the loop.
